Ticket #9115: boost_random_shadow_warning_fix.diff
File boost_random_shadow_warning_fix.diff, 3.9 KB (added by , 9 years ago) |
---|
-
boost/random/lagged_fibonacci.hpp
143 143 BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, lagged_fibonacci_engine, f) 144 144 { 145 145 os << f.i; 146 for(unsigned int i = 0; i < f.long_lag; ++i)147 os << ' ' << f.x[ i];146 for(unsigned int j = 0; j < f.long_lag; ++j) 147 os << ' ' << f.x[j]; 148 148 return os; 149 149 } 150 150 … … 154 154 BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, lagged_fibonacci_engine, f) 155 155 { 156 156 is >> f.i >> std::ws; 157 for(unsigned int i = 0; i < f.long_lag; ++i)158 is >> f.x[ i] >> std::ws;157 for(unsigned int j = 0; j < f.long_lag; ++j) 158 is >> f.x[j] >> std::ws; 159 159 return is; 160 160 } 161 161 … … 163 163 * Returns true if the two generators will produce identical 164 164 * sequences of outputs. 165 165 */ 166 BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(lagged_fibonacci_engine, x , y)167 { return x .i == y.i && std::equal(x.x, x.x+long_lag, y.x); }166 BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(lagged_fibonacci_engine, x_, y_) 167 { return x_.i == y_.i && std::equal(x_.x, x_.x+long_lag, y_.x); } 168 168 169 169 /** 170 170 * Returns true if the two generators will produce different … … 354 354 using std::pow; 355 355 os << f.i; 356 356 std::ios_base::fmtflags oldflags = os.flags(os.dec | os.fixed | os.left); 357 for(unsigned int i = 0; i < f.long_lag; ++i)358 os << ' ' << f.x[ i] * f.modulus();357 for(unsigned int j = 0; j < f.long_lag; ++j) 358 os << ' ' << f.x[j] * f.modulus(); 359 359 os.flags(oldflags); 360 360 return os; 361 361 } … … 366 366 BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, lagged_fibonacci_01_engine, f) 367 367 { 368 368 is >> f.i; 369 for(unsigned int i = 0; i < f.long_lag; ++i) {369 for(unsigned int j = 0; j < f.long_lag; ++j) { 370 370 typename lagged_fibonacci_01_engine::result_type value; 371 371 is >> std::ws >> value; 372 f.x[ i] = value / f.modulus();372 f.x[j] = value / f.modulus(); 373 373 } 374 374 return is; 375 375 } … … 378 378 * Returns true if the two generators will produce identical 379 379 * sequences of outputs. 380 380 */ 381 BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(lagged_fibonacci_01_engine, x , y)382 { return x .i == y.i && std::equal(x.x, x.x+long_lag, y.x); }381 BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(lagged_fibonacci_01_engine, x_, y_) 382 { return x_.i == y_.i && std::equal(x_.x, x_.x+long_lag, y_.x); } 383 383 384 384 /** 385 385 * Returns true if the two generators will produce different -
boost/random/mersenne_twister.hpp
234 234 * Returns true if the two generators are in the same state, 235 235 * and will thus produce identical sequences. 236 236 */ 237 friend bool operator==(const mersenne_twister_engine& x ,238 const mersenne_twister_engine& y )237 friend bool operator==(const mersenne_twister_engine& x_, 238 const mersenne_twister_engine& y_) 239 239 { 240 if(x .i < y.i) return x.equal_imp(y);241 else return y .equal_imp(x);240 if(x_.i < y_.i) return x_.equal_imp(y_); 241 else return y_.equal_imp(x_); 242 242 } 243 243 244 244 /** 245 245 * Returns true if the two generators are in different states. 246 246 */ 247 friend bool operator!=(const mersenne_twister_engine& x ,248 const mersenne_twister_engine& y )249 { return !(x == y); }247 friend bool operator!=(const mersenne_twister_engine& x_, 248 const mersenne_twister_engine& y_) 249 { return !(x_ == y_); } 250 250 251 251 private: 252 252 /// \cond show_private