source: git/factory/ffreval.cc @ 6c44098

spielwiese
Last change on this file since 6c44098 was 6db552, checked in by Hans Schoenemann <hannes@…>, 13 years ago
removed include-wrapppers git-svn-id: file:///usr/local/Singular/svn/trunk@13772 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.1 KB
Line 
1#include <config.h>
2
3#include "cf_defs.h"
4#include "canonicalform.h"
5#include "fac_util.h"
6#include "cf_algorithm.h"
7#include "cf_reval.h"
8#include "cf_random.h"
9#include "cf_primes.h"
10#include "fac_distrib.h"
11#include "templates/ftmpl_functions.h"
12#include "ffreval.h"
13#include "cf_binom.h"
14#include "fac_iterfor.h"
15#include "cf_iter.h"
16
17void FFREvaluation::nextpoint()
18{
19  // enumerates the points stored in values
20  int n = values.max();
21  int p = getCharacteristic();
22  for( int i=values.min(); i<=n; i++ )
23  {
24    if( values[i] != p-1 )
25    {
26      values[i] += 1;
27      break;
28    }
29    values[i] += 1; // becomes 0
30  }
31}
32
33bool FFREvaluation::hasNext()
34{
35  int n = values.max();
36
37  for( int i=values.min(); i<=n; i++ )
38  {
39    if( values[i]!=start[i] )
40      return true;
41  }
42  return false;
43}
44
45FFREvaluation& FFREvaluation::operator= ( const FFREvaluation & e )
46{
47  if( this != &e )
48  {
49    if( gen != NULL )
50      delete gen;
51    values = e.values;
52    start = e.start;
53    if( e.gen == NULL )
54      gen = NULL;
55    else
56      gen = e.gen->clone();
57  }
58  return *this;
59}
60
Note: See TracBrowser for help on using the repository browser.