]> www.ginac.de Git - cln.git/blobdiff - src/numtheory/cl_nt_cornacchia4.cc
Replace unused macro with cl_unused.
[cln.git] / src / numtheory / cl_nt_cornacchia4.cc
index 614db871fec10ad3860964dbf2ca2993914e5be4..0137996d9407c71c451c17b29f7b1ce626a86677 100644 (file)
@@ -1,7 +1,7 @@
 // cornacchia4().
 
 // General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
 
 // Specification.
 #include "cln/numtheory.h"
@@ -9,7 +9,7 @@
 
 // Implementation.
 
-#include "cl_I.h"
+#include "integer/cl_I.h"
 
 namespace cln {
 
@@ -57,7 +57,7 @@ const cornacchia_t cornacchia4 (const cl_I& d, const cl_I& p)
                if (d==7) return cornacchia_t(1, 1,1);
                return cornacchia_t(0);
        }
-       switch (FN_to_L(logand(d,7))) {
+       switch (FN_to_V(logand(d,7))) {
                case 0: case 4: {
                        // d == 0 mod 4
                        var cornacchia_t s = cornacchia1(d>>2,p);
@@ -92,7 +92,7 @@ const cornacchia_t cornacchia4 (const cl_I& d, const cl_I& p)
        if (init.condition)
                return init.condition;
        if (init.solutions != 2)
-               cl_abort();
+               throw runtime_exception();
        // Compute x with x^2+d == 0 mod 4*p.
        var cl_I x0 = R->retract(init.solution[0]);
        if (evenp(x0)) { x0 = p-x0; } // Enforce x0^2+d == 0 mod 4.