Changeset 26595


Ignore:
Timestamp:
11/10/21 15:09:47 (3 years ago)
Author:
bulthuis
Message:

CHG: add member functions for random generators in a separate file

Location:
issm/trunk-jpl/src/c/shared/Random
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp

    r26594 r26595  
    55#include <iostream>
    66#include "./randomgenerator.h"
     7
     8#undef M_PI
     9#define M_PI 3.141592653589793238462643
     10
     11rnd_uniform_distribution::rnd_uniform_distribution(){/*{{{*/
     12
     13                a   = 1103515245;       // BSD Formula
     14                c  = 12345;                                     // BSD Formula
     15                m = 2147483648;                 // BSD Formula
     16                _seed = 0;
     17                lbound = 0.0;
     18                ubound = 1.0;
     19                return;
     20}
     21/*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/shared/Random/randomgenerator.h

    r26594 r26595  
    33 */
    44
    5 #ifndef _RANDOMGENERATOR_H_
    6 #define _RANDOMGENERATOR_H_
     5//#ifndef _RANDOMGENERATOR_H_
     6//#define _RANDOMGENERATOR_H_
    77
    88#undef M_PI
     
    2323
    2424    /*constructors, destructors: */
    25     rnd_uniform_distribution() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(0.0), ubound(1.0) {}
     25    rnd_uniform_distribution();
    2626    rnd_uniform_distribution(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(a_1), ubound(a_2) {}
    2727    ~rnd_uniform_distribution(){}
     
    7171};
    7272
    73 #endif //ifndef _RANDOMGENERATOR_H_
     73//#endif //ifndef _RANDOMGENERATOR_H_
Note: See TracChangeset for help on using the changeset viewer.