My Project
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
REvaluation Class Reference

class to generate random evaluation points More...

#include <cf_reval.h>

Public Member Functions

 REvaluation ()
 
 REvaluation (int min0, int max0, const CFRandom &sample)
 
 REvaluation (const REvaluation &e)
 
 ~REvaluation ()
 
REvaluationoperator= (const REvaluation &e)
 
void nextpoint ()
 
void nextpoint (int n)
 
- Public Member Functions inherited from Evaluation
 Evaluation ()
 
 Evaluation (int min0, int max0)
 
 Evaluation (const Evaluation &e)
 
virtual ~Evaluation ()
 
Evaluationoperator= (const Evaluation &e)
 
int min () const
 
int max () const
 
CanonicalForm operator[] (int i) const
 
CanonicalForm operator[] (const Variable &v) const
 
CanonicalForm operator() (const CanonicalForm &f) const
 
CanonicalForm operator() (const CanonicalForm &f, int i, int j) const
 
void setValue (int i, const CanonicalForm &f)
 
virtual void nextpoint ()
 

Protected Attributes

CFRandomgen
 
- Protected Attributes inherited from Evaluation
CFArray values
 

Detailed Description

class to generate random evaluation points

See also
cf_eval.h

Definition at line 25 of file cf_reval.h.

Constructor & Destructor Documentation

◆ REvaluation() [1/3]

REvaluation::REvaluation ( )
inline

Definition at line 30 of file cf_reval.h.

30: Evaluation(), gen(0) {}
Evaluation()
Definition: cf_eval.h:36
CFRandom * gen
Definition: cf_reval.h:28

◆ REvaluation() [2/3]

REvaluation::REvaluation ( int  min0,
int  max0,
const CFRandom sample 
)
inline

Definition at line 31 of file cf_reval.h.

31: Evaluation( min0, max0 ), gen( sample.clone() ) {}
virtual CFRandom * clone() const
Definition: cf_random.h:25

◆ REvaluation() [3/3]

REvaluation::REvaluation ( const REvaluation e)

Definition at line 15 of file cf_reval.cc.

15 :Evaluation()
16{
17 if ( e.gen == 0 )
18 gen = 0;
19 else
20 gen = e.gen->clone();
21 values = e.values;
22}
CFArray values
Definition: cf_eval.h:34

◆ ~REvaluation()

REvaluation::~REvaluation ( )

Definition at line 24 of file cf_reval.cc.

25{
26 if ( gen != 0 )
27 delete gen;
28}

Member Function Documentation

◆ nextpoint() [1/2]

void REvaluation::nextpoint ( )
virtual

Reimplemented from Evaluation.

Definition at line 46 of file cf_reval.cc.

47{
48 int n = values.max();
49 for ( int i = values.min(); i <= n; i++ )
50 values[i] = gen->generate();
51}
int i
Definition: cfEzgcd.cc:132
int max() const
Definition: ftmpl_array.cc:104
int min() const
Definition: ftmpl_array.cc:98
virtual CanonicalForm generate() const
Definition: cf_random.h:24

◆ nextpoint() [2/2]

void REvaluation::nextpoint ( int  n)

Definition at line 54 of file cf_reval.cc.

55{
56 int m= values.max();
57 int t= values.min();
58 for (int i= t; i <= m; i++)
59 values [i]= 0;
60
61 if (m == t)
62 {
63 values [t]= gen->generate();
64 return;
65 }
66 for (int i= 0; i < n; i++)
67 {
68 int l= factoryrandom (m - t + 1) + t;
69 values [l]= gen->generate();
70 }
71}
int l
Definition: cfEzgcd.cc:100
int m
Definition: cfEzgcd.cc:128
int factoryrandom(int n)
random integers with abs less than n
Definition: cf_random.cc:180

◆ operator=()

REvaluation & REvaluation::operator= ( const REvaluation e)

Definition at line 31 of file cf_reval.cc.

32{
33 if ( this != &e ) {
34 if (gen!=0)
35 delete gen;
36 values = e.values;
37 if ( e.gen == 0 )
38 gen = 0;
39 else
40 gen = e.gen->clone();
41 }
42 return *this;
43}

Field Documentation

◆ gen

CFRandom* REvaluation::gen
protected

Definition at line 28 of file cf_reval.h.


The documentation for this class was generated from the following files: