Changeset fcae67 in git
- Timestamp:
- Jun 27, 1996, 1:34:25 PM (27 years ago)
- Branches:
- (u'spielwiese', 'a7324b6e0b44a1a8ed3fa4d9ca3e2ff210ddd52c')
- Children:
- 1343d6d8811666ba39696828920b50fa6f00ded1
- Parents:
- af4c5612a18aeb436641ed03ae4ea4fb66c029dc
- Location:
- factory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/fac_util.cc
raf4c56 rfcae67 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fac_util.cc,v 1. 0 1996-05-17 10:59:46stobbe Exp $2 // $Id: fac_util.cc,v 1.1 1996-06-27 11:34:24 stobbe Exp $ 3 3 4 4 /* 5 5 $Log: not supported by cvs2svn $ 6 Revision 1.0 1996/05/17 10:59:46 stobbe 7 Initial revision 8 6 9 */ 7 10 … … 114 117 } 115 118 119 void 120 divremainder( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & quot, CanonicalForm & rem, const modpk & pk ) 121 { 122 ASSERT( (f.inCoeffDomain() || f.isUnivariate()) && (g.inCoeffDomain() || g.isUnivariate()) && (f.inCoeffDomain() || g.inCoeffDomain() || f.mvar() == g.mvar()), "can not build remainder" ); 123 if ( f.inCoeffDomain() ) 124 if ( g.inCoeffDomain() ) { 125 divrem( f, g, quot, rem ); 126 quot = pk( quot ); 127 rem = pk( rem ); 128 } 129 else { 130 quot = 0; 131 rem = pk( f ); 132 } 133 else { 134 Variable x = f.mvar(); 135 CanonicalForm invlcg = pk.inverse( g.lc() ); 136 rem = f; 137 int degg = g.degree(); 138 while ( rem.degree() >= degg ) { 139 quot += pk( lc( rem ) * invlcg ) * power( x, rem.degree() - degg ); 140 rem = pk( rem - lc( rem ) * invlcg * g * power( x, rem.degree() - degg ) ); 141 } 142 } 143 } 144 116 145 CanonicalForm 117 146 mappksymmetric ( const CanonicalForm & f ) -
factory/fac_util.h
raf4c56 rfcae67 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fac_util.h,v 1. 0 1996-05-17 10:59:40stobbe Exp $2 // $Id: fac_util.h,v 1.1 1996-06-27 11:34:25 stobbe Exp $ 3 3 4 4 #ifndef INCL_FAC_UTIL_H … … 7 7 /* 8 8 $Log: not supported by cvs2svn $ 9 Revision 1.0 1996/05/17 10:59:40 stobbe 10 Initial revision 11 9 12 */ 10 13 … … 38 41 CanonicalForm remainder( const CanonicalForm & f, const CanonicalForm & g, const modpk & pk ); 39 42 43 void divremainder( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & quot, CanonicalForm & rem, const modpk & pk ); 44 40 45 /*ENDPUBLIC*/ 41 46
Note: See TracChangeset
for help on using the changeset viewer.