Changeset 70161e in git
- Timestamp:
- Jul 16, 1996, 2:26:05 PM (27 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 1251952559942e380e666f13188d81cd17e90569
- Parents:
- 9f2b6f23a8e1f2de750bc3241e6e692d3f57c0d1
- Location:
- factory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/fac_util.cc
r9f2b6f r70161e 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fac_util.cc,v 1. 2 1996-07-08 08:22:02stobbe Exp $2 // $Id: fac_util.cc,v 1.3 1996-07-16 12:26:05 stobbe Exp $ 3 3 4 4 /* 5 5 $Log: not supported by cvs2svn $ 6 Revision 1.2 1996/07/08 08:22:02 stobbe 7 "New organization of the factorization stuff. Some functions moved from 8 fac_diophand.cc which no longer exists. 9 " 10 6 11 Revision 1.1 1996/06/27 11:34:24 stobbe 7 12 "New function dviremainder. … … 213 218 } 214 219 220 CanonicalForm 221 sum ( const CFArray & a, int f, int l ) 222 { 223 if ( f < a.min() ) f = a.min(); 224 if ( l > a.max() ) l = a.max(); 225 CanonicalForm s = 0; 226 for ( int i = f; i <= l; i++ ) 227 s += a[i]; 228 return s; 229 } 230 231 CanonicalForm 232 prod ( const CFArray & a, int f, int l ) 233 { 234 if ( f < a.min() ) f = a.min(); 235 if ( l > a.max() ) l = a.max(); 236 CanonicalForm p = 1; 237 for ( int i = f; i <= l; i++ ) 238 p *= a[i]; 239 return p; 240 } 241 242 CanonicalForm 243 sum ( const CFArray & a ) 244 { 245 return sum( a, a.min(), a.max() ); 246 } 247 248 CanonicalForm 249 prod ( const CFArray & a ) 250 { 251 return prod( a, a.min(), a.max() ); 252 } 253 254 CanonicalForm 255 crossprod ( const CFArray & a, const CFArray & b ) 256 { 257 if ( a.size() != b.size() ) { 258 cerr << "warning: array size mismatch." << endl; 259 return 0; 260 } 261 CanonicalForm s = 0; 262 int fa = a.min(); 263 int fb = b.min(); 264 int n = a.max(); 265 for ( ; fa <= n; fa++, fb++ ) 266 s += a[fa] * b[fb]; 267 return s; 268 } -
factory/fac_util.h
r9f2b6f r70161e 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fac_util.h,v 1. 2 1996-07-08 08:22:02stobbe Exp $2 // $Id: fac_util.h,v 1.3 1996-07-16 12:26:05 stobbe Exp $ 3 3 4 4 #ifndef INCL_FAC_UTIL_H … … 7 7 /* 8 8 $Log: not supported by cvs2svn $ 9 Revision 1.2 1996/07/08 08:22:02 stobbe 10 "New organization of the factorization stuff. Some functions moved from 11 fac_diophand.cc which no longer exists. 12 " 13 9 14 Revision 1.1 1996/06/27 11:34:25 stobbe 10 15 "New function dviremainder. … … 52 57 bool Hensel ( const CanonicalForm & U, CFArray & G, const CFArray & lcG, const Evaluation & A, const modpk & bound, const Variable & x ); 53 58 59 /* some special array functions */ 60 61 CanonicalForm sum ( const CFArray & a, int f, int l ); 62 63 CanonicalForm prod ( const CFArray & a, int f, int l ); 64 65 CanonicalForm sum ( const CFArray & a ); 66 67 CanonicalForm prod ( const CFArray & a ); 68 69 CanonicalForm crossprod ( const CFArray & a, const CFArray & b ); 70 54 71 /*ENDPUBLIC*/ 55 72
Note: See TracChangeset
for help on using the changeset viewer.