C++ mpi module for stochmagnet_main Package
Public Member Functions | Static Public Member Functions | List of all members
SM_StochasticBoltzmann Class Reference

This class stores stochastic Boltzmann distribution for 1 spin. More...

#include <SM_StochasticBoltzmann.h>

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

Public Member Functions

 SM_StochasticBoltzmann (void)
 create
 
virtual ~SM_StochasticBoltzmann (void)
 destroy
 
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 adimensionize (const SM_Material &material) override
 adimensionize the output compoent with material characteristic More...
 
virtual void copy (const SM_StochasticOutputComponent &c) override
 copy the stochastic data More...
 
void setSegmentsNumber (const tInteger &n)
 set the number of subdivisions of the support of the distribution More...
 
const tInteger & getSegmentsNumber () const
 get the number of subdivisions of the support of the distribution More...
 
void setAxis (const std::array< tReal, SM_Constants::DIM > &axis)
 set the easy axis More...
 
void setAxis (const std::vector< tReal > &axis)
 set the easy axis More...
 
const std::array< tReal, SM_Constants::DIM > & getAxis () const
 get the easy axis More...
 
void printHeader (std::ofstream &file, const SM_Beam &beam)
 print header on file More...
 
tBoolean open (const SM_Beam &beam)
 open the stochastic data More...
 
tBoolean open (const tIndex &s, const SM_System &system)
 open the stochastic data for simulation s More...
 
tBoolean store (const SM_System &system)
 store the stochastic data during the evolution method of the system More...
 
tBoolean close (const tIndex &s, const SM_System &system, const tBoolean &hasSucceeded)
 close the stochastic data for the end of the simulation s More...
 
tBoolean close (const SM_Beam &beam)
 close stochastic data at the end of all simulations at each epsilon More...
 
virtual void closePackedSimulations (const SM_Beam &beam, const tIndex &rawValuesNumber, const std::valarray< tReal > &rawValues) override
 reduction the raws values for packed simlations More...
 
virtual tString toString () const override
 return the string representation of the class More...
 
- Public Member Functions inherited from SM_StochasticOutput< SM_StochasticBoltzmann >
virtual tBoolean openComponent (const SM_Beam &beam) final
 open the stochastic data More...
 
virtual tBoolean openComponent (const tIndex &s, const SM_System &system) final
 open the stochastic data for simulation s More...
 
virtual tBoolean storeComponent (const SM_System &system) final
 store the stochastic data during the relation method of the system More...
 
virtual tBoolean closeComponent (const tIndex &s, const SM_System &system, const tBoolean &hasSucceeded) final
 close the stochastic data for the simulation s More...
 
virtual tBoolean closeComponent (const SM_Beam &beam) final
 close stochastic data at the end of all simulations More...
 
tBoolean open (const SM_Beam &beam)
 open the stochastic data More...
 
tBoolean open (const tIndex &s, const SM_System &system)
 open the stochastic data for simulation s More...
 
tBoolean store (const SM_System &system)
 store the stochastic data during the relation method of the system More...
 
tBoolean close (const tIndex &s, const SM_System &system, const tBoolean &hasSucceeded)
 close the stochastic data for the simulation s More...
 
tBoolean close (const SM_Beam &beam)
 close stochastic data at the end of all simulations More...
 
- Public Member Functions inherited from SM_StochasticOutputComponent
 SM_StochasticOutputComponent (void)
 create
 
virtual ~SM_StochasticOutputComponent (void)
 destroy
 
virtual void setOutputPath (const tString &path)
 set the output path More...
 
const tString & getOutputPath () const
 return the output path More...
 
virtual void setPrefix (const tString &prefix)
 set the prefix of generated files More...
 
const tString & getPrefix () const
 return the prefix More...
 
virtual void setIndex (const int &index, const int &rootIndex, const int &n)
 set index of the output component More...
 
void setIndex (const int &index, const int &n)
 set index of the output component More...
 
const int & getIndex () const
 get the index of the output component
 
const int & getRootIndex () const
 get the root index of the output component
 
const int & getIndicesNumber () const
 get the number of output components
 
void setDrawnStepsNumber (const tInteger &n)
 set the number of steps for drawn for the stochastic output More...
 
const tInteger & getDrawnStepsNumber () const
 get the drawn number to compute the stochastic output More...
 
void setPackedSimulationsIndex (const tInteger &i)
 set packed simulations index More...
 
const tInteger & getPackedSimulationsIndex () const
 get packed simulations index More...
 
void setPackedSimulationsNumber (const tInteger &n)
 set packed simulations number More...
 
const tInteger & getPackedSimulationsNumber () const
 get packed simulations number More...
 
const tBoolean & hasLogPerPackedSimulations () const
 return true if the stochastic output has log per pack of simulations
 
void setHasLogPerPackedSimulations (const tBoolean &v)
 set to true if the stochastic output has log per pack of simulations More...
 
const tIndex & getPackedRawValuesNumber () const
 get the packed raw values number More...
 
tIndex & getPackedRawValuesNumber ()
 get the packed raw values number More...
 
std::valarray< tReal > & getPackedRawValues ()
 get the packed raw values More...
 
const std::valarray< tReal > & getPackedRawValues () const
 get the packed raw values More...
 
const std::vector< tString > & getOutputDescription () const
 get the string representation of the output values More...
 
void setOutputDescription (const std::vector< tString > &v)
 et the output description More...
 
const std::valarray< tReal > & getOutputValues () const
 get the output values of the stochastic output for reading More...
 
std::valarray< tReal > & getOutputValues ()
 get the output values of the stochastic output for writing More...
 
- Public Member Functions inherited from SM_Object
 SM_Object (void)
 create
 
virtual ~SM_Object (void)
 destroy
 
- Public Member Functions inherited from CORE_Object
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< SelfNew ()
 build a new instance of a stochastic data More...
 
static CORE_UniquePointer< SelfNew (const Self &c)
 build a new instance of a stochastic data More...
 
static tBoolean LoadDistributionFile (const tString &fn, std::vector< tReal > &intervals, std::vector< tIndex > &intervalSamplesNumber, tIndex &samplesNumber, std::vector< tReal > &probability, std::vector< tReal > &boltzmannProbability)
 load distribution from file More...
 
- Static Public Member Functions inherited from CORE_Object
static tBoolean EnableMemoryStack (const tBoolean &isMemoryChecked)
 enable the memory stack More...
 
static void EnableMemoryStack ()
 enable the memory stack
 
static void DisableMemoryStack ()
 disable the memory stack
 
static tBoolean IsMemoryStackEnabled ()
 return trur if the memory stack is enabled
 
static tString MemoryStackToString ()
 get the memory stack in string More...
 
static tIndex GetRegisteredClassesNumber ()
 get the memory stack in string More...
 

Additional Inherited Members

- Protected Member Functions inherited from SM_StochasticOutput< SM_StochasticBoltzmann >
 SM_StochasticOutput (void)
 create
 
virtual ~SM_StochasticOutput (void)
 destroy
 
- Protected Member Functions inherited from CORE_Object
 CORE_Object ()
 build an instance of the object
 
virtual ~CORE_Object ()
 destroy the instance of object std

 

Detailed Description

This class stores stochastic Boltzmann distribution for 1 spin.

Member Function Documentation

◆ adimensionize()

virtual void SM_StochasticBoltzmann::adimensionize ( const SM_Material material)
inlineoverridevirtual

adimensionize the output compoent with material characteristic

Parameters
[in]materialmaterial to adimensonize the data

Implements SM_StochasticOutputComponent.

◆ close() [1/2]

tBoolean SM_StochasticBoltzmann::close ( const SM_Beam beam)
inline

close stochastic data at the end of all simulations at each epsilon

Parameters
[in]beamclose the stochastic output for beam runs
  • E_k/=nSimulations
  • \( E= \sqrt(\sum_k E_k^2) \)

◆ close() [2/2]

tBoolean SM_StochasticBoltzmann::close ( const tIndex &  s,
const SM_System system,
const tBoolean &  hasSucceeded 
)
inline

close the stochastic data for the end of the simulation s

Parameters
[in]s: index of the simulation
[in]systemsystem to close
[in]hasSucceededresult of the simulation

◆ closePackedSimulations()

virtual void SM_StochasticBoltzmann::closePackedSimulations ( const SM_Beam beam,
const tIndex &  rawValuesNumber,
const std::valarray< tReal > &  rawValues 
)
inlineoverridevirtual

reduction the raws values for packed simlations

Parameters
[in]beam: beam
[in]rawValuesNumber: number of raws
[in]rawValues: values of ralues

Implements SM_StochasticOutputComponent.

◆ copy()

virtual void SM_StochasticBoltzmann::copy ( const SM_StochasticOutputComponent c)
inlineoverridevirtual

copy the stochastic data

Parameters
[in]cstochastic data to copy

Reimplemented from SM_StochasticOutput< SM_StochasticBoltzmann >.

◆ getAxis()

const std::array<tReal,SM_Constants::DIM>& SM_StochasticBoltzmann::getAxis ( ) const
inline

get the easy axis

Returns
the easy axis

◆ getContentsMemorySize()

virtual tMemSize SM_StochasticBoltzmann::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 SM_StochasticOutput< SM_StochasticBoltzmann >.

◆ getMemorySize()

virtual tMemSize SM_StochasticBoltzmann::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 SM_StochasticOutput< SM_StochasticBoltzmann >.

◆ getSegmentsNumber()

const tInteger& SM_StochasticBoltzmann::getSegmentsNumber ( ) const
inline

get the number of subdivisions of the support of the distribution

Returns
the number of segments of the support

◆ LoadDistributionFile()

static tBoolean SM_StochasticBoltzmann::LoadDistributionFile ( const tString &  fn,
std::vector< tReal > &  intervals,
std::vector< tIndex > &  intervalSamplesNumber,
tIndex &  samplesNumber,
std::vector< tReal > &  probability,
std::vector< tReal > &  boltzmannProbability 
)
inlinestatic

load distribution from file

Parameters
[in]fn: file name of the distribution file to load
[out]intervalsintervals of the distribution
[out]intervalSamplesNumber: number of samples in the intervals
[out]samplesNumber: number of samples
[out]probability: normalized probability per interval
[out]boltzmannProbability: boltzmann probability per interval

◆ New() [1/2]

static CORE_UniquePointer<Self> SM_StochasticBoltzmann::New ( )
inlinestatic

build a new instance of a stochastic data

Returns
an unique pointer of a stochastic data

◆ New() [2/2]

static CORE_UniquePointer<Self> SM_StochasticBoltzmann::New ( const Self c)
inlinestatic

build a new instance of a stochastic data

Returns
an unique pointer of a stochastic data

◆ open() [1/2]

tBoolean SM_StochasticBoltzmann::open ( const SM_Beam beam)
inline

open the stochastic data

Parameters
[in]beam: beam that open the data

It writes the data into the file

◆ open() [2/2]

tBoolean SM_StochasticBoltzmann::open ( const tIndex &  s,
const SM_System system 
)
inline

open the stochastic data for simulation s

Parameters
[in]s: index of the simulation
[in]systemsystem which is running

◆ printHeader()

void SM_StochasticBoltzmann::printHeader ( std::ofstream &  file,
const SM_Beam beam 
)
inline

print header on file

Parameters
[in,out]filefile output stream
[in]beambeam to print

◆ setAxis() [1/2]

void SM_StochasticBoltzmann::setAxis ( const std::array< tReal, SM_Constants::DIM > &  axis)
inline

set the easy axis

Parameters
[in]axiseasy axis

◆ setAxis() [2/2]

void SM_StochasticBoltzmann::setAxis ( const std::vector< tReal > &  axis)
inline

set the easy axis

Parameters
[in]axiseasy axis

◆ setSegmentsNumber()

void SM_StochasticBoltzmann::setSegmentsNumber ( const tInteger &  n)
inline

set the number of subdivisions of the support of the distribution

Parameters
[in]n: numbe rof segments of the support

◆ store()

tBoolean SM_StochasticBoltzmann::store ( const SM_System system)
inline

store the stochastic data during the evolution method of the system

Parameters
[in]system: system which is running

It computes \( E_s[k]= \frac{1}{P}. \sum_{p=0}^{p=P-1} \mu^s_T(p)[k] \)

◆ toString()

virtual tString SM_StochasticBoltzmann::toString ( ) const
inlineoverridevirtual

return the string representation of the class

Returns
the string representation of the class

Reimplemented from SM_StochasticOutputComponent.


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