spielwiese
Last change
on this file was
9f7665,
checked in by Oleksandr Motsak <motsak@…>, 9 years ago
|
Removed HAVE_CONFIG guards
fix: fixed the inclusion of configure-generated *config.h's
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
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 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.