- Timestamp:
- Sep 16, 2014, 4:56:19 PM (10 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
- Children:
- 5b45a4ff15d0998cc64c730af75c1c1f773d4a77
- Parents:
- 4ec0f01d431893a4c0997d2bdfab87cb8d37e03e
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-09-16 16:56:19+02:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-09-23 20:10:49+02:00
- Location:
- libpolys
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/coeffs.h
r4ec0f0 reb55f8a 708 708 static inline BOOLEAN n_DBTest(number n, const char *filename, const int linenumber, const coeffs r) 709 709 #else 710 static inline BOOLEAN n_DBTest(number, const char*, const int, const coeffs) 710 static inline BOOLEAN n_DBTest(number, const char*, const int, const coeffs) // is it really necessary to define this function in any case? 711 711 #endif 712 712 { 713 assume(r != NULL); 714 #ifdef LDEBUG 715 assume(r->cfDBTest != NULL); 713 #ifndef LDEBUG 714 return TRUE; 715 #else 716 assume(r != NULL); assume(r->cfDBTest != NULL); 716 717 return r->cfDBTest(n, filename, linenumber, r); 717 #else718 return TRUE;719 718 #endif 720 719 } -
libpolys/coeffs/modulop.cc
r4ec0f0 reb55f8a 54 54 BOOLEAN npGreaterZero (number k, const coeffs r) 55 55 { 56 assume( n_Test(k, r));56 n_Test(k, r); 57 57 58 58 int h = (int)((long) k); … … 70 70 number npMult (number a,number b, const coeffs r) 71 71 { 72 assume( n_Test(a, r));73 assume( n_Test(b, r));72 n_Test(a, r); 73 n_Test(b, r); 74 74 75 75 if (((long)a == 0) || ((long)b == 0)) 76 76 return (number)0; 77 77 number c = npMultM(a,b, r); 78 assume( n_Test(c, r));78 n_Test(c, r); 79 79 return c; 80 80 } … … 89 89 90 90 number c = (number)ii; 91 assume( n_Test(c, r));91 n_Test(c, r); 92 92 return c; 93 93 … … 100 100 int npInt(number &n, const coeffs r) 101 101 { 102 assume( n_Test(n, r));102 n_Test(n, r); 103 103 104 104 if ((long)n > (((long)r->ch) >>1)) return (int)((long)n -((long)r->ch)); … … 108 108 number npAdd (number a, number b, const coeffs r) 109 109 { 110 assume( n_Test(a, r));111 assume( n_Test(b, r));110 n_Test(a, r); 111 n_Test(b, r); 112 112 113 113 number c = npAddM(a,b, r); 114 114 115 assume( n_Test(c, r));115 n_Test(c, r); 116 116 117 117 return c; … … 120 120 number npSub (number a, number b, const coeffs r) 121 121 { 122 assume( n_Test(a, r));123 assume( n_Test(b, r));122 n_Test(a, r); 123 n_Test(b, r); 124 124 125 125 number c = npSubM(a,b,r); 126 126 127 assume( n_Test(c, r));127 n_Test(c, r); 128 128 129 129 return c; … … 132 132 BOOLEAN npIsZero (number a, const coeffs r) 133 133 { 134 assume( n_Test(a, r));134 n_Test(a, r); 135 135 136 136 return 0 == (long)a; … … 139 139 BOOLEAN npIsOne (number a, const coeffs r) 140 140 { 141 assume( n_Test(a, r));141 n_Test(a, r); 142 142 143 143 return 1 == (long)a; … … 146 146 BOOLEAN npIsMOne (number a, const coeffs r) 147 147 { 148 assume( n_Test(a, r));148 n_Test(a, r); 149 149 150 150 return ((r->npPminus1M == (long)a)&&((long)1!=(long)a)); … … 201 201 inline number npInversM (number c, const coeffs r) 202 202 { 203 assume( n_Test(c, r));203 n_Test(c, r); 204 204 #ifndef HAVE_DIV_MOD 205 205 number d = (number)(long)r->npExpTable[r->npPminus1M - r->npLogTable[(long)c]]; … … 213 213 number d = (number)inv; 214 214 #endif 215 assume( n_Test(d, r));215 n_Test(d, r); 216 216 return d; 217 217 … … 220 220 number npDiv (number a,number b, const coeffs r) 221 221 { 222 assume( n_Test(a, r));223 assume( n_Test(b, r));222 n_Test(a, r); 223 n_Test(b, r); 224 224 225 225 //#ifdef NV_OPS … … 247 247 #endif 248 248 249 assume( n_Test(d, r));249 n_Test(d, r); 250 250 return d; 251 251 … … 253 253 number npInvers (number c, const coeffs r) 254 254 { 255 assume( n_Test(c, r));255 n_Test(c, r); 256 256 257 257 if ((long)c==0) … … 262 262 number d = npInversM(c,r); 263 263 264 assume( n_Test(d, r));264 n_Test(d, r); 265 265 return d; 266 266 … … 269 269 number npNeg (number c, const coeffs r) 270 270 { 271 assume( n_Test(c, r));271 n_Test(c, r); 272 272 273 273 if ((long)c==0) return c; … … 275 275 #if 0 276 276 number d = npNegM(c,r); 277 assume( n_Test(d, r));277 n_Test(d, r); 278 278 return d; 279 279 #else 280 280 c = npNegM(c,r); 281 assume( n_Test(c, r));281 n_Test(c, r); 282 282 return c; 283 283 #endif … … 286 286 BOOLEAN npGreater (number a,number b, const coeffs r) 287 287 { 288 assume( n_Test(a, r));289 assume( n_Test(b, r));288 n_Test(a, r); 289 n_Test(b, r); 290 290 291 291 //return (long)a != (long)b; … … 295 295 BOOLEAN npEqual (number a,number b, const coeffs r) 296 296 { 297 assume( n_Test(a, r));298 assume( n_Test(b, r));297 n_Test(a, r); 298 n_Test(b, r); 299 299 300 300 // return (long)a == (long)b; … … 305 305 void npWrite (number &a, const coeffs r) 306 306 { 307 assume( n_Test(a, r));307 n_Test(a, r); 308 308 309 309 if ((long)a>(((long)r->ch) >>1)) StringAppend("-%d",(int)(((long)r->ch)-((long)a))); … … 314 314 void npPower (number a, int i, number * result, const coeffs r) 315 315 { 316 assume( n_Test(a, r));316 n_Test(a, r); 317 317 318 318 if (i==0) … … 379 379 } 380 380 } 381 assume( n_Test(*a, r));381 n_Test(*a, r); 382 382 return s; 383 383 } -
libpolys/polys/ext_fields/algext.cc
r4ec0f0 reb55f8a 936 936 } 937 937 definiteReduce(p, dst->extRing->qideal->m[0], dst); 938 assume (p_Test (p, dst->extRing));938 p_Test (p, dst->extRing); 939 939 if (!DENIS1(fa)) 940 940 { 941 941 definiteReduce(q, dst->extRing->qideal->m[0], dst); 942 assume (p_Test (q, dst->extRing));942 p_Test (q, dst->extRing); 943 943 if (q != NULL) 944 944 { … … 999 999 poly g = prMapR(f, nMap, rSrc, rDst); 1000 1000 1001 assume(n_Test((number)g, dst));1001 n_Test((number)g, dst); 1002 1002 return (number)g; 1003 1003 } … … 1029 1029 result=(number)g; 1030 1030 1031 assume(n_Test((number)result, dst));1031 n_Test((number)result, dst); 1032 1032 return (number)result; 1033 1033 } -
libpolys/polys/ext_fields/transext.cc
r4ec0f0 reb55f8a 80 80 81 81 #ifdef LDEBUG 82 #define ntTest(a) assume(ntDBTest(a,__FILE__,__LINE__,cf))82 #define ntTest(a) ntDBTest(a,__FILE__,__LINE__,cf) 83 83 BOOLEAN ntDBTest(number a, const char *f, const int l, const coeffs r); 84 84 #else … … 193 193 const poly num = NUM(t); 194 194 assume(num != NULL); /**< t != 0 ==> numerator(t) != 0 */ 195 assume( _p_Test(num, ntRing,1) ); 195 196 p_Test(num, ntRing); 196 197 197 198 const poly den = DEN(t); … … 199 200 if (den != NULL) // !DENIS1(f) 200 201 { 201 assume( _p_Test(den, ntRing,1));202 p_Test(den, ntRing); 202 203 203 204 if(p_IsConstant(den, ntRing) && (n_IsOne(pGetCoeff(den), ntCoeffs))) … … 1760 1761 { 1761 1762 if (n_IsZero(a, src)) return NULL; 1762 assume(n_Test(a, src));1763 n_Test(a, src); 1763 1764 assume(src->rep == dst->extRing->cf->rep); 1764 1765 if ((SR_HDL(a) & SR_INT) || (a->s==3)) … … 1782 1783 { 1783 1784 if (n_IsZero(a, src)) return NULL; 1784 assume(n_Test(a, src));1785 n_Test(a, src); 1785 1786 nMapFunc nMap=n_SetMap(src,dst->extRing->cf); 1786 1787 poly p=p_NSet(nMap(a, src,dst->extRing->cf), dst->extRing); … … 1796 1797 { 1797 1798 if (n_IsZero(a, src)) return NULL; 1798 assume(n_Test(a, src));1799 n_Test(a, src); 1799 1800 /* mapping via intermediate int: */ 1800 1801 int n = n_Int(a, src); … … 1834 1835 COM(result) = COM(f); 1835 1836 //check_N((number)result,dst); 1836 assume(n_Test((number)result, dst));1837 n_Test((number)result, dst); 1837 1838 return (number)result; 1838 1839 } … … 1861 1862 COM(result) = COM(f); 1862 1863 //check_N((number)result,dst); 1863 assume(n_Test((number)result, dst));1864 n_Test((number)result, dst); 1864 1865 return (number)result; 1865 1866 } … … 1867 1868 number ntCopyAlg(number a, const coeffs cf, const coeffs dst) 1868 1869 { 1869 assume( n_Test(a, cf) );1870 n_Test(a, cf) ; 1870 1871 if (n_IsZero(a, cf)) return NULL; 1871 1872 return ntInit(prCopyR((poly)a, cf->extRing, dst->extRing),dst); … … 1874 1875 number ntGenAlg(number a, const coeffs cf, const coeffs dst) 1875 1876 { 1876 assume( n_Test(a, cf) );1877 n_Test(a, cf) ; 1877 1878 if (n_IsZero(a, cf)) return NULL; 1878 1879 … … 1884 1885 number ntMap0P(number a, const coeffs src, const coeffs dst) 1885 1886 { 1886 assume( n_Test(a, src) );1887 n_Test(a, src) ; 1887 1888 if (n_IsZero(a, src)) return NULL; 1888 1889 // int p = rChar(dst->extRing); … … 1899 1900 fraction f = (fraction)omAlloc0Bin(fractionObjectBin); 1900 1901 NUM(f) = g; // DEN(f) = NULL; COM(f) = 0; 1901 assume(n_Test((number)f, dst));1902 n_Test((number)f, dst); 1902 1903 //check_N((number)f,dst); 1903 1904 return (number)f; … … 1907 1908 number ntMapPP(number a, const coeffs src, const coeffs dst) 1908 1909 { 1909 assume( n_Test(a, src) );1910 n_Test(a, src) ; 1910 1911 if (n_IsZero(a, src)) return NULL; 1911 1912 assume(src == dst->extRing->cf); … … 1914 1915 fraction f = (fraction)omAlloc0Bin(fractionObjectBin); 1915 1916 NUM(f) = p; // DEN(f) = NULL; COM(f) = 0; 1916 assume(n_Test((number)f, dst));1917 n_Test((number)f, dst); 1917 1918 //check_N((number)f,dst); 1918 1919 return (number)f; … … 1922 1923 number ntMapUP(number a, const coeffs src, const coeffs dst) 1923 1924 { 1924 assume( n_Test(a, src) );1925 n_Test(a, src) ; 1925 1926 if (n_IsZero(a, src)) return NULL; 1926 1927 /* mapping via intermediate int: */ … … 1937 1938 fraction f = (fraction)omAlloc0Bin(fractionObjectBin); 1938 1939 NUM(f) = p; // DEN(f) = NULL; COM(f) = 0; 1939 assume(n_Test((number)f, dst));1940 n_Test((number)f, dst); 1940 1941 //check_N((number)f,dst); 1941 1942 return (number)f; -
libpolys/polys/kbuckets.cc
r4ec0f0 reb55f8a 92 92 { 93 93 assume(bucket->buckets[i]!=NULL); 94 _p_Test(bucket->coef[i],bucket->bucket_ring,PDEBUG);95 94 p_Test(bucket->coef[i],bucket->bucket_ring); 95 } 96 96 #endif 97 97 pFalseReturn(p_Test(bucket->buckets[i], bucket->bucket_ring)); -
libpolys/polys/monomials/p_polys.cc
r4ec0f0 reb55f8a 694 694 long p_DegW(poly p, const short *w, const ring R) 695 695 { 696 assume( p_Test(p, R));696 p_Test(p, R); 697 697 assume( w != NULL ); 698 698 long r=-LONG_MAX; … … 3882 3882 qq = p_PermPoly(zz, par_perm-1, srcExtRing, dst, nMap, NULL, rVar (srcExtRing)-1); 3883 3883 3884 assume (p_Test (qq, dst));3884 p_Test (qq, dst); 3885 3885 3886 3886 // poly p_PermPoly (poly p, int * perm, const ring oldRing, const ring dst, nMapFunc nMap, int *par_perm, int OldPar) … … 3922 3922 number n = nMap(p_GetCoeff(p, oldRing), oldRing->cf, dst->cf); 3923 3923 3924 assume (n_Test (n,dst->cf));3924 n_Test (n,dst->cf); 3925 3925 3926 3926 if ( nCoeff_is_algExt(dst->cf) ) -
libpolys/polys/monomials/p_polys.h
r4ec0f0 reb55f8a 245 245 if (p != NULL) 246 246 { 247 #ifdef PDEBUG248 247 p_Test(p, r); 249 #endif250 248 if (rOrd_SetCompRequiresSetm(r)) 251 249 { … … 806 804 static inline poly p_Copy(poly p, const ring r) 807 805 { 808 #ifdef PDEBUG 809 poly pp= r->p_Procs->p_Copy(p, r); 806 const poly pp = r->p_Procs->p_Copy(p, r); 810 807 p_Test(pp,r); 811 808 return pp; 812 #else813 return r->p_Procs->p_Copy(p, r);814 #endif815 809 } 816 810 … … 831 825 static inline poly p_Copy(poly p, const ring lmRing, const ring tailRing) 832 826 { 827 if (p != NULL) 828 { 833 829 #ifndef PDEBUG 834 if (tailRing == lmRing) 835 return tailRing->p_Procs->p_Copy(p, tailRing); 836 #endif 837 if (p != NULL) 838 { 830 if (tailRing == lmRing) 831 return tailRing->p_Procs->p_Copy(p, tailRing); 832 #endif 839 833 poly pres = p_Head(p, lmRing); 840 834 pNext(pres) = tailRing->p_Procs->p_Copy(pNext(p), tailRing); … … 848 842 static inline void p_Delete(poly *p, const ring r) 849 843 { 844 assume( p!= NULL ); 850 845 r->p_Procs->p_Delete(p, r); 851 846 } … … 853 848 static inline void p_Delete(poly *p, const ring lmRing, const ring tailRing) 854 849 { 850 assume( p!= NULL ); 851 if (*p != NULL) 852 { 855 853 #ifndef PDEBUG 856 if (tailRing == lmRing) 857 { 858 tailRing->p_Procs->p_Delete(p, tailRing); 859 return; 860 } 861 #endif 862 if (*p != NULL) 863 { 854 if (tailRing == lmRing) 855 { 856 p_Delete(p, tailRing); 857 return; 858 } 859 #endif 864 860 if (pNext(*p) != NULL) 865 tailRing->p_Procs->p_Delete(&pNext(*p), tailRing);861 p_Delete(&pNext(*p), tailRing); 866 862 p_LmDelete(p, lmRing); 867 863 } … … 911 907 #ifndef PDEBUG 912 908 if (lmRing == tailRing) 913 {914 909 return p_Mult_nn(p, n, tailRing); 915 }916 910 #endif 917 911 poly pnext = pNext(p); … … 1774 1768 { 1775 1769 if (p == NULL) return TRUE; 1770 p_Test(p, r); 1776 1771 return (pNext(p)==NULL) && p_LmIsConstantComp(p, r); 1777 1772 } … … 1779 1774 static inline BOOLEAN p_IsConstant(const poly p, const ring r) 1780 1775 { 1781 assume( p_Test(p, r) );1782 1776 if (p == NULL) return TRUE; 1777 p_Test(p, r); 1783 1778 return (pNext(p)==NULL) && p_LmIsConstant(p, r); 1784 1779 } … … 1787 1782 static inline BOOLEAN p_IsOne(const poly p, const ring R) 1788 1783 { 1789 assume( p_Test(p, R));1784 p_Test(p, R); 1790 1785 return (p_IsConstant(p, R) && n_IsOne(p_GetCoeff(p, R), R->cf)); 1791 1786 } … … 1793 1788 static inline BOOLEAN p_IsConstantPoly(const poly p, const ring r) 1794 1789 { 1790 p_Test(p, r); 1795 1791 poly pp=p; 1796 1792 while(pp!=NULL)
Note: See TracChangeset
for help on using the changeset viewer.