File: reinit.cc

package info (click to toggle)
simrisc 16.05.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,568 kB
  • sloc: cpp: 6,877; fortran: 665; makefile: 112; ansic: 112; sh: 107
file content (28 lines) | stat: -rw-r--r-- 529 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#define XERR
#include "random.ih"

// Called from Loop::iterate, defines the betadistributions if vary is set

void Random::reinit(size_t nCases, GeneratorType type)
{
    if (Globals::vary() and nCases == 1)
        throw Exception{} << "'spread: true' cannot be used with 'cases: 1'";

    d_nCases = nCases;

    switch (type)
    {
        case INCREASING_SEED:
            ++d_seed;
        break;

        case FIXED_SEED:
        break;

        default:
            d_seed = time(0);
        break;
    }

    reset();
}