Changeset 01e8874 in git
- Timestamp:
- Jun 4, 2009, 7:54:59 PM (14 years ago)
- Branches:
- (u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
- Children:
- 51d7f7bf9e26957b6f4bfed8b88ec964eb69f77a
- Parents:
- ca4d0e6c613744c68c30ffd7c388dc69dcc0a538
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/NTLconvert.cc
rca4d0e6 r01e8874 1 /* $Id: NTLconvert.cc,v 1.2 5 2008-08-20 13:35:55Singular Exp $ */1 /* $Id: NTLconvert.cc,v 1.26 2009-06-04 17:50:49 Singular Exp $ */ 2 2 #include <config.h> 3 3 … … 113 113 i=f; 114 114 115 int j=0;116 115 int NTLcurrentExp=i.exp(); 117 116 int largestExp=i.exp(); … … 172 171 i=f; 173 172 174 int j=0;175 173 int NTLcurrentExp=i.exp(); 176 174 int largestExp=i.exp(); … … 251 249 i=f; 252 250 253 int j=0;254 251 int NTLcurrentExp=i.exp(); 255 252 int largestExp=i.exp(); … … 464 461 CFFList rueckgabe; 465 462 ZZ_pX polynom; 466 long exponent;467 463 CanonicalForm bigone; 468 464 … … 490 486 CFFList rueckgabe; 491 487 zz_pX polynom; 492 long exponent;493 488 CanonicalForm bigone; 494 489 … … 699 694 i=f; 700 695 701 int j=0;702 696 int NTLcurrentExp=i.exp(); 703 697 int largestExp=i.exp(); … … 1031 1025 i=f; 1032 1026 1033 int j=0;1034 1027 int NTLcurrentExp=i.exp(); 1035 1028 int largestExp=i.exp(); … … 1062 1055 i=f; 1063 1056 1064 int j=0;1065 1057 int NTLcurrentExp=i.exp(); 1066 1058 int largestExp=i.exp(); … … 1090 1082 i=f; 1091 1083 1092 int j=0;1093 1084 int NTLcurrentExp=i.exp(); 1094 1085 int largestExp=i.exp(); -
factory/cf_factor.cc
rca4d0e6 r01e8874 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: cf_factor.cc,v 1.4 2 2008-07-01 13:53:02Singular Exp $ */2 /* $Id: cf_factor.cc,v 1.43 2009-06-04 17:50:49 Singular Exp $ */ 3 3 4 4 //{{{ docu … … 40 40 int getExp(); /* cf_char.cc */ 41 41 42 static bool isUnivariateBaseDomain( const CanonicalForm & f )43 {44 CFIterator i = f;45 bool ok = i.coeff().inBaseDomain();46 i++;47 while ( i.hasTerms() && ( ok = ok && i.coeff().inBaseDomain() ) ) i++;48 return ok;49 }42 //static bool isUnivariateBaseDomain( const CanonicalForm & f ) 43 //{ 44 // CFIterator i = f; 45 // bool ok = i.coeff().inBaseDomain(); 46 // i++; 47 // while ( i.hasTerms() && ( ok = ok && i.coeff().inBaseDomain() ) ) i++; 48 // return ok; 49 //} 50 50 51 51 void find_exp(const CanonicalForm & f, int * exp_f) … … 168 168 void out_cff(CFFList &L) 169 169 { 170 int n = L.length();170 //int n = L.length(); 171 171 CFFListIterator J=L; 172 172 int j=0; … … 179 179 void test_cff(CFFList &L,const CanonicalForm & f) 180 180 { 181 int n = L.length();181 //int n = L.length(); 182 182 CFFListIterator J=L; 183 183 CanonicalForm t=1; -
factory/cf_gcd.cc
rca4d0e6 r01e8874 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: cf_gcd.cc,v 1.6 8 2008-09-22 16:26:42Singular Exp $ */2 /* $Id: cf_gcd.cc,v 1.69 2009-06-04 17:50:49 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 239 239 //}}} 240 240 241 static CanonicalForm 242 gcd_poly_univar0( const CanonicalForm & F, const CanonicalForm & G, bool primitive ) 241 static CanonicalForm gcd_poly_univar0( const CanonicalForm & F, const CanonicalForm & G, bool primitive ) 243 242 { 244 243 CanonicalForm f, g, c, cg, cl, BB, B, M, q, Dp, newD, D, newq; 245 int p, i , n;244 int p, i; 246 245 247 246 if ( primitive ) … … 1088 1087 CanonicalForm chinrem_gcd ( const CanonicalForm & FF, const CanonicalForm & GG ) 1089 1088 { 1090 CanonicalForm f, g, cg, cl, q , Dp, newD, D, newq;1091 int p, i, dp_deg, d_deg; ;1092 1093 CanonicalForm cd = bCommonDen( FF);1089 CanonicalForm f, g, cg, cl, q(0), Dp, newD, D, newq; 1090 int p, i, dp_deg, d_deg; 1091 1092 CanonicalForm cd ( bCommonDen( FF )); 1094 1093 f=cd*FF; 1095 1094 f /=vcontent(f,Variable(1)); … … 1103 1102 //g /=vcontent(g,Variable(1)); 1104 1103 1105 q = 0;1106 1104 i = cf_getNumBigPrimes() - 1; 1107 1105 cl = f.lc()* g.lc(); -
factory/cf_gcd_charp.cc
rca4d0e6 r01e8874 30 30 static int degWRT(CanonicalForm F, const int lev); 31 31 static CanonicalForm lcoefWRT( const CanonicalForm & F, const int lev); 32 static CanonicalForm newtonInterp(CFList &alpha, CFList &u, const Variable & x);33 32 static CanonicalForm simpleGCD(const CanonicalForm & A, const CanonicalForm & B); 34 33 CanonicalForm newGCD(CanonicalForm A, CanonicalForm B); … … 231 230 CanonicalForm result = 0; 232 231 int i, j; 233 int fieldSize = pow(getCharacteristic(), getGFDegree());232 int fieldSize = (int)pow(getCharacteristic(), getGFDegree()); 234 233 CanonicalForm g; 235 234 for(i = 0; i <= degree(A); i++) … … 301 300 // The current base domain must be GF(p^j), with j a multiple of k. 302 301 { 303 int p = getCharacteristic();302 //int p = getCharacteristic(); 304 303 int expon = getGFDegree(); 305 304 int extExp = expon / k; … … 312 311 // The current base domain must be GF(p^j), with j a multiple of k. 313 312 { 314 int p = getCharacteristic();313 //int p = getCharacteristic(); 315 314 int expon = getGFDegree(); 316 315 //cout << "Expon: " << expon << endl; … … 352 351 { 353 352 k=getGFDegree(); 354 fieldSize = pow(p, k);353 fieldSize = (int)pow(p, k); 355 354 } 356 355 … … 392 391 GFRandom genGF; 393 392 FFRandom genFF; 394 int i , j;393 int i; 395 394 int used; 396 395 -
factory/fac_ezgcd.cc
rca4d0e6 r01e8874 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: fac_ezgcd.cc,v 1.2 8 2007-09-27 16:06:59 Singular Exp $ */2 /* $Id: fac_ezgcd.cc,v 1.29 2009-06-04 17:50:49 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 232 232 DEBOUTLN( cerr, "ezgcdspec: (S1)" ); 233 233 Ft = ezgcd( F, F.deriv( x ) ); 234 if ( Ft.isOne() ) { 234 if ( Ft.isOne() ) 235 { 235 236 // In this case F is squarefree and we came here by bad chance 236 237 // (means: bad evaluation point). Try again with another … … 302 303 findeval( const CanonicalForm & F, const CanonicalForm & G, CanonicalForm & Fb, CanonicalForm & Gb, CanonicalForm & Db, REvaluation & b, int delta, int degF, int degG ) 303 304 { 304 int i;305 305 bool ok; 306 306 if ( delta != 0 ) -
factory/fac_multihensel.cc
rca4d0e6 r01e8874 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: fac_multihensel.cc,v 1.1 0 2008-03-17 17:44:04Singular Exp $ */2 /* $Id: fac_multihensel.cc,v 1.11 2009-06-04 17:50:49 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 37 37 CanonicalForm g, bb, b = mapinto( C ); 38 38 int j; 39 for ( j = 1; j < r; j++ ) { 39 for ( j = 1; j < r; j++ ) 40 { 40 41 extgcdrest( mapinto( P[j] ), mapinto( Q[j] ), mapinto( S[j] ), mapinto( T[j] ), b, bb, a[j], pk ); 41 42 b = bb; … … 51 52 { 52 53 CanonicalForm pprod = 1, sum = 0; 53 for ( int i = 1; i <= r; i++ ) { 54 for ( int i = 1; i <= r; i++ ) 55 { 54 56 sum += pprod * A[i] * Q[i]; 55 57 pprod *= P[i]; … … 65 67 else if ( f.degree( x ) < n ) 66 68 return 0; 67 else { 69 else 70 { 68 71 CFIterator i; 69 72 CanonicalForm sum = 0, fact; 70 73 int min, j; 71 74 Variable v = Variable( f.level() + 1 ); 72 for ( i = swapvar( f, x, v); i.hasTerms() && i.exp() >= n; i++ ) { 75 for ( i = swapvar( f, x, v); i.hasTerms() && i.exp() >= n; i++ ) 76 { 73 77 fact = 1; 74 78 min = i.exp() - n; … … 107 111 } 108 112 109 static CanonicalForm 110 check_dummy( const CFArray &a, const CFArray & P, const CFArray & Q ) 111 { 112 int i, r = a.size(); 113 CanonicalForm res, prod; 114 res = 0; 115 prod = 1; 116 for ( i = 1; i <= r; i++ ) { 117 res += prod * a[i] * Q[i]; 118 prod *= P[i]; 119 } 120 return res; 121 } 122 123 static bool 124 check_e( const IteratedFor & e, int k, int m, int * n ) 113 //static CanonicalForm check_dummy( const CFArray &a, const CFArray & P, const CFArray & Q ) 114 //{ 115 // int i, r = a.size(); 116 // CanonicalForm res, prod; 117 // res = 0; 118 // prod = 1; 119 // for ( i = 1; i <= r; i++ ) 120 // { 121 // res += prod * a[i] * Q[i]; 122 // prod *= P[i]; 123 // } 124 // return res; 125 //} 126 127 static bool check_e( const IteratedFor & e, int k, int m, int * n ) 125 128 { 126 129 int sum = 0; 127 for ( int i = 2; i < k; i++ ) { 130 for ( int i = 2; i < k; i++ ) 131 { 128 132 sum += e[i]; 129 133 if ( e[i] > n[i] ) … … 133 137 } 134 138 135 static CanonicalForm 136 modDeltak ( const CanonicalForm & f, const Evaluation & A, int k, int * n ) 139 static CanonicalForm modDeltak ( const CanonicalForm & f, const Evaluation & A, int k, int * n ) 137 140 { 138 141 CanonicalForm result = f; 139 for ( int i = 2; i < k; i++ ) { 142 for ( int i = 2; i < k; i++ ) 143 { 140 144 result.mod( binomialpower( Variable(i), -A[i], n[i]+1 ) ); 141 145 } … … 163 167 DEBOUTLN( cerr, "the first approximation of the correction coefficients is " << A ); 164 168 #ifdef DEBUGOUTPUT 165 if ( check_dummy( A, P, Q ) - C != 0 ) { 169 if ( check_dummy( A, P, Q ) - C != 0 ) 170 { 166 171 DEBOUTLN( cerr, "there is an error detected, the correction coefficients do not" ); 167 172 DEBOUTLN( cerr, "fulfill equation F(A)" ); … … 170 175 } 171 176 #endif 172 for ( m = 0; m <= h && ( m == 0 || Dm != 0 ); m++ ) { 177 for ( m = 0; m <= h && ( m == 0 || Dm != 0 ); m++ ) 178 { 173 179 Dm = pk( evalF( P, Q, A, r ) - C ); 174 if ( Dm != 0 ) { 175 if ( k == 2 ) { 180 if ( Dm != 0 ) 181 { 182 if ( k == 2 ) 183 { 176 184 TIMING_START(fac_solve); 177 185 solveF( P0, Q0, S, T, Dm, pk, r, a ); … … 180 188 A[i] -= a[i]; 181 189 } 182 else { 190 else 191 { 183 192 IteratedFor e( 2, k-1, m+1 ); 184 while ( e.iterations_left() ) { 185 if ( check_e( e, k, m, n ) ) { 193 while ( e.iterations_left() ) 194 { 195 if ( check_e( e, k, m, n ) ) 196 { 186 197 g = pk( checkCombination( Dm, I, e, k ) ); 187 if ( ! g.isZero() && ! (g.mvar() > Variable(1)) ) { 198 if ( ! g.isZero() && ! (g.mvar() > Variable(1)) ) 199 { 188 200 prodcomb = prodCombination( I, e, k ); 189 201 // Dm = Dm - g * prodcomb; … … 191 203 solveF( P0, Q0, S, T, g, pk, r, a ); 192 204 TIMING_END(fac_solve); 193 for ( i = 1; i <= r; i++ ) { 205 for ( i = 1; i <= r; i++ ) 206 { 194 207 // A[i] -= a[i] * prodcomb; 195 208 A[i] = pk( A[i] - a[i] * prodcomb ); … … 231 244 DEBOUTLN( cerr, "modulus p^k= " << b.getpk() << "=" << b.getp() <<"^"<< b.getk() ); 232 245 233 for ( i = 1; i <= r; i++ ) { 246 for ( i = 1; i <= r; i++ ) 247 { 234 248 Variable vm = Variable( t + 1 ); 235 249 Variable v1 = Variable(1); … … 243 257 TIMING_START(fac_extgcd); 244 258 Q[r] = 1; 245 for ( i = r; i > 1; i-- ) { 259 for ( i = r; i > 1; i-- ) 260 { 246 261 Q[i-1] = Q[i] * P[i]; 247 262 P0[i] = A( P[i], 2, k-1 ); … … 254 269 TIMING_END(fac_extgcd); 255 270 256 for ( m = 1; m <= n[k]+1; m++ ) { 271 for ( m = 1; m <= n[k]+1; m++ ) 272 { 257 273 TIMING_START(fac_modpk); 258 274 Rm = modDeltak( prod( K ) - Uk, A, k, n ); 259 275 TIMING_END(fac_modpk); 260 276 #ifdef DEBUGOUTPUT 261 if ( mod( Rm, xa1 ) != 0 ) { 277 if ( mod( Rm, xa1 ) != 0 ) 278 { 262 279 DEBOUTLN( cerr, "something seems not to be ok with Rm which is " << Rm ); 263 280 DEBOUTLN( cerr, "and should reduce to zero modulo " << xa1 ); 264 281 } 265 282 #endif 266 if ( mod( Rm, xa2 ) != 0 ) { 283 if ( mod( Rm, xa2 ) != 0 ) 284 { 267 285 C = derivAndEval( Rm, m, Variable( k ), A[k] ); 268 286 D = 1; … … 275 293 // #ifdef DEBUGOUTPUT 276 294 // dummy = check_dummy( alpha, P, Q ); 277 // if ( b(modDeltak( dummy, A, k, n )) != b(modDeltak( C, A, k, n )) ) { 295 // if ( b(modDeltak( dummy, A, k, n )) != b(modDeltak( C, A, k, n )) ) 296 // { 278 297 // DEBOUTLN( cerr, "lift fault" ); 279 298 // DEBDECLEVEL( cerr, "liftStep" ); … … 290 309 for ( i = 1; i <= r; i++ ) 291 310 P[i] = K[i]; 292 if ( prod( K ) - Uk != 0 ) { 311 if ( prod( K ) - Uk != 0 ) 312 { 293 313 DEBOUTLN( cerr, "the liftstep produced the wrong result" ); 294 314 DEBOUTLN( cerr, "the product of the factors calculated so far is " << prod(K) ); … … 312 332 313 333 Uk[t] = U; 314 for ( k = t-1; k > 1; k-- ) { 334 for ( k = t-1; k > 1; k-- ) 335 { 315 336 Uk[k] = Uk[k+1]( A[k+1], Variable( k+1 ) ); 316 337 n[k] = degree( Uk[k], Variable( k ) ); 317 338 } 318 for ( k = A.min(); goodeval && (k <= t); k++ ) { 339 for ( k = A.min(); goodeval && (k <= t); k++ ) 340 { 319 341 h = totaldegree( Uk[k], Variable(A.min()), Variable(k-1) ); 320 342 for ( i = A.min(); i <= k; i++ ) -
factory/fac_multivar.cc
rca4d0e6 r01e8874 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: fac_multivar.cc,v 1.1 4 2008-03-17 17:44:04Singular Exp $ */2 /* $Id: fac_multivar.cc,v 1.15 2009-06-04 17:50:49 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 151 151 if (! f.inBaseDomain() ) 152 152 { 153 int l = f.level();154 153 CFIterator i = f; 155 154 for(;;) … … 206 205 CFFListIterator I, J; 207 206 CFArray G, lcG, D; 208 int i, j, k, m, r, maxdeg, h;207 int i, j, r, maxdeg; 209 208 REvaluation A( 2, t, IntRandom( 50 ) ); 210 209 CanonicalForm U0; … … 405 404 CFFListIterator I, J; 406 405 CFArray G, lcG, D; 407 int i, j, k, m, r, maxdeg, h;406 int i, j, r, maxdeg; 408 407 REvaluation A( 2, t, FFRandom() ); 409 408 CanonicalForm U0; -
factory/fac_univar.cc
rca4d0e6 r01e8874 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: fac_univar.cc,v 1.2 2 2008-03-17 17:44:04Singular Exp $ */2 /* $Id: fac_univar.cc,v 1.23 2009-06-04 17:50:49 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 125 125 } 126 126 127 static int 128 cmpFactor( const CFFactor & a, const CFFactor & b ) 127 static int cmpFactor( const CFFactor & a, const CFFactor & b ) 129 128 { 130 129 CFFactor A( a ), B( b ); … … 132 131 } 133 132 134 static double 135 cf2double ( const CanonicalForm & f ) 136 { 137 CanonicalForm a = f, q, r; 138 double m = 1, res = 0; 139 if ( a.sign() < 0 ) a = -a; 140 while ( ! a.isZero() ) { 141 divrem( a, 10, q, r ); 142 res += m * (double)(r.intval()); 143 m *= 10; 144 a = q; 145 } 146 if ( f.sign() < 0 ) res = -res; 147 return res; 148 } 133 //static double cf2double ( const CanonicalForm & f ) 134 //{ 135 // CanonicalForm a = f, q, r; 136 // double m = 1, res = 0; 137 // if ( a.sign() < 0 ) a = -a; 138 // while ( ! a.isZero() ) { 139 // divrem( a, 10, q, r ); 140 // res += m * (double)(r.intval()); 141 // m *= 10; 142 // a = q; 143 // } 144 // if ( f.sign() < 0 ) res = -res; 145 // return res; 146 //} 149 147 150 148 //{{{ static int kBound ( const CanonicalForm & f, int p ) -
factory/ffreval.cc
rca4d0e6 r01e8874 64 64 static void solveF_P ( const CFArray & P, const CFArray & Q, const CFArray & S, const CFArray & T, const CanonicalForm & C, int r, CFArray & a ); 65 65 static CanonicalForm derivAndEval_P ( const CanonicalForm & f, int n, const Variable & x, const CanonicalForm & a ); 66 static CanonicalForm checkCombination_P ( const CanonicalForm & W, const Evaluation & a, const IteratedFor & e, int k );66 //static CanonicalForm checkCombination_P ( const CanonicalForm & W, const Evaluation & a, const IteratedFor & e, int k ); 67 67 static CFArray findCorrCoeffs_P ( const CFArray & P, const CFArray & Q, const CFArray & P0, const CFArray & Q0, const CFArray & S, const CFArray & T, const CanonicalForm & C, const Evaluation & I, int r, int k, int h, int * n ); 68 68 static bool liftStep_P ( CFArray & P, int k, int r, int t, const Evaluation & A, const CFArray & lcG, const CanonicalForm & Uk, int * n, int h ); -
factory/gfops.cc
rca4d0e6 r01e8874 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: gfops.cc,v 1. 9 2008-12-17 15:06:24Singular Exp $ */2 /* $Id: gfops.cc,v 1.10 2009-06-04 17:50:50 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 30 30 31 31 const int gf_primes_len = 42; 32 static unsigned short gf_primes [] =33 {34 2, 3, 5, 7, 11, 13, 17, 19,35 23, 29, 31, 37, 41, 43, 47, 53,36 59, 61, 67, 71, 73, 79, 83, 89,37 97, 101, 103, 107, 109, 113, 127, 131,38 137, 139, 149, 151, 157, 163, 167, 173,39 179, 181, 191, 193, 197, 199, 223, 211,40 227, 229, 233, 239, 241, 25141 };32 //static unsigned short gf_primes [] = 33 //{ 34 // 2, 3, 5, 7, 11, 13, 17, 19, 35 // 23, 29, 31, 37, 41, 43, 47, 53, 36 // 59, 61, 67, 71, 73, 79, 83, 89, 37 // 97, 101, 103, 107, 109, 113, 127, 131, 38 // 137, 139, 149, 151, 157, 163, 167, 173, 39 // 179, 181, 191, 193, 197, 199, 223, 211, 40 // 227, 229, 233, 239, 241, 251 41 //}; 42 42 43 43 int gf_q = 0; … … 50 50 unsigned short * gf_table = 0; 51 51 52 CanonicalForm gf_mipo = 0; 53 54 static CanonicalForm 55 intVec2CF ( int degree, int * coeffs, int level ) 52 CanonicalForm gf_mipo(0); 53 54 static CanonicalForm intVec2CF ( int degree, int * coeffs, int level ) 56 55 { 57 56 int i; … … 64 63 } 65 64 66 static void 67 gf_get_table ( int p, int n ) 65 static void gf_get_table ( int p, int n ) 68 66 { 69 67 char buffer[gf_maxbuffer]; … … 162 160 } 163 161 164 static bool 165 gf_valid_combination ( int p, int n ) 166 { 167 int i = 0; 168 while ( i < gf_primes_len && gf_primes[i] != p ) i++; 169 if ( i == gf_primes_len ) 170 return false; 171 else 172 { 173 i = n; 174 int a = 1; 175 while ( a < gf_maxtable && i > 0 ) 176 { 177 a *= p; 178 i--; 179 } 180 if ( i > 0 || a > gf_maxtable ) 181 return false; 182 else 183 return true; 184 } 185 } 186 187 void 188 gf_setcharacteristic ( int p, int n, char name ) 162 //static bool gf_valid_combination ( int p, int n ) 163 //{ 164 // int i = 0; 165 // while ( i < gf_primes_len && gf_primes[i] != p ) i++; 166 // if ( i == gf_primes_len ) 167 // return false; 168 // else 169 // { 170 // i = n; 171 // int a = 1; 172 // while ( a < gf_maxtable && i > 0 ) 173 // { 174 // a *= p; 175 // i--; 176 // } 177 // if ( i > 0 || a > gf_maxtable ) 178 // return false; 179 // else 180 // return true; 181 // } 182 //} 183 184 void gf_setcharacteristic ( int p, int n, char name ) 189 185 { 190 186 ASSERT( gf_valid_combination( p, n ), "illegal immediate GF(q)" ); … … 193 189 } 194 190 195 int 196 gf_gf2ff ( int a ) 191 int gf_gf2ff ( int a ) 197 192 { 198 193 if ( gf_iszero( a ) ) … … 216 211 } 217 212 218 bool 219 gf_isff ( int a ) 213 bool gf_isff ( int a ) 220 214 { 221 215 if ( gf_iszero( a ) ) -
factory/variable.cc
rca4d0e6 r01e8874 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: variable.cc,v 1. 7 2008-07-01 14:17:49Singular Exp $ */2 /* $Id: variable.cc,v 1.8 2009-06-04 17:50:50 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 151 151 #endif /* NOSTREAMIO */ 152 152 153 static bool legal_mipo( const CanonicalForm & mipo )154 {155 ASSERT( mipo.inPolyDomain(), "not a legal extension" );156 bool ok = true;157 for ( CFIterator i = mipo; ok && i.hasTerms(); i++ )158 ok = i.coeff().inBaseDomain();159 return ok;160 }153 //static bool legal_mipo( const CanonicalForm & mipo ) 154 //{ 155 // ASSERT( mipo.inPolyDomain(), "not a legal extension" ); 156 // bool ok = true; 157 // for ( CFIterator i = mipo; ok && i.hasTerms(); i++ ) 158 // ok = i.coeff().inBaseDomain(); 159 // return ok; 160 //} 161 161 162 162 static CanonicalForm conv2mipo ( const CanonicalForm & mipo, const Variable alpha ) -
libfac/charset/alg_factor.cc
rca4d0e6 r01e8874 2 2 // emacs edit mode for this file is -*- C++ -*- 3 3 //////////////////////////////////////////////////////////// 4 /* $Id: alg_factor.cc,v 1.2 6 2008-11-06 14:47:03Singular Exp $ */4 /* $Id: alg_factor.cc,v 1.27 2009-06-04 17:54:59 Singular Exp $ */ 5 5 //////////////////////////////////////////////////////////// 6 6 // FACTORY - Includes … … 11 11 #include <SqrFree.h> 12 12 #include <helpstuff.h> 13 #include <assert.h> 13 14 // Charset - Includes 14 15 #include "csutil.h" … … 155 156 // sqr-free routine for algebraic extensions 156 157 // we need it! Ex.: f=c^2+2*a*c-1; as=[a^2+1]; f=(c+a)^2 157 static CFFList 158 alg_sqrfree( const CanonicalForm & f ){159 CFFList L;160 161 L.append(CFFactor(f,1));162 return L;163 }158 //static CFFList alg_sqrfree( const CanonicalForm & f ) 159 //{ 160 // CFFList L; 161 // 162 // L.append(CFFactor(f,1)); 163 // return L; 164 //} 164 165 165 166 // Calculates a square free norm … … 438 439 CanonicalForm alg_lc(const CanonicalForm &f) 439 440 { 440 if (f.inCoeffDomain()) return f;441 441 if (f.level()>0) 442 442 { 443 443 return alg_lc(f.LC()); 444 444 } 445 assert(f.inCoeffDomain()); 446 return f; 445 447 } 446 448 … … 829 831 /* 830 832 $Log: not supported by cvs2svn $ 833 Revision 1.26 2008/11/06 14:47:03 Singular 834 *hannes: newfactoras 835 831 836 Revision 1.25 2008/11/06 14:05:51 Singular 832 837 *hannes: newfactoras
Note: See TracChangeset
for help on using the changeset viewer.