Changeset 750 for trunk/yat/random


Ignore:
Timestamp:
Feb 17, 2007, 11:56:29 AM (14 years ago)
Author:
Jari Häkkinen
Message:

Addresses #2. Continued adding GSL_error exceptions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/random/random.cc

    r738 r750  
    3939      // support rng/seed changes through environment vars
    4040    if (!gsl_rng_env_setup())
    41       throw utility::GSL_error("RNG: unknown generator");
     41      throw utility::GSL_error("RNG::RNG unknown generator");
    4242    if (!(rng_=gsl_rng_alloc(gsl_rng_default)))
    43       throw utility::GSL_error("RNG: failed to allocate memory");
     43      throw utility::GSL_error("RNG::RNG failed to allocate memory");
    4444  }
    4545
     
    110110  {
    111111    if (!(rng_ = gsl_rng_clone(rng->rng())))
    112       throw utility::GSL_error("RNG_state: failed to allocate memory");
     112      throw utility::GSL_error("RNG_state::RNG_state failed to allocate memory");
    113113  }
    114114 
     
    152152    delete p;
    153153    if (!gen_)
    154       throw utility::GSL_error("DiscreteGeneral: failed to setup generator.");
     154      throw utility::GSL_error("DiscreteGeneral::DiscreteGeneral failed to setup generator.");
    155155  }
    156156
     
    174174  {
    175175    if (range_>rng_->max()) {
    176       std::stringstream ss("DiscreteUniform: ");
     176      std::stringstream ss("DiscreteUniform::DiscreteUniform: ");
    177177      ss << n << " is too large for RNG " << rng_->name();
    178178      throw utility::GSL_error(ss.str());
     
    193193    // underlying RNG
    194194    if (n>rng_->max()) {
    195       std::stringstream ss("DiscreteUniform::op(): ");
     195      std::stringstream ss("DiscreteUniform::operator(u_long): ");
    196196      ss << n << " is too large for RNG " << rng_->name();
    197197      throw utility::GSL_error(ss.str());
Note: See TracChangeset for help on using the changeset viewer.