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: Arun Giridhar
Subject: [Octave-bug-tracker] [bug #61312] Extending isprime() with Miller-Rabin test
Date: Mon, 18 Oct 2021 10:29:58 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:93.0) Gecko/20100101 Firefox/93.0

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

@Kai: Thank you. Here are my thoughts:

1. I think isprime.m should continue to exist instead of being replaced
completely with isprime.cc, because it handles the cases where the input is a
vector or matrix much more easily than reimplementing that part in C++. It
also acts as a good front-end for negative and complex inputs which won't be
sped up much in C++. Only the core primality calculation has been moved to
C++.

2. I have moved all the newly added C++ functions from
libinterp/corefcn/data.cc to a new file called
libinterp/corefcn/__isprimelarge__.cc but I have not added it to the Mercurial
repository. Is it only "hg add [filename]" or are there other steps as well?

3. I also need guidance on how to add the new file to Octave's build system. I
expect it should be added to Makefile.in but I see that gcd.cc for example is
mentioned in Makefile.in in multiple places. If you can make the changes to
Makefile.in this time I can use it as a template for my future patches. Does
it also need to be added to libinterp/corefcn/module.mk?

4. I copied over all the header files from data.cc into the new
__isprimelarge__.cc. I expect many of them can be removed, Once I learn from
you how to add it to the build system, I will prune the list of included
files.

Attachments:

1. New file __isprimelarge__.cc to be added to libinterp/corefcn/ and to the
build system with Kai's guidance.

2. Updated patch (Patch 8) that undoes the additions to data.cc from earlier
patches, but retains the changes to isprime.m, factor.m and NEWS. This patch
won't be functional until the new __isprimelarge__.cc is added to the build
system.

(file #52117, file #52118)
    _______________________________________________________

Additional Item Attachment:

File name: patch8.patch                   Size:4 KB
    <https://file.savannah.gnu.org/file/patch8.patch?file_id=52117>

File name: __isprimelarge__.cc            Size:6 KB
    <https://file.savannah.gnu.org/file/__isprimelarge__.cc?file_id=52118>



    _______________________________________________________

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]