link to homepage

Institute for Neuroscience and Medicine

Navigation and service


API documentation

Sample Class Reference

The Sample is the object to simulate. It contains the spins. More...

#include <Sample.h>

Collaboration diagram for Sample:

List of all members.

Public Member Functions

 Sample ()
 Sample (string file)
 Sample (long size)
virtual ~Sample ()
void Init ()
void ClearSpins ()
 delete the spin structure
void CreateSpins (long size)
 create the spin structure
long GetSize ()
SampleGetSubSample (int n, long size)
double * GetValues (long l)
double * GetResolution ()
void InitRandGenerator (int val=1)
void SetR2Prime (double val)
void SetPositionRandomness (double val)
double GetDeltaB (long pos=-1)
void Populate (string file)
Spin_dataGetSpinsData ()
void SetReorderStrategy (string strat)
void ReorderSample ()
void DumpRestartInfo (CoilArray *RxCA)
 Utility function for restart: dump information to restart jemris after crash.
void ReportSpin (int beg, int end, int value)
 Utility function for restart: mark spins which have been calculated.
int ReadSpinsState ()
 Utility function for restart: Read restart file after crash.
void ClearSpinsState ()
 Utility function for restart: mark all spins as not simulated.
void GetScatterVectors (int *sendcount, int *displ, int size)
 utility function to send sample in parallel mode: initial samples are send via mpi_scatterv; get needed vectors to scatter data.
void GetNextPacket (int &noSpins, int &NextSpinToSend, int SlaveId)
 utility function to send sample in parallel mode: get next spin packet to be sent. (beginning index + no_spins to send)
int SpinsLeft ()
void SetTimeInterval (double val)

Detailed Description

The Sample is the object to simulate. It contains the spins.

Definition at line 72 of file Sample.h.


Constructor & Destructor Documentation

Sample::Sample (  ) 

Constructor

Definition at line 50 of file Sample.cpp.

References Init().

Referenced by GetSubSample().

Here is the call graph for this function:

Here is the caller graph for this function:

Sample::Sample ( string  file  ) 

Constructor

Create a container from binary file

Parameters:
file Sample binary file

Definition at line 95 of file Sample.cpp.

References Init(), InitRandGenerator(), and Populate().

Here is the call graph for this function:

Sample::Sample ( long  size  ) 

Constructor

Create a container of requested size initialized with zeros

Parameters:
size Size of the sample

Definition at line 88 of file Sample.cpp.

References CreateSpins(), and Init().

Here is the call graph for this function:

Sample::~Sample (  )  [virtual]

Destructor

Definition at line 55 of file Sample.cpp.

References ClearSpins().

Here is the call graph for this function:


Member Function Documentation

void Sample::CreateSpins ( long  size  ) 

create the spin structure

Parameters:
size Size of the spin structure to create

Definition at line 70 of file Sample.cpp.

Referenced by mpi_recieve_sample_paket(), and Sample().

Here is the caller graph for this function:

double Sample::GetDeltaB ( long  pos = -1  ) 

Get off-resonance of a specific spin.

The off-resonance is given by the deterministic value, read by Populate from the binary file, plus the random field fluctuation specified by SetR2Prime.

Parameters:
pos Position of the spin. If negative, last acquired spin by GetValues is used.
Returns:
The off-resonance in unit [Khz]

Definition at line 239 of file Sample.cpp.

References DB, GetValues(), R2, and R2S.

Referenced by Model::Solve().

Here is the call graph for this function:

Here is the caller graph for this function:

double* Sample::GetResolution (  )  [inline]

Get resolution

More elaborate description here please

Parameters:
l More elaborate description here please

Definition at line 154 of file Sample.h.

long Sample::GetSize (  ) 

Get size of the sample

Returns:
Size of the sample

Definition at line 212 of file Sample.cpp.

Referenced by GetNextPacket(), GetScatterVectors(), GetSubSample(), Populate(), ReadSpinsState(), Simulator::SetSample(), and Model::Solve().

Here is the caller graph for this function:

Spin_data* Sample::GetSpinsData (  )  [inline]

returns pointer to sample data (needed for MPI send/receive)

Definition at line 199 of file Sample.h.

Referenced by mpi_recieve_sample_paket().

Here is the caller graph for this function:

Sample * Sample::GetSubSample ( int  n,
long  size 
)

Get a subset of this sample

Parameters:
n N-th subset
size Size of the subset

Definition at line 181 of file Sample.cpp.

References GetSize(), and Sample().

Here is the call graph for this function:

double * Sample::GetValues ( long  l  ) 

Get values

More elaborate description here please

Parameters:
l More elaborate description here please

Definition at line 217 of file Sample.cpp.

Referenced by GetDeltaB(), and Model::Solve().

Here is the caller graph for this function:

void Sample::Init (  ) 

init variables which are same for all constructors

Definition at line 33 of file Sample.cpp.

Referenced by Sample().

Here is the caller graph for this function:

void Sample::InitRandGenerator ( int  val = 1  )  [inline]

Initialize the randome number generator

Parameters:
val any integer

Definition at line 161 of file Sample.h.

Referenced by Sample().

Here is the caller graph for this function:

void Sample::Populate ( string  file  ) 

Create a container from binary file

Parameters:
file Sample binary file

Definition at line 108 of file Sample.cpp.

References ClearSpins(), and GetSize().

Referenced by Sample().

Here is the call graph for this function:

Here is the caller graph for this function:

void Sample::ReorderSample (  ) 

executes sample reordering

Definition at line 250 of file Sample.cpp.

References SampleReorderStrategyInterface::Execute().

Referenced by Simulator::SetSample(), and Simulator::Simulator().

Here is the call graph for this function:

Here is the caller graph for this function:

void Sample::SetPositionRandomness ( double  val  )  [inline]

Set the position randomness in per cent of the cartesian resolution.

Parameters:
val Percentage width of the Gaussian distribution.

Definition at line 175 of file Sample.h.

Referenced by Simulator::SetParameter().

Here is the caller graph for this function:

void Sample::SetR2Prime ( double  val  )  [inline]

Set the random local field fluctuations.

Parameters:
val R2Prime (Shaping parameter of the Lorentz distribution in kHz).

Definition at line 168 of file Sample.h.

Referenced by Simulator::SetParameter().

Here is the caller graph for this function:

void Sample::SetReorderStrategy ( string  strat  ) 

can set a method to reorder the sample (do nothing, shuffle sample,... )

Definition at line 256 of file Sample.cpp.

Referenced by Simulator::SetParameter().

Here is the caller graph for this function:

void Sample::SetTimeInterval ( double  val  )  [inline]

Set Time interval in seconds after which new spins are sent (approx. value.)

Definition at line 255 of file Sample.h.

Referenced by Simulator::SetSample().

Here is the caller graph for this function:

int Sample::SpinsLeft (  ) 

Returns No spins which still needs to be calculated.

Definition at line 471 of file Sample.cpp.

Referenced by GetNextPacket(), and GetScatterVectors().

Here is the caller graph for this function:


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

Servicemeu