C++ main module for stochmagnet Package  1.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SMS_BoostNormalFunction Class Reference

This class implements a stochastic function with a normal law implemented from the boost library. More...

#include <SMS_BoostNormalFunction.h>

Inheritance diagram for SMS_BoostNormalFunction:
Inheritance graph
[legend]
Collaboration diagram for SMS_BoostNormalFunction:
Collaboration graph
[legend]

Public Member Functions

 SMS_BoostNormalFunction ()
 create an object More...
 
virtual ~SMS_BoostNormalFunction (void)
 destroy an object. More...
 
virtual tMemSize getMemorySize () const
 return the memory size of the class and the memory size of all its attributes/associations More...
 
virtual tMemSize getContentsMemorySize () const
 return the memory size of the included associations More...
 
virtual void initializeSeed (const tULLInt &seed) override
 initialize the seed More...
 
virtual void setProperties (const tReal &mean, const tReal &sd) override
 set the properties of the stochastic fntion More...
 
virtual tReal random () const override
 random return a random numbers in range More...
 
tReal templatedRandom () const
 random return a random numbers in range More...
 
virtual tString toString () const override
 turn the class into a string More...
 
template<class T >
std::shared_ptr< T > getSharedPointer ()
 return the shared pointer for this More...
 
template<class T >
std::shared_ptr< const T > getConstSharedPointer () const
 return a const shared pointer for this More...
 
template<class T >
tBoolean isInstanceOf () const
 test if the clas T is an instance of this class More...
 
tString getClassName () const
 return the name of the class More...
 
tString getPointerString () const
 retrun the pointer of the class as a string More...
 
tString getIdentityString () const
 retrun the string identification of the class More...
 

Static Public Member Functions

static CORE_UniquePointer< SMS_BoostNormalFunctionNew ()
 build a new instance of the stochasticfunction More...
 
static tBoolean EnableMemoryStack (const tBoolean &isMemoryChecked)
 enable the memory stack More...
 
static void EnableMemoryStack ()
 enable the memory stack More...
 
static void DisableMemoryStack ()
 disable the memory stack More...
 
static tBoolean IsMemoryStackEnabled ()
 return trur if the memory stack is enabled More...
 
static tString MemoryStackToString ()
 get the memory stack in string More...
 
static tIndex GetRegisteredClassesNumber ()
 get the memory stack in string More...
 

Private Member Functions

template<class T >
std::shared_ptr< T > setThis (std::unique_ptr< T, CORE_Object::Delete > &up)
 set the shared pointer from an unique pointer More...
 
RNGTypegetRNGenerator ()
 get the generator More...
 

Static Private Member Functions

static void initSeed ()
 init the seed More...
 
static void initSeed (const tULLInt &v)
 init the seed More...
 

Private Attributes

boost::random::normal_distribution< tReal > * mRandomDistribution
 
boost::random::variate_generator< RNGType &, boost::random::normal_distribution< tReal > > * mGenerator
 
std::weak_ptr< CORE_ObjectmThis
 

Static Private Attributes

static RNGType mRNGenerator
 
static tBoolean INIT_SEED =true
 

Detailed Description

This class implements a stochastic function with a normal law implemented from the boost library.

Author
Stéphane Despréaux
Version
1.0

Constructor & Destructor Documentation

◆ SMS_BoostNormalFunction()

SMS_BoostNormalFunction::SMS_BoostNormalFunction ( )

create an object

References mGenerator, mRandomDistribution, and setProperties().

Referenced by New().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~SMS_BoostNormalFunction()

SMS_BoostNormalFunction::~SMS_BoostNormalFunction ( void  )
virtual

destroy an object.

References mGenerator, and mRandomDistribution.

Member Function Documentation

◆ DisableMemoryStack()

static void CORE_Object::DisableMemoryStack ( )
inlinestaticinherited

disable the memory stack

Referenced by CORE_Object::EnableMemoryStack().

Here is the caller graph for this function:

◆ EnableMemoryStack() [1/2]

static void CORE_Object::EnableMemoryStack ( )
inlinestaticinherited

enable the memory stack

Referenced by CORE_Object::EnableMemoryStack(), and CORE_Run::SetDebugOptions().

Here is the caller graph for this function:

◆ EnableMemoryStack() [2/2]

static tBoolean CORE_Object::EnableMemoryStack ( const tBoolean isMemoryChecked)
inlinestaticinherited

enable the memory stack

Parameters
[in]isMemoryChecked: true to verify memory allocation of CORE_Object classes
Returns
true if the memroy is checked

References CORE_Object::DisableMemoryStack(), CORE_Object::EnableMemoryStack(), and CORE_Object::IsMemoryStackEnabled().

Here is the call graph for this function:

◆ getClassName()

tString CORE_Object::getClassName ( ) const
inlineinherited

return the name of the class

Returns
the string name of the class

Referenced by CORE_Object::getIdentityString(), and CORE_Test::testTypes().

Here is the caller graph for this function:

◆ getConstSharedPointer()

template<class T >
std::shared_ptr<const T> CORE_Object::getConstSharedPointer ( ) const
inlineinherited

return a const shared pointer for this

Returns
the shared pointer as a type T

References CORE_Object::mThis.

◆ getContentsMemorySize()

virtual tMemSize SMS_BoostNormalFunction::getContentsMemorySize ( ) const
inlinevirtual

return the memory size of the included associations

Returns
the memory size of the storage in bytes 1 Kb = 1024 bytes 1 Mb = 1024 Kb 1 Gb = 1024 Mb 1 Tb = 1024 Gb 1 Hb = 1024 Tb

Reimplemented from CORE_Object.

References CORE_Object::getContentsMemorySize(), mGenerator, mRandomDistribution, and tMemSize.

Referenced by getMemorySize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIdentityString()

tString CORE_Object::getIdentityString ( ) const
inlineinherited

retrun the string identification of the class

Returns
the string identity of the class

References CORE_Object::getClassName(), and core_functions::pointerToString().

Referenced by CORE_Test::testArray(), CORE_Test::testField(), CORE_Test::testTypes(), CORE_Object::toString(), CORE_ClassFactory::toString(), and CORE_Field< T, K, D, S, I >::toString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMemorySize()

virtual tMemSize SMS_BoostNormalFunction::getMemorySize ( ) const
inlinevirtual

return the memory size of the class and the memory size of all its attributes/associations

Returns
the memory size of the class and the memory size of its attributes/associations in bytes The mamory size is :
  • the added size of the base classes which contains:
    • the primary attributes size depends on the order: (first delare the smallest attributes size
    • all virtual functions costs <pointer-size> (4 32xor 8 64x) bytes by virtual function
    • virtual inherihtance will increase of (4 or 8) bytes
  • we add the size of the contains values of the attributes : for example the size of a string is the length of the string 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from SMS_BoostRandomFunction.

References getContentsMemorySize().

Here is the call graph for this function:

◆ getPointerString()

tString CORE_Object::getPointerString ( ) const
inlineinherited

retrun the pointer of the class as a string

Returns
the pointer of the calss as a string

References core_functions::pointerToString().

Here is the call graph for this function:

◆ GetRegisteredClassesNumber()

static tIndex CORE_Object::GetRegisteredClassesNumber ( )
inlinestaticinherited

get the memory stack in string

Returns
the string representation of the memory stack

◆ getRNGenerator()

RNGType& SMS_BoostRandomFunction::getRNGenerator ( )
inlineinherited

get the generator

References SMS_BoostRandomFunction::mRNGenerator.

Referenced by setProperties(), and SMS_BoostUniformFunction::setSupport().

Here is the caller graph for this function:

◆ getSharedPointer()

template<class T >
std::shared_ptr<T> CORE_Object::getSharedPointer ( )
inlineinherited

return the shared pointer for this

Returns
the shared pointer as a type T

References CORE_Object::mThis.

◆ initializeSeed()

virtual void SMS_BoostNormalFunction::initializeSeed ( const tULLInt seed)
inlineoverridevirtual

initialize the seed

Parameters
seed: init value of the seed for generating random numbers

Implements SM_StochasticFunction.

References SMS_BoostRandomFunction::initSeed().

Here is the call graph for this function:

◆ initSeed() [1/2]

void SMS_BoostRandomFunction::initSeed ( )
staticinherited

init the seed

Referenced by initializeSeed(), SMS_BoostUniformFunction::initializeSeed(), and SMS_BoostRandomFunction::SMS_BoostRandomFunction().

Here is the caller graph for this function:

◆ initSeed() [2/2]

void SMS_BoostRandomFunction::initSeed ( const tULLInt v)
staticinherited

◆ isInstanceOf()

template<class T >
tBoolean CORE_Object::isInstanceOf ( ) const
inlineinherited

test if the clas T is an instance of this class

Returns
true if the object is an instance of T

Referenced by SM_Beam::templatedSimulate().

Here is the caller graph for this function:

◆ IsMemoryStackEnabled()

static tBoolean CORE_Object::IsMemoryStackEnabled ( )
inlinestaticinherited

return trur if the memory stack is enabled

Referenced by CORE_Object::EnableMemoryStack(), and main().

Here is the caller graph for this function:

◆ MemoryStackToString()

static tString CORE_Object::MemoryStackToString ( )
inlinestaticinherited

get the memory stack in string

Returns
the string representation of the memory stack

Referenced by main().

Here is the caller graph for this function:

◆ New()

static CORE_UniquePointer<SMS_BoostNormalFunction> SMS_BoostNormalFunction::New ( )
inlinestatic

build a new instance of the stochasticfunction

Returns
an unique pointer of the stochastic function

References SMS_BoostNormalFunction().

Referenced by SM_ClassFactory::NewInstance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random()

virtual tReal SMS_BoostNormalFunction::random ( ) const
inlineoverridevirtual

random return a random numbers in range

Implements SM_StochasticFunction.

References templatedRandom().

Here is the call graph for this function:

◆ setProperties()

void SMS_BoostNormalFunction::setProperties ( const tReal mean,
const tReal sd 
)
overridevirtual

set the properties of the stochastic fntion

Parameters
[in]mean: mean of the random function
[in]sd: strandt deviation of the random function

Implements SM_StochasticFunction.

References SMS_BoostRandomFunction::getRNGenerator(), mGenerator, and mRandomDistribution.

Referenced by SMS_BoostNormalFunction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setThis()

template<class T >
std::shared_ptr<T> CORE_Object::setThis ( std::unique_ptr< T, CORE_Object::Delete > &  up)
inlineprivateinherited

set the shared pointer from an unique pointer

Parameters
[in,out]upunique pointer of the class at input, points to null pointer at output
Returns
the shared pointer of the class

Method only calledby the friend class CORE_ClassFactory::NewSharedInstance()

References CORE_Object::mThis.

◆ templatedRandom()

tReal SMS_BoostNormalFunction::templatedRandom ( ) const
inline

random return a random numbers in range

References mGenerator.

Referenced by random().

Here is the caller graph for this function:

◆ toString()

virtual tString SM_StochasticFunction::toString ( ) const
inlineoverridevirtualinherited

turn the class into a string

Returns
the string representation of the class

Reimplemented from CORE_Object.

References CORE_Object::toString().

Here is the call graph for this function:

Member Data Documentation

◆ INIT_SEED

tBoolean SMS_BoostRandomFunction::INIT_SEED =true
staticprivateinherited

◆ mGenerator

boost::random::variate_generator<RNGType&, boost::random::normal_distribution<tReal> >* SMS_BoostNormalFunction::mGenerator
private

◆ mRandomDistribution

boost::random::normal_distribution<tReal>* SMS_BoostNormalFunction::mRandomDistribution
private

◆ mRNGenerator

RNGType SMS_BoostRandomFunction::mRNGenerator
staticprivateinherited

◆ mThis

std::weak_ptr<CORE_Object> CORE_Object::mThis
privateinherited

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