Changeset 3566734 in git
- Timestamp:
- Nov 20, 2007, 2:42:50 PM (16 years ago)
- Branches:
- (u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
- Children:
- dae1edfbb5143f8c4553bf8acd18e2f85b155432
- Parents:
- 62f8cca6dc508c925bc4d657aea450dafba04fb9
- Location:
- factory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/ffreval.cc
r62f8cca r3566734 14 14 #include "ftmpl_functions.h" 15 15 #include "ffreval.h" 16 17 void FFREvaluation::init() 18 { 19 int n = values.max(); 20 21 for( int i=values.min(); i<=n; i++ ) 22 values[i] = offset[i] = gen->generate(); // generate random point 23 } 24 25 bool FFREvaluation::step() 26 { 27 // enumerates the points stored in values 28 int n = values.max(); 29 int p = getCharacteristic(); 30 31 int i; 32 for(i=values.min(); i<=n; i++ ) 33 { 34 if( values[i] != p-1 ) 35 { 36 values[i] += 1; 37 break; 38 } 39 values[i] += 1; // becomes 0 40 } 41 for(i=values.min();i<=n;i++) 42 { 43 if(values[i]!=offset[i]) return true; 44 } 45 return false; 46 } 47 48 FFREvaluation& FFREvaluation::operator= ( const FFREvaluation & e ) 49 { 50 if( this != &e ) 51 { 52 if( gen != 0 ) 53 delete gen; 54 values = e.values; 55 offset = e.offset; 56 if( e.gen == 0 ) 57 gen = 0; 58 else 59 gen = e.gen->clone(); 60 } 61 return *this; 62 } 16 63 17 64 /* forward declarations:*/ -
factory/ffreval.h
r62f8cca r3566734 21 21 }; 22 22 23 void FFREvaluation::init()24 {25 int n = values.max();26 27 for( int i=values.min(); i<=n; i++ )28 values[i] = offset[i] = gen->generate(); // generate random point29 }30 31 bool FFREvaluation::step()32 {33 // enumerates the points stored in values34 int n = values.max();35 int p = getCharacteristic();36 37 int i;38 for(i=values.min(); i<=n; i++ )39 {40 if( values[i] != p-1 )41 {42 values[i] += 1;43 break;44 }45 values[i] += 1; // becomes 046 }47 for(i=values.min();i<=n;i++)48 {49 if(values[i]!=offset[i]) return true;50 }51 return false;52 }53 54 FFREvaluation& FFREvaluation::operator= ( const FFREvaluation & e )55 {56 if( this != &e )57 {58 if( gen != 0 )59 delete gen;60 values = e.values;61 offset = e.offset;62 if( e.gen == 0 )63 gen = 0;64 else65 gen = e.gen->clone();66 }67 return *this;68 }69 70 23 CanonicalForm fin_ezgcd ( const CanonicalForm & FF, const CanonicalForm & GG ); 71 24
Note: See TracChangeset
for help on using the changeset viewer.