Introduction
=====
Category: Tile Roo
Krampus: Reindeer
Tesla founder Elon
A couple years a
The effect of theo
Category: The Dile
A high-performance
Brain-specific exp
Q:
Problemas en e/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-2010, Linköpings University,
* Department of Computer and Information Science,
* SE-58183 Linköping, Sweden.
*
* All rights reserved.
*
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THIS OSMC PUBLIC
* LICENSE (http://www.opensource.org/licenses/bsd-license.php).
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3,
* ACCORDING TO RECIPIENTS CHOICE.
*
* The OpenModelica software and the OSMC (Open Source Modelica Consortium)
* Public License (OSMC-PL) are obtained from OSMC, either from the above
* address, from the URLs: http://www.openmodelica.org or
* http://www.ida.liu.se/projects/OpenModelica, and in the OpenModelica
* distribution. GNU version 3 is obtained from:
* http://www.gnu.org/copyleft/gpl.html. The New BSD License is obtained from:
* http://www.opensource.org/licenses/bsd-license.php.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, EXCEPT AS
* EXPRESSLY SET FORTH IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE
* CONDITIONS OF OSMC-PL.
*
*/
/*
* This file contains the main function for generating random numbers and
* is also include by the function rng_generator.cpp in order to generate
* the random seed and the initial random numbers.
*/
#include
#include
#include
#include
#include "RNG.h"
#include "gauss.h"
#include "gamma.h"
#include "lognorm.h"
#include "normal.h"
#include "pois.h"
#include "uniform.h"
#include "xorshift.h"
#include "rng_generator.h"
/*
* Here is the main function. It implements an algorithm which generates n
* random numbers given by the call to the function RNG::rand(seed,n). The
* initial values of the random seed and the generated random numbers are
* stored in files rng0 and rng1 respectively. This is a sample output file:
*
* SOMETHING = 23
* SOMETHING1 = 41
* SOMETHING2 = 55
* ...
* SOMETHING1752 = 1639
* rng0:
* 12
* 19
* 33
* 54
* 63
* 67
* 72
* 81
* 86
* 94
* 98
* ...
* 1297
* 1299
* 1300
* 1301
* 1302
* ...
*/
int main(int argc, char* argv[]) {
ifstream rng0("rng0", ios::binary);
ofstream rng1("rng1", ios::binary);
int seed;
for (int i = 0; i < 2; i++) {
rng0 >> seed;
rng1 << RNG::rand(seed, 10);
}
return 0;
}