Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/LinearAlgebra/RealSpaceMatrix.cpp

    r66fd49 ra5028f  
    2828#include "LinearAlgebra/Vector.hpp"
    2929#include "LinearAlgebra/VectorContent.hpp"
     30#include "RandomNumbers/RandomNumberGeneratorFactory.hpp"
     31#include "RandomNumbers/RandomNumberGenerator.hpp"
    3032
    3133#include <gsl/gsl_blas.h>
     
    125127{
    126128  double phi[NDIM];
     129  RandomNumberGenerator &random = RandomNumberGeneratorFactory::getInstance().makeRandomNumberGenerator();
     130  const double rng_min = random.min();
     131  const double rng_max = random.max();
     132
    127133
    128134  for (int i=0;i<NDIM;i++) {
    129     phi[i] = rand()/(RAND_MAX/(2.*M_PI));
     135    phi[i] = (random()/(rng_max-rng_min))*(2.*M_PI);
     136    std::cout << "Random angle is " << phi[i] << std::endl;
    130137  }
    131138
Note: See TracChangeset for help on using the changeset viewer.