Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

MersenneTwister.h File Reference

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

Go to the source code of this file.

Compounds

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 298 of file MersenneTwister.h.

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

00299 {
00300         register const MTRand::uint32 *s = mtrand.state;
00301         register int i = mtrand.N;
00302         for( ; i--; os << *s++ << "\t" ) {}
00303         return os << mtrand.left;
00304 }

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

Definition at line 307 of file MersenneTwister.h.

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

00308 {
00309         register MTRand::uint32 *s = mtrand.state;
00310         register int i = mtrand.N;
00311         for( ; i--; is >> *s++ ) {}
00312         is >> mtrand.left;
00313         mtrand.pNext = &mtrand.state[mtrand.N-mtrand.left];
00314         return is;
00315 }


Generated on Thu Jun 16 17:14:10 2005 for Matvec by doxygen1.2.16