33 sequenceHasBeenSet(
false),
34 intervalHasBeenSet(
false) ,
37 randomInterval(0.1) { }
50 for (
int i=0; i<
n; i++)
sequence.push_back(*s++);
74 <<
"Attempt to use NonRandomEngine without setting next random!\n";
92 for (
int i = 0; i < size; ++i) {
98 std::string beginMarker =
"NonRandomEngine-begin";
99 os << beginMarker <<
"\nUvec\n";
100 std::vector<unsigned long>
v =
put();
101 for (
unsigned int i=0; i<v.size(); ++i) {
108 std::vector<unsigned long>
v;
109 v.push_back (engineIDulong<NonRandomEngine>());
110 std::vector<unsigned long>
t;
115 v.push_back(t[0]); v.push_back(t[1]);
116 v.push_back(static_cast<unsigned long>(
nInSeq));
118 v.push_back(t[0]); v.push_back(t[1]);
119 v.push_back(static_cast<unsigned long>(
sequence.size()));
120 for (
unsigned int i=0; i<
sequence.size(); ++i) {
122 v.push_back(t[0]); v.push_back(t[1]);
128 std::string beginMarker =
"NonRandomEngine-begin";
130 if (beginMarker !=
"NonRandomEngine-begin") {
131 is.clear(std::ios::badbit | is.rdstate());
132 std::cerr <<
"\nInput mispositioned or"
133 <<
"\nNonRandomEngine state description missing or"
134 <<
"\nwrong engine type found.\n";
141 return "NonRandomEngine-begin";
146 std::vector<unsigned long>
v;
147 unsigned long uu = 99999;
148 unsigned long ssiz = 0;
149 for (
unsigned int istart=0; istart < 10; ++istart) {
152 is.clear(std::ios::badbit | is.rdstate());
153 std::cout <<
"istart = " << istart <<
"\n";
155 <<
"\nNonRandomEngine state (vector) description has no sequence size."
156 <<
"\ngetState() has failed."
157 <<
"\nInput stream is probably mispositioned now." << std::endl;
161 if (istart==9) ssiz = uu;
163 for (
unsigned int ivec=0; ivec < 2*ssiz; ++ivec) {
166 is.clear(std::ios::badbit | is.rdstate());
167 std::cerr <<
"\nNonRandomEngine state (vector) description improper."
168 <<
"\ngetState() has failed."
169 <<
"\nInput stream is probably mispositioned now." << std::endl;
180 std::string endMarker =
"NonRandomEngine-end";
183 unsigned int seqSize;
187 for (
unsigned int i = 0; i < seqSize; ++i) {
192 if (endMarker !=
"NonRandomEngine-end") {
193 is.clear(std::ios::badbit | is.rdstate());
194 std::cerr <<
"\n NonRandomEngine state description incomplete."
195 <<
"\nInput stream is probably mispositioned now." << std::endl;
202 if ((v[0] & 0xffffffffUL) != engineIDulong<NonRandomEngine>()) {
204 "\nNonRandomEngine get:state vector has wrong ID word - state unchanged\n";
211 unsigned int seqSize = v[9];
212 if (v.size() != 2*seqSize + 10 ) {
214 "\nNonRandomEngine get:state vector has wrong length - state unchanged\n";
215 std::cerr <<
" (length = " << v.size()
216 <<
"; expected " << 2*seqSize + 10 <<
")\n";
219 std::vector<unsigned long>
t(2);
227 for (
unsigned int i=0; i<seqSize; ++i) {
228 t[0] = v[2*i+10]; t[1] = v[2*i+11];