QMCPACK
FakeRandom< T > Class Template Reference
+ Inheritance diagram for FakeRandom< T >:
+ Collaboration diagram for FakeRandom< T >:

Public Types

using result_type = typename RandomBase< T >::result_type
 
using uint_type = typename RandomBase< T >::uint_type
 
- Public Types inherited from RandomBase< T >
using result_type = T
 
using uint_type = uint_fast32_t
 

Public Member Functions

 FakeRandom ()
 
operator() () override
 
void init (int iseed) override
 
void seed (uint_fast32_t aseed) override
 
void write (std::ostream &rout) const override
 
void read (std::istream &rin) override
 
void load (const std::vector< uint_type > &newstate) override
 
void save (std::vector< uint_type > &curstate) const override
 
size_t state_size () const override
 
std::unique_ptr< RandomBase< T > > makeClone () const override
 
void set_value (double val)
 
- Public Member Functions inherited from RandomBase< T >
virtual ~RandomBase ()=default
 
virtual void load (const std::vector< uint_type > &newstate)=0
 
virtual void save (std::vector< uint_type > &curstate) const =0
 

Private Attributes

m_val {0.5}
 

Detailed Description

template<typename T = double>
class qmcplusplus::FakeRandom< T >

Definition at line 23 of file FakeRandom.h.

Member Typedef Documentation

◆ result_type

using result_type = typename RandomBase<T>::result_type

Definition at line 26 of file FakeRandom.h.

◆ uint_type

using uint_type = typename RandomBase<T>::uint_type

Definition at line 27 of file FakeRandom.h.

Constructor & Destructor Documentation

◆ FakeRandom()

FakeRandom ( )
default

Member Function Documentation

◆ init()

void init ( int  iseed)
inlineoverridevirtual

Implements RandomBase< T >.

Definition at line 32 of file FakeRandom.h.

32 {};

◆ load()

void load ( const std::vector< uint_type > &  newstate)
inlineoverride

Definition at line 36 of file FakeRandom.h.

36 {};

◆ makeClone()

std::unique_ptr<RandomBase<T> > makeClone ( ) const
inlineoverridevirtual

Implements RandomBase< T >.

Definition at line 39 of file FakeRandom.h.

39 { return std::make_unique<FakeRandom<T>>(*this); }

◆ operator()()

T operator() ( )
overridevirtual

Implements RandomBase< T >.

Definition at line 27 of file FakeRandom.cpp.

28 {
29  return m_val;
30 }

◆ read()

void read ( std::istream &  rin)
inlineoverridevirtual

Implements RandomBase< T >.

Definition at line 35 of file FakeRandom.h.

References FakeRandom< T >::m_val.

35 { rin >> m_val; };

◆ save()

void save ( std::vector< uint_type > &  curstate) const
inlineoverride

Definition at line 37 of file FakeRandom.h.

37 {};

◆ seed()

void seed ( uint_fast32_t  aseed)
inlineoverridevirtual

Implements RandomBase< T >.

Definition at line 33 of file FakeRandom.h.

33 {};

◆ set_value()

void set_value ( double  val)

Definition at line 21 of file FakeRandom.cpp.

Referenced by qmcplusplus::TEST_CASE().

22 {
23  m_val = val;
24 }

◆ state_size()

size_t state_size ( ) const
inlineoverridevirtual

Implements RandomBase< T >.

Definition at line 38 of file FakeRandom.h.

38 { return 0; };

◆ write()

void write ( std::ostream &  rout) const
inlineoverridevirtual

Implements RandomBase< T >.

Definition at line 34 of file FakeRandom.h.

References FakeRandom< T >::m_val.

Referenced by qmcplusplus::TEST_CASE().

34 { rout << m_val; };

Member Data Documentation

◆ m_val

T m_val {0.5}
private

Definition at line 44 of file FakeRandom.h.

Referenced by FakeRandom< T >::read(), and FakeRandom< T >::write().


The documentation for this class was generated from the following files: