Changeset 10697c in git for libfac/factor
- Timestamp:
- May 15, 2007, 5:50:42 PM (17 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 1591a873ae939d12cc28f2fbb1408a9e8fdad9b8
- Parents:
- 38e7b3ea67100d6b56716b967237bef70ac6adce
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfac/factor/Factor.cc
r38e7b3 r10697c 1 1 /* Copyright 1996 Michael Messollen. All rights reserved. */ 2 2 /////////////////////////////////////////////////////////////////////////////// 3 static char * rcsid = "$Id: Factor.cc,v 1.2 4 2007-05-15 14:46:48Singular Exp $ ";3 static char * rcsid = "$Id: Factor.cc,v 1.25 2007-05-15 15:50:42 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 /////////////////////////////////////////////////////////////////////////////// … … 993 993 // * ensuring poly is sqrfree (n.y.i.) // 994 994 /////////////////////////////////////////////////////////////// 995 CFFList Factorize2(const CanonicalForm & F, const CanonicalForm & minpoly ) 996 { 997 CFFList iF=Factorize(F); 998 CFFList G,H; 999 CanonicalForm fac; 1000 int d; 1001 ListIterator<CFFactor> i,k; 1002 for ( i = iF; i.hasItem(); ++i ) 1003 { 1004 d = i.getItem().exp(); 1005 fac = i.getItem().factor(); 1006 G = Factorize( fac, minpoly); 1007 for ( k = G; k.hasItem(); ++k ) 1008 { 1009 fac = k.getItem().factor(); 1010 int dd = k.getItem().exp(); 1011 H.append( CFFactor( fac , d*dd ) ); 1012 } 1013 } 1014 //Outputlist = newfactoras( F, as, 1); 1015 return H; 1016 } 995 1017 CFFList 996 1018 Factorize(const CanonicalForm & F, const CanonicalForm & minpoly, int is_SqrFree ) … … 1070 1092 /////// 1071 1093 // if ( ! SqrFreeTest(F) ){ 1072 if ( ! is_SqrFree ){ 1094 if ( ! is_SqrFree ) 1095 { 1073 1096 TIMING_START(sqrfree_time); 1074 1097 SqrFreeList = InternalSqrFree(F, minpoly) ; // first sqrfree the polynomial … … 1086 1109 SqrFreeList.append(CFFactor(F,1)); 1087 1110 DEBOUTLN(CERR, "InternalSqrFreeList= ", SqrFreeList); 1088 for ( i=SqrFreeList; i.hasItem(); i++ ){ 1111 for ( i=SqrFreeList; i.hasItem(); i++ ) 1112 { 1089 1113 DEBOUTLN(CERR, "Factor under consideration: ", i.getItem().factor()); 1090 1114 // We need a compress on each list item ! Maybe we have less variables! … … 1094 1118 Outputlist.append( CFFactor(g,1) ) ; 1095 1119 else// a real polynomial 1096 if ( g.isUnivariate() ){ 1120 if ( g.isUnivariate() ) 1121 { 1097 1122 Variable alpha=rootOf(minpoly); 1098 1123 Intermediatelist=factorize2(g,alpha,minpoly); // poly is sqr-free! … … 1103 1128 exp*j.getItem().exp())); 1104 1129 } 1105 else{ // multivariate polynomial 1106 if ( g.isHomogeneous() ){ 1130 else // multivariate polynomial 1131 { 1132 if ( g.isHomogeneous() ) 1133 { 1107 1134 DEBOUTLN(CERR, "Poly is homogeneous! : ", g); 1108 1135 // Now we can substitute one variable to 1, factorize and then … … 1168 1195 /* 1169 1196 $Log: not supported by cvs2svn $ 1197 Revision 1.24 2007/05/15 14:46:48 Singular 1198 *hannes: factorize in Zp(a)[x...] 1199 1170 1200 Revision 1.23 2006/05/16 14:46:49 Singular 1171 1201 *hannes: gcc 4.1 fixes
Note: See TracChangeset
for help on using the changeset viewer.