Changeset 265aa7 in git for libfac/factor
- Timestamp:
- May 22, 2007, 4:49:52 PM (17 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- 44d6cf799fbfac8d0bd66c4ac5bf79e9784d726d
- Parents:
- 17b2e2103b1022a527607ac5bd1c2c0655100596
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfac/factor/Factor.cc
r17b2e2 r265aa7 1 1 /* Copyright 1996 Michael Messollen. All rights reserved. */ 2 2 /////////////////////////////////////////////////////////////////////////////// 3 static char * rcsid = "$Id: Factor.cc,v 1.3 0 2007-05-22 14:30:53Singular Exp $ ";3 static char * rcsid = "$Id: Factor.cc,v 1.31 2007-05-22 14:49:52 Singular Exp $ "; 4 4 static char * errmsg = "\nYou found a bug!\nPlease inform (Michael Messollen) michael@math.uni-sb.de \nPlease include above information and your input (the ideal/polynomial and characteristic) in your bug-report.\nThank you."; 5 5 /////////////////////////////////////////////////////////////////////////////// … … 210 210 /////////////////////////////////////////////////////////////// 211 211 static CFFList 212 not_monic( const CFFList & TheList, const CanonicalForm & ltt, const CanonicalForm & F, int levelF){ 212 not_monic( const CFFList & TheList, const CanonicalForm & ltt, const CanonicalForm & F, int levelF) 213 { 213 214 CFFList Returnlist,IntermediateList; 214 215 CFFListIterator i; … … 219 220 220 221 if ( lt == lt.genOne() ) return TheList; // the poly was already monic 221 if ( TheList.length() <= 1 ){ // only one factor to substitute back 222 if ( TheList.length() <= 1 ) // only one factor to substitute back 223 { 222 224 if ( totaldegree(lt) == 0 ) // lt is type numeric 223 225 Returnlist.append( CFFactor(lt*TheList.getFirst().factor(), 224 226 TheList.getFirst().exp()) ); 225 else { 227 else 228 { 226 229 intermediate = F(x*lt, levelF)/power(lt,degree(F,levelF)-1); 227 230 Returnlist.append(CFFactor(intermediate,TheList.getFirst().exp())); 228 231 } 229 232 } 230 else { // more then one factor 233 else // more then one factor 234 { 231 235 IntermediateList= TheList; 232 236 if ( totaldegree(lt) == 0 ){ // lt is type numeric;(SqrFree-use, see above) … … 236 240 Returnlist= Union(Returnlist,IntermediateList); 237 241 } 238 else{ // lt is a) a product or b) a sum of terms 239 if ( lt_is_product(lt) ){ // case a) 242 else // lt is a) a product or b) a sum of terms 243 { 244 if ( lt_is_product(lt) ) // case a) 245 { 240 246 DEBOUTLN(CERR, "lt_is_product: ", lt); 241 247 savelc= content(lt) ; // can we simplify to savelc= lc(lt); ? 242 248 while ( getNumVars(savelc) != 0 ) 243 249 savelc= content(savelc); 244 for ( i=TheList; i.hasItem();i++ ){ 250 for ( i=TheList; i.hasItem();i++ ) 251 { 245 252 numerator= i.getItem().factor(); 246 253 numerator= numerator(x*lt,levelF); // x <- x*lt … … 259 266 intermediate*= j.getItem().factor(); 260 267 test1= mydivremt( intermediate,F,a,b); 261 if ( test1 && b == intermediate.genZero() ) { // Yupp! 268 if ( test1 && b == intermediate.genZero() ) // Yupp! 269 { 262 270 IntermediateList.append(CFFactor(1/a,1)); 263 271 Returnlist= IntermediateList; … … 265 273 else { Returnlist= IntermediateList; } 266 274 } 267 else{ // case b) 275 else // case b) 276 { 268 277 DEBOUTLN(CERR, "lt_is_sum: ", lt); 269 278 CanonicalForm save_denumerator= 1; 270 for ( i=TheList; i.hasItem(); i++ ){ 279 for ( i=TheList; i.hasItem(); i++ ) 280 { 271 281 numerator= i.getItem().factor(); 272 282 numerator= numerator(x*lt,levelF); // x <- x*lt … … 274 284 test= content(numerator,x); 275 285 test1= mydivremt(denumerator,test,a,b); 276 if ( test1 && b == numerator.genZero() ){ // Yupp! 286 if ( test1 && b == numerator.genZero() ) // Yupp! 287 { 277 288 save_denumerator*= a; 278 289 Returnlist.append(CFFactor(numerator/test ,1)); 279 290 } 280 else { 291 else 292 { 281 293 #ifdef HAVE_SINGULAR_ERROR 282 294 WerrorS("libfac: ERROR: not_monic1: case lt is a sum."); … … 297 309 // the following will do what we want 298 310 Returnlist= myUnion( CFFList(CFFactor(1/a,1)),Returnlist) ; 299 else { 311 else 312 { 300 313 #ifdef HAVE_SINGULAR_ERROR 301 314 WerrorS("libfac: ERROR: not_monic2: case lt is a sum."); … … 1334 1347 /* 1335 1348 $Log: not supported by cvs2svn $ 1349 Revision 1.30 2007/05/22 14:30:53 Singular 1350 *hannes: diophant_error 1351 1336 1352 Revision 1.29 2007/05/22 13:18:57 Singular 1337 1353 *hannes: Factorize2: div test, sort etc.
Note: See TracChangeset
for help on using the changeset viewer.