]> www.ginac.de Git - cln.git/blobdiff - src/base/digitseq/cl_DS_mul_fftm.h
* Add table of contents in TeX output.
[cln.git] / src / base / digitseq / cl_DS_mul_fftm.h
index 9b973647a44077dc33c620a6d6cfc1dd56752275..a984802ce039e8179a26fda2681a2e133dba6fbd 100644 (file)
@@ -11,7 +11,7 @@
 // multiplication, multiplication by the Nth root and unity and division
 // by N. Hence we can use the domain Z/(p^m Z) even if p is not a prime!
 
-// We use the Schönhage-Strassen choice of the modulus: p = 2^R+1. This
+// We use the Schönhage-Strassen choice of the modulus: p = 2^R+1. This
 // has two big advantages: Multiplication and division by 2 (which is a
 // (2R)th root of unity) or a power of 2 is just a shift and an subtraction.
 // And multiplication mod p is just a normal multiplication, followed by
@@ -469,7 +469,7 @@ static void mulu_fftm (const uintL r, const uintC R, // R = 2^r
                var uintC zerodigits = chlen - zchlen;
                for (i = 0; i < M; i++)
                        if (DS_test_loop(Z(i) lspop chlen,zerodigits,Z(i) lspop zchlen))
-                               cl_abort();
+                               throw runtime_exception();
        }
        #endif
        // Put together result.
@@ -479,14 +479,14 @@ static void mulu_fftm (const uintL r, const uintC R, // R = 2^r
                if (zchlen <= destlen) {
                        if (addto_loop_lsp(Z(i),destptr,zchlen))
                                if (inc_loop_lsp(destptr lspop zchlen,destlen-zchlen))
-                                       cl_abort();
+                                       throw runtime_exception();
                } else {
                        #ifdef DEBUG_FFTM
                        if (DS_test_loop(Z(i) lspop zchlen,zchlen-destlen,Z(i) lspop destlen))
-                               cl_abort();
+                               throw runtime_exception();
                        #endif
                        if (addto_loop_lsp(Z(i),destptr,destlen))
-                               cl_abort();
+                               throw runtime_exception();
                }
                if (destlen <= k) {
                        i++;
@@ -496,7 +496,7 @@ static void mulu_fftm (const uintL r, const uintC R, // R = 2^r
        #ifdef DEBUG_FFTM
        // Check that Z(i)..Z(M-1) are all zero.
        if (test_loop_up(&arrZ[chlen*i],chlen*(M-i)))
-               cl_abort();
+               throw runtime_exception();
        #endif
        #undef diff
        #undef sum
@@ -562,7 +562,7 @@ static uintC numpieces (uintL r, uintL m, uintC len1, uintC len2)
        var uintC piecelen2 = (M+1-ceiling(len1,k))*k;
        #ifdef DEBUG_FFTM
        if ((sintC)piecelen2 <= 0)
-               cl_abort();
+               throw runtime_exception();
        #endif
        return ceiling(len2,piecelen2);
 }
@@ -592,7 +592,7 @@ static void mulu_fft_modm (const uintD* sourceptr1, uintC len1,
        }
        #ifdef DEBUG_FFTM
        if (!(m > 0 && m <= r+1 && okfor(r,m,len1,len1)))
-               cl_abort();
+               throw runtime_exception();
        #endif
        if (okfor(r,m,len1,len2)) {
                if ((m <= r) && (r > log2_intDsize+2) && okfor(r-1,m,len1,ceiling(len2,2)))
@@ -644,7 +644,7 @@ static void mulu_fft_modm (const uintD* sourceptr1, uintC len1,
                }
                if (addto_loop_lsp(tmpptr,destptr,destlenp))
                        if (inc_loop_lsp(destptr lspop destlenp,destlen-destlenp))
-                               cl_abort();
+                               throw runtime_exception();
                // Decrement len2.
                destptr = destptr lspop len2p;
                destlen -= len2p;