Ticket #5399: boost_random_exceptions.patch

File boost_random_exceptions.patch, 3.9 KB (added by matthewbg@…, 11 years ago)
  • random/inversive_congruential.hpp

    diff -u -r random/inversive_congruential.hpp /home/matthewbg/random/inversive_congruential.hpp
    old new  
    9696  template<class It> void seed(It& first, It last)
    9797  {
    9898    if(first == last)
    99       throw std::invalid_argument("inversive_congruential::seed");
     99      boost::throw_exception(std::invalid_argument(
     100          "inversive_congruential::seed"));
    100101    value = *first++;
    101102  }
    102103  IntType operator()()
  • random/lagged_fibonacci.hpp

    diff -u -r random/lagged_fibonacci.hpp /home/matthewbg/random/lagged_fibonacci.hpp
    old new  
    158158      x[j] = *first & wordmask;
    159159    i = long_lag;
    160160    if(first == last && j < long_lag)
    161       throw std::invalid_argument("lagged_fibonacci::seed");
     161      boost::throw_exception(std::invalid_argument("lagged_fibonacci::seed"));
    162162  }
    163163
    164164  /**
     
    411411    }
    412412    i = long_lag;
    413413    if(first == last && j < long_lag)
    414       throw std::invalid_argument("lagged_fibonacci_01::seed");
     414      boost::throw_exception(std::invalid_argument(
     415          "lagged_fibonacci_01::seed"));
    415416  }
    416417
    417418  result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return result_type(0); }
  • random/linear_congruential.hpp

    diff -u -r random/linear_congruential.hpp /home/matthewbg/random/linear_congruential.hpp
    old new  
    139139  void seed(It& first, It last)
    140140  {
    141141    if(first == last)
    142       throw std::invalid_argument("linear_congruential::seed");
     142      boost::throw_exception(std::invalid_argument(
     143          "linear_congruential::seed"));
    143144    seed(*first++);
    144145  }
    145146
  • random/linear_feedback_shift.hpp

    diff -u -r random/linear_feedback_shift.hpp /home/matthewbg/random/linear_feedback_shift.hpp
    old new  
    9595  template<class It> void seed(It& first, It last)
    9696  {
    9797    if(first == last)
    98       throw std::invalid_argument("linear_feedback_shift::seed");
     98      boost::throw_exception(std::invalid_argument(
     99          "linear_feedback_shift::seed"));
    99100    value = *first++;
    100101    assert(value >= (1 << (w-k)));
    101102  }
  • random/mersenne_twister.hpp

    diff -u -r random/mersenne_twister.hpp /home/matthewbg/random/mersenne_twister.hpp
    old new  
    153153      x[j] = *first;
    154154    i = n;
    155155    if(first == last && j < n)
    156       throw std::invalid_argument("mersenne_twister::seed");
     156      boost::throw_exception(std::invalid_argument("mersenne_twister::seed"));
    157157  }
    158158 
    159159  result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return 0; }
  • random/subtract_with_carry.hpp

    diff -u -r random/subtract_with_carry.hpp /home/matthewbg/random/subtract_with_carry.hpp
    old new  
    130130    for(j = 0; j < long_lag && first != last; ++j, ++first)
    131131      x[j] = *first % modulus;
    132132    if(first == last && j < long_lag)
    133       throw std::invalid_argument("subtract_with_carry::seed");
     133      boost::throw_exception(std::invalid_argument(
     134          "subtract_with_carry::seed"));
    134135    carry = (x[long_lag-1] == 0);
    135136    k = 0;
    136137   }
     
    330331      }
    331332    }
    332333    if(first == last && j < long_lag)
    333       throw std::invalid_argument("subtract_with_carry_01::seed");
     334      boost::throw_exception(std::invalid_argument(
     335          "subtract_with_carry_01::seed"));
    334336    carry = (x[long_lag-1] ? 0 : 1 / _modulus);
    335337    k = 0;
    336338  }