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

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

[Octave-bug-tracker] [bug #61312] Extending isprime() with Miller-Rabin


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #61312] Extending isprime() with Miller-Rabin test
Date: Sun, 17 Oct 2021 22:16:50 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36

Follow-up Comment #9, bug #61312 (project octave):

@arungiridhar, recently I feel excited, when I see you submitted a new patch
😉  Same this time:


>> tic; n = n(isprime(n)); toc      # patch 7
Elapsed time is 0.0182581 seconds.
>> tic; n = n(isprime2(n)); toc     # Octave 7
Elapsed time is 128.464 seconds.


Octave's current version has indeed an enormous memory footprint for large
inputs.

Your changes look very good to me.

As lots of code was moved from Octave to C++, I am almost tempted to suggest a
new clean and complete C++ re-implementation in a new file
`libinterp/corefun/isprime.cc` (like `gcd.cc` in the same directory)?

Are you interested in further work into this direction?

Otherwise, I can suggest a patch (in a few days) [<-- dangerous words in this
bug tracker, that might turn out to months sometimes 😇].


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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