ell::S_LP Class Reference
#include <S_LP.hh>
Inheritance diagram for ell::S_LP:
Detailed Description
Definition at line 12 of file S_LP.hh.
Public Types | |
typedef size_t | Move |
typedef biu::VirtualList< State > | NeighborList |
typedef std::auto_ptr< NeighborList > | NeighborListPtr |
Public Member Functions | |
virtual State * | applyNeighborChange (const size_t index, State *const neigh) const |
virtual S_LP * | clone (State *toFill=NULL) const=0 |
virtual CSequence & | compress (CSequence &toFill) const=0 |
virtual CSequence | compress (void) const =0 |
virtual State * | fromString (const std::string &stringRep) const =0 |
virtual double | getEnergy () const |
virtual const std::string & | getID (void) const =0 |
virtual unsigned int | getMinimalDistance (const State &state2) const =0 |
virtual State * | getNeighbor (const size_t index, State *neigh) const |
virtual NeighborListPtr | getNeighborList () const |
virtual size_t | getNeighborNumber (void) const |
virtual State * | getRandomNeighbor (State *inPlaceNeigh=NULL) const |
virtual NeighborListPtr | getRandomNeighborList () const |
virtual bool | operator!= (const State &state2) const |
virtual bool | operator< (const State &lp2) const |
virtual bool | operator== (const State &state2) const |
S_LP (const S_LP &state) | |
S_LP (biu::LatticeProtein_I *latProt, biu::LatticeMoveSet *moveSet) | |
virtual std::string & | toString (std::string &toFill) const |
virtual std::string | toString () const |
virtual State * | uncompress (const CSequence &cseq)=0 |
virtual State * | uncompress (const CSequence &cseq, State *toFill=NULL) const =0 |
virtual State * | undoNeighborChange (const size_t index, State *const neigh) const |
virtual | ~S_LP () |
Static Public Member Functions | |
static bool | less (const State *s1, const State *s2) |
Protected Attributes | |
biu::LatticeProtein_I * | latProt |
biu::LatticeMoveSet * | moveSet |
Member Typedef Documentation
typedef size_t ell::S_LP::Move |
typedef biu::VirtualList<State> ell::State::NeighborList [inherited] |
typedef std::auto_ptr<NeighborList> ell::State::NeighborListPtr [inherited] |
Constructor & Destructor Documentation
ell::S_LP::S_LP | ( | biu::LatticeProtein_I * | latProt, | |
biu::LatticeMoveSet * | moveSet | |||
) |
Member Function Documentation
Applies the necessary changes to a given state to get the neighbor. Note: neigh is expected to be a copy (i.e. *this == *neigh) and therefore direct changes are possible or to be NULL. If (neigh==NULL) a copy of this has to be generated, modified, and returned.
- Parameters:
-
index the neighbor to generate neigh a copy of this the changes should be applied to
- Returns:
- the neighbor state of the given index or NULL if the index is out of range
Implements ell::IterableNeighbors.
Returns a pointer to a clone of the current state.
- Returns:
- a pointer to a copy of this state, if toFill is != NULL the return value corresponds to the updated state pointed to by toFill, otherwise a new object is created !!!
Implements ell::State.
Implemented in ell::S_LP_PullM.
Access to a compressed sequence representation of the state.
- Parameters:
-
toFill a data structure to write the compressed representation too
- Returns:
- the compressed sequence representation
Implements ell::State.
Implemented in ell::S_LP_PullM.
virtual CSequence ell::S_LP::compress | ( | void | ) | const [pure virtual] |
Access to a compressed sequence representation of the state.
- Returns:
- the compressed sequence representation
Implements ell::State.
Implemented in ell::S_LP_PullM.
virtual State* ell::S_LP::fromString | ( | const std::string & | stringRep | ) | const [pure virtual] |
Returns a new State based on the current state. The new state differs only by the information given by stringRep.
Implements ell::State.
Implemented in ell::S_LP_PullM.
double ell::S_LP::getEnergy | ( | ) | const [virtual] |
virtual const std::string& ell::State::getID | ( | void | ) | const [pure virtual, inherited] |
Access to a State subclass specific ID string to identify instances of this class.
- Returns:
- the subclass specific ID string
Implemented in ell::S_LP_PullM, ell::S_RNAfe_SingleM, ell::S_RNAfe_SingleM_TB, ell::S_Explicit, ell::S_SG_Ising, and ell::S_SG_NPP.
virtual unsigned int ell::State::getMinimalDistance | ( | const State & | state2 | ) | const [pure virtual, inherited] |
Returns the minimal number of steps via valid neighbored states from this to another valid State.
- Parameters:
-
state2 the State to reach
Implemented in ell::S_LP_PullM, ell::S_RNAfe_SingleM, ell::S_RNAfe_SingleM_TB, ell::S_Explicit, and ell::S_SG_Ising.
Access to a specific neighbor.
- Parameters:
-
index the index of the neighbor in [0, getNeighborNumber()) neigh if != NULL this state should be converted into the neighbor otherwise a new one is created and returned
- Returns:
- the new neighbor state or NULL if the index is >= getNeighborNumber()
Implements ell::IterableNeighbors.
State::NeighborListPtr ell::S_LP::getNeighborList | ( | ) | const [virtual] |
Returns a virtual list of all VALID neighbored states in the energy landscape in a specific order.
Implements ell::State.
size_t ell::S_LP::getNeighborNumber | ( | void | ) | const [virtual] |
How many neighbor indices are accessible.
- Returns:
- the number of neighbors
Implements ell::IterableNeighbors.
Returns a VALID random neighbored state. If a state is given, this is changed to a neighbor.
Implements ell::State.
State::NeighborListPtr ell::S_LP::getRandomNeighborList | ( | ) | const [virtual] |
Returns a virtual list of all VALID neighbored states in the energy landscape in a random order. If a state is given, this is changed to a neighbor.
Implements ell::State.
Comparison function that compares two State pointer based on the less than operator '<' of the first State. The function can be used in STL algorithms, e.g. if only State pointer are stored but the ordering should be based on the object order.
- Parameters:
-
s1 the State pointer of the object that is asked to be smaller (!=NULL) s2 the State pointer of the object that is asked to be bigger (!=NULL)
- Returns:
- s1->operator <(*s1);
Reimplemented in ell::S_Explicit.
bool ell::S_LP::operator!= | ( | const State & | state2 | ) | const [virtual] |
bool ell::S_LP::operator< | ( | const State & | lp2 | ) | const [virtual] |
Implements a unique order on S_LP states based on their energy and absolute move string representation. A state is smaller than another one iff it has smaller energy or it has equal energy and a lexicographically smaller absolute move string representation (tie breaker).
- Parameters:
-
lp2 the S_LP object to compare to
- Returns:
- true if this state is smaller than lp2 according to the unique order of the states
Reimplemented from ell::State.
bool ell::S_LP::operator== | ( | const State & | state2 | ) | const [virtual] |
std::string & ell::S_LP::toString | ( | std::string & | toFill | ) | const [virtual] |
Fills the given string with a specific std::string representation of this State.
- Parameters:
-
toFill the string to overwrite
- Returns:
- the changed toFill in parameter
Implements ell::State.
std::string ell::S_LP::toString | ( | ) | const [virtual] |
Returns a specific std::string representation of this State.
Implements ell::State.
Uncompresses a compressed sequence representation into a this State object.
- Parameters:
-
cseq the compressed sequence representation of a state
- Returns:
- this or NULL in error case
Implements ell::State.
Implemented in ell::S_LP_PullM.
virtual State* ell::S_LP::uncompress | ( | const CSequence & | cseq, | |
State * | toFill = NULL | |||
) | const [pure virtual] |
Uncompresses a compressed sequencce representation into a new State object.
- Parameters:
-
cseq the compressed sequence representation of a state toFill a state object to uncompress too or NULL if a new object has to be created
- Returns:
- new State object that is encoded in cseq or NULL in error case.
Implements ell::State.
Implemented in ell::S_LP_PullM.
Undo the changes done to this state to generate the given neighbor. The goal is to do less operations than doing a full copy like (*neigh = *this).
- Parameters:
-
index the neighbor index that was applied last [ 0, getNeighborNumber() ) neigh the state resulting from the last changes ( != NULL)
- Returns:
- the copy of this object via undoing the last changes in neigh
Implements ell::IterableNeighbors.
Field Documentation
biu::LatticeProtein_I* ell::S_LP::latProt [protected] |
biu::LatticeMoveSet* ell::S_LP::moveSet [protected] |
The documentation for this class was generated from the following files: