octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #65244] Simplify code complexity of perms.cc


From: Hendrik K
Subject: [Octave-bug-tracker] [bug #65244] Simplify code complexity of perms.cc
Date: Thu, 8 Feb 2024 21:49:11 -0500 (EST)

Follow-up Comment #6, bug#65244 (group octave):

I have created a new patch incorporating the change of myidx to
octave_idx_type. 

In line with this change to use octave_idx_type for octave array indexing, I
changed N_el (also related to indexing) from "int" to "octave_idx_type".
On top, I also changed the factorial from double to long double to prevent
potential precision loss for the factorial result as it is used to size the
resulting array.
And for code clarity, I modified the way on how the resulting array size is
derived when using "unique" (build up a denominator and do one final division
reflecting the analytical reasoning instead of successive individual
divisions). 

Note that in practice, the computer memory would be exhausted long beforehand
before the any of these changes were to become relevant. 
But the code soundness and clarity is improved, so worth the effort. 

(file #55679)

    _______________________________________________________

Additional Item Attachment:

File name: patch_65244_v1.cset            Size:6 KB
    <https://file.savannah.gnu.org/file/patch_65244_v1.cset?file_id=55679>


    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://git.savannah.nongnu.org/cgit/administration/savane.git/snapshot/savane-374ad428f2bd97d03e9733e262e1a321118d5556.tar.gz


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65244>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]