Changeset e2ca88 in git for libfac/factor/homogfactor.cc
- Timestamp:
- May 16, 2006, 4:46:50 PM (18 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 55abfc3008e047e8f26beaeb76b5bab66cfe8288
- Parents:
- dbcf42a937f51948f4de74902429b68c1b54592b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfac/factor/homogfactor.cc
rdbcf42a re2ca88 1 1 /* Copyright 1997 Michael Messollen. All rights reserved. */ 2 2 //////////////////////////////////////////////////////////// 3 // static char * rcsid = "$Id: homogfactor.cc,v 1. 6 2005-12-09 08:36:11Singular Exp $ ";3 // static char * rcsid = "$Id: homogfactor.cc,v 1.7 2006-05-16 14:46:50 Singular Exp $ "; 4 4 //////////////////////////////////////////////////////////// 5 5 // FACTORY - Includes 6 6 #include <factory.h> 7 #ifdef HAVE_IOSTREAM 8 #include <iostream> 9 #define OSTREAM std::ostream 10 #define ISTREAM std::istream 11 #define CERR std::cerr 12 #define CIN std::cin 13 #elif defined(HAVE_IOSTREAM_H) 14 #include <iostream.h> 15 #define OSTREAM ostream 16 #define ISTREAM istream 17 #define CERR cerr 18 #define CIN cin 19 #endif 20 7 21 // Factor - Includes 8 22 #include "tmpl_inst.h" … … 121 135 CFFList 122 136 HomogFactor( const CanonicalForm & g, const CanonicalForm & minpoly, const int Mainvar ){ 123 DEBINCLEVEL( cout, "HomogFactor");137 DEBINCLEVEL(CERR, "HomogFactor"); 124 138 Variable xn = get_max_degree_Variable(g); 125 139 int d_xn = degree(g,xn); … … 127 141 CanonicalForm F = compress(g(1,xn),n); // must compress F! 128 142 129 DEBOUTLN( cout, "xn= ", xn);130 DEBOUTLN( cout, "d_xn= ", d_xn);131 DEBOUTLN( cout, "F= ", F);143 DEBOUTLN(CERR, "xn= ", xn); 144 DEBOUTLN(CERR, "d_xn= ", d_xn); 145 DEBOUTLN(CERR, "F= ", F); 132 146 133 147 // should we do this for low degree polys g ? e.g. quadratic? … … 143 157 Homoglist.append(CFFactor( n(j.getItem().factor()), j.getItem().exp()) ); 144 158 // Now we have uncompressed factors in Homoglist 145 DEBOUTLN( cout, "F factors as: ", Homoglist);159 DEBOUTLN(CERR, "F factors as: ", Homoglist); 146 160 CFFList Unhomoglist; 147 161 CanonicalForm unhomogelem; 148 162 for ( j=Homoglist; j.hasItem(); j++ ){ 149 DEBOUTLN( cout, "Homogenizing ",j.getItem().factor());163 DEBOUTLN(CERR, "Homogenizing ",j.getItem().factor()); 150 164 unhomogelem= homogenize(j.getItem().factor(),xn); 151 DEBOUTLN( cout, " that is ", unhomogelem);165 DEBOUTLN(CERR, " that is ", unhomogelem); 152 166 Unhomoglist.append(CFFactor(unhomogelem,j.getItem().exp())); 153 167 d_xn -= degree(unhomogelem,xn)*j.getItem().exp(); 154 168 } 155 DEBOUTLN( cout, "Power of xn to append is ", d_xn);169 DEBOUTLN(CERR, "Power of xn to append is ", d_xn); 156 170 if ( d_xn != 0 ) // have to append xn^(d_xn) 157 171 Unhomoglist.append(CFFactor(CanonicalForm(xn),d_xn)); 158 172 159 DEBDECLEVEL( cout, "HomogFactor");173 DEBDECLEVEL(CERR, "HomogFactor"); 160 174 return Unhomoglist; 161 175 } … … 163 177 /* 164 178 $Log: not supported by cvs2svn $ 179 Revision 1.6 2005/12/09 08:36:11 Singular 180 *hannes: stuff for homog. polys ->factory 181 165 182 Revision 1.5 2005/12/05 15:47:32 Singular 166 183 *hannes: is_homogeneous -> factory: isHomogeneous
Note: See TracChangeset
for help on using the changeset viewer.