chxavrandom.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:1k
- /*============================================================================*
- *
- * (c) 1995-2002 RealNetworks, Inc. Patents pending. All rights reserved.
- *
- *============================================================================*/
-
- #ifndef __RANDOM_H__
- #define __RANDOM_H__
- #include "chxavvector.h"
- class RandomSequence {
- public:
- RandomSequence(unsigned int seed = 1, int type=3);
-
- unsigned int Random();
- void SRandom(unsigned int seed);
- static const unsigned int RandomMax;
- private:
- class LCG {
- public:
- LCG(unsigned int seed);
- unsigned int Random();
- void SRandom(unsigned int seed);
- private:
- unsigned int m_seed;
- };
- class LFG {
- public:
- LFG();
- LFG(unsigned int seed,int type);
- unsigned int Random();
- void SRandom(unsigned int seed);
- class StateGen {
- public:
- StateGen(unsigned int seed);
- unsigned int Random();
- private:
- unsigned int m_seed;
- };
-
- class SeqParams {
- public:
- int m_degree;
- int m_seperation;
- };
- const static SeqParams zm_seqParams[];
- int m_degree;
- int m_sep;
- int m_fptr;
- int m_rptr;
- CHXAvVector<unsigned int> m_state;
- };
- int m_type;
- LCG m_lcg;
- LFG m_lfg;
- };
- #endif