MTMCSim  0.5
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
MTMCSim::MSALSim Class Reference

Simulator for multistage LDPC for two source distributed source coding. More...

#include <MSALDPC.h>

Inheritance diagram for MTMCSim::MSALSim:

Classes

class  ALDPCInfo
 
class  LDPCGroup
 
class  MSALCompRes
 The computed results from input parameters. More...
 
class  MSALPara
 The parameters for the simulation. More...
 
class  MSALSimuRes
 The simulation results. More...
 
class  ThreadWorkSpace
 Work space for each thread. More...
 
class  XYSeq
 A random number object for this problem is two correlated sequence X and Y. More...
 

Public Member Functions

 MSALSim (MSALPara &para_, TextSaveUI &resFile_, TextSaveUI &tempFile_, DispUI &dispUI_)
 
void prepare (const MCThreadInfo &)
 This function will be called by the scheduler before the threads are created. More...
 
void oneThread (shared_ptr< RNObj >, const MCThreadInfo &)
 The work to be done by a worker thread. More...
 
shared_ptr< RNObjgenRNObj ()
 Returns the random number object, usually they are random sequences. More...
 
void dumpOneResult (const MCThreadInfo &)
 Put the result from one thread to the final result object. More...
 
void oneKnownFrame ()
 Single thread simulation. More...
 
void setCompResMap (compResMap &compResM_) const
 Calls compRes.setMapping(compResM_);. More...
 
void initRNG ()
 
void postProcess ()
 This function will be called after the RNG thread and worker threads are done. More...
 
virtual bool checkTerm ()
 Return true if the terminate condition satisfies. More...
 
- Public Member Functions inherited from MTMCSim::MTMCSimBase
void singleThreadSim ()
 Single thread simulation. More...
 
virtual ~MTMCSimBase ()
 Virtual Destructor. More...
 

Detailed Description

Simulator for multistage LDPC for two source distributed source coding.

Constructor & Destructor Documentation

MTMCSim::MSALSim::MSALSim ( MSALPara para_,
TextSaveUI resFile_,
TextSaveUI tempFile_,
DispUI dispUI_ 
)

Member Function Documentation

bool MTMCSim::MSALSim::checkTerm ( )
virtual

Return true if the terminate condition satisfies.

Thread safty is partially guaranteed by the scheduler. The result object will be locked but only the result object will be locked. So, typically it only reads the parameter object (which is always safe) and reads the result object (because the result object is locked by the scheduler)

Implements MTMCSim::MTMCSimBase.

void MTMCSim::MSALSim::dumpOneResult ( const MCThreadInfo )
virtual

Put the result from one thread to the final result object.

It itself does not need to consider thread safty because a mutex will be locked before it is called.

Implements MTMCSim::MTMCSimBase.

shared_ptr< RNObj > MTMCSim::MSALSim::genRNObj ( )
virtual

Returns the random number object, usually they are random sequences.

Each object is for one thread. The object is created by "new" inside the function and can be accessed througth the renturned shared_ptr.

Implements MTMCSim::MTMCSimBase.

void MTMCSim::MSALSim::initRNG ( )
void MTMCSim::MSALSim::oneKnownFrame ( )

Single thread simulation.

Simulate one given frame, for testing or careful examination.

void MTMCSim::MSALSim::oneThread ( shared_ptr< RNObj ,
const MCThreadInfo  
)
virtual

The work to be done by a worker thread.

This function should be written in a thread-safe manner, i.e., no conflict. no critical section. This typically can be done by creating workspace for each thread, either as an automatic variable in the function, or as a data member in the simulator class.

Implements MTMCSim::MTMCSimBase.

void MTMCSim::MSALSim::postProcess ( )
virtual

This function will be called after the RNG thread and worker threads are done.

Reimplemented from MTMCSim::MTMCSimBase.

void MTMCSim::MSALSim::prepare ( const MCThreadInfo )
virtual

This function will be called by the scheduler before the threads are created.

\ Typically do resource allocation here.

Reimplemented from MTMCSim::MTMCSimBase.

void MTMCSim::MSALSim::setCompResMap ( compResMap compResM_) const
virtual

Calls compRes.setMapping(compResM_);.

Implements MTMCSim::MTMCSimBase.


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