MersenneTwister.h File Reference

#include <iostream>
#include <limits.h>
#include <stdio.h>
#include <time.h>
#include <math.h>

Go to the source code of this file.

Data Structures

class  MTRand

Functions

std::ostream & operator<< (std::ostream &os, const MTRand &mtrand)
std::istream & operator>> (std::istream &is, MTRand &mtrand)


Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const MTRand mtrand 
) [inline]

Definition at line 370 of file MersenneTwister.h.

References MTRand::left, MTRand::N, and MTRand::state.

00371 {
00372     register const MTRand::uint32 *s = mtrand.state;
00373     register int i = mtrand.N;
00374     for( ; i--; os << *s++ << "\t" ) {}
00375     return os << mtrand.left;
00376 }

std::istream& operator>> ( std::istream &  is,
MTRand mtrand 
) [inline]

Definition at line 379 of file MersenneTwister.h.

References MTRand::left, MTRand::N, MTRand::pNext, and MTRand::state.

00380 {
00381     register MTRand::uint32 *s = mtrand.state;
00382     register int i = mtrand.N;
00383     for( ; i--; is >> *s++ ) {}
00384     is >> mtrand.left;
00385     mtrand.pNext = &mtrand.state[mtrand.N-mtrand.left];
00386     return is;
00387 }


Generated on Wed May 5 00:06:38 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6