My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
factory
cf_reval.cc
Go to the documentation of this file.
1
/* emacs edit mode for this file is -*- C++ -*- */
2
3
#define MORE_ZEROES
4
5
6
#include "config.h"
7
8
9
#include "
cf_assert.h
"
10
11
#include "
cf_defs.h
"
12
#include "
cf_reval.h
"
13
14
15
REvaluation::REvaluation
(
const
REvaluation
& e ):
Evaluation
()
16
{
17
if
( e.
gen
== 0 )
18
gen
= 0;
19
else
20
gen
= e.
gen
->
clone
();
21
values
= e.
values
;
22
}
23
24
REvaluation::~REvaluation
()
25
{
26
if
(
gen
!= 0 )
27
delete
gen
;
28
}
29
30
REvaluation
&
31
REvaluation::operator=
(
const
REvaluation
& e )
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
}
44
45
void
46
REvaluation::nextpoint
()
47
{
48
int
n =
values
.max();
49
for
(
int
i
=
values
.min();
i
<= n;
i
++ )
50
values
[
i
] =
gen
->generate();
51
}
52
53
void
54
REvaluation::nextpoint
(
int
n)
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
}
l
int l
Definition
cfEzgcd.cc:100
m
int m
Definition
cfEzgcd.cc:128
i
int i
Definition
cfEzgcd.cc:132
cf_assert.h
assertions for Factory
cf_defs.h
factory switches.
cf_reval.h
generate random evaluation points
CFRandom::clone
virtual CFRandom * clone() const
Definition
cf_random.h:25
Evaluation::values
CFArray values
Definition
cf_eval.h:34
Evaluation::Evaluation
Evaluation()
Definition
cf_eval.h:36
REvaluation
class to generate random evaluation points
Definition
cf_reval.h:26
REvaluation::gen
CFRandom * gen
Definition
cf_reval.h:28
REvaluation::~REvaluation
~REvaluation()
Definition
cf_reval.cc:24
REvaluation::REvaluation
REvaluation()
Definition
cf_reval.h:30
REvaluation::nextpoint
void nextpoint()
Definition
cf_reval.cc:46
REvaluation::operator=
REvaluation & operator=(const REvaluation &e)
Definition
cf_reval.cc:31
factoryrandom
int factoryrandom(int n)
random integers with abs less than n
Definition
cf_random.cc:177
Generated on
for My Project by
doxygen 1.17.0
for
Singular