StochHMM  v0.34
Flexible Hidden Markov Model C++ Library and Application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | Friends
StochHMM::weightDef Class Reference

#include <externDefinitions.h>

Inheritance diagram for StochHMM::weightDef:
StochHMM::ExDef

List of all members.

Public Member Functions

 weightDef (size_t)
 Create a weightDef type.
 ~weightDef ()
double getWeight (size_t stateIter)
void assignWeight (size_t, double)
std::string stringify ()
 Get the string representation of the weightDef.
- Public Member Functions inherited from StochHMM::ExDef
 ExDef ()
virtual ~ExDef ()
size_t getState ()
bool isAbsolute ()
void setState (size_t stIter)

Private Attributes

sparseArray< double > weights

Friends

class ExDefSequence

Additional Inherited Members

- Protected Attributes inherited from StochHMM::ExDef
bool absolute
size_t weightedState

Detailed Description

weightDef defines weighted external definitions. Model weights the states at the position with a value

Definition at line 132 of file externDefinitions.h.


Constructor & Destructor Documentation

StochHMM::weightDef::weightDef ( size_t  state_size)

Create a weightDef type.

Definition at line 130 of file externDefinitions.cpp.

References StochHMM::ExDef::absolute, SIZE_MAX, and StochHMM::ExDef::weightedState.

:ExDef(), weights(state_size){
absolute=false;
//weights.assign(state_size, 0);
//st=NULL;
}
StochHMM::weightDef::~weightDef ( )
inline

Definition at line 136 of file externDefinitions.h.

{};

Member Function Documentation

void StochHMM::weightDef::assignWeight ( size_t  stateIter,
double  logValue 
)
virtual

Assign a weight to a particular state

Parameters:
stateIterinteger Iterator to the state
logValueLog value of weight to apply

Reimplemented from StochHMM::ExDef.

Definition at line 140 of file externDefinitions.cpp.

{
if (!weights.defined(stateIter)){
weights[stateIter] = logValue;
}
else{
weights[stateIter]+=logValue;
}
return;
}
double StochHMM::weightDef::getWeight ( size_t  stateIter)
inlinevirtual

Reimplemented from StochHMM::ExDef.

Definition at line 140 of file externDefinitions.h.

{
if (weights.defined(stateIter)){
return weights[stateIter];
}
return 0;
};
std::string StochHMM::weightDef::stringify ( )
virtual

Get the string representation of the weightDef.

Reimplemented from StochHMM::ExDef.

Definition at line 164 of file externDefinitions.cpp.

References StochHMM::double_to_string(), and StochHMM::int_to_string().

{
std::string test;
test+="STATES: ";
for(size_t i=0;i<weights.size();i++){
if (weights[i]!=0.0){
test+= "\t" + int_to_string(i) + "\t" + double_to_string(weights[i]) + "\n";
}
}
return test;
}

Friends And Related Function Documentation

friend class ExDefSequence
friend

Reimplemented from StochHMM::ExDef.

Definition at line 136 of file externDefinitions.h.


Member Data Documentation

sparseArray<double> StochHMM::weightDef::weights
private

Definition at line 150 of file externDefinitions.h.


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