bpp-seq  2.2.0
bpp::UserAlphabetIndex1 Class Reference

Alphabet index given by user. More...

#include <Bpp/Seq/AlphabetIndex/UserAlphabetIndex1.h>

+ Inheritance diagram for bpp::UserAlphabetIndex1:
+ Collaboration diagram for bpp::UserAlphabetIndex1:

Public Member Functions

 UserAlphabetIndex1 (const Alphabet *alph)
 
 UserAlphabetIndex1 (const UserAlphabetIndex1 &uAlph)
 
UserAlphabetIndex1operator= (const UserAlphabetIndex1 &uAlph)
 
virtual ~UserAlphabetIndex1 ()
 
UserAlphabetIndex1clone () const
 
double getIndex (int state) const
 Get the index associated to a state. More...
 
void setIndex (int state, double val)
 
double getIndex (const std::string &state) const
 Get the index associated to a state. More...
 
void setIndex (const std::string &state, double val)
 
std::vector< double > * getIndexVector () const
 
const AlphabetgetAlphabet () const
 Get the alphabet associated to this index. More...
 

Private Attributes

const Alphabetalph_
 
std::vector< double > index_
 

Detailed Description

Alphabet index given by user.

Definition at line 54 of file UserAlphabetIndex1.h.

Constructor & Destructor Documentation

◆ UserAlphabetIndex1() [1/2]

bpp::UserAlphabetIndex1::UserAlphabetIndex1 ( const Alphabet alph)
inline

Definition at line 62 of file UserAlphabetIndex1.h.

Referenced by clone().

◆ UserAlphabetIndex1() [2/2]

bpp::UserAlphabetIndex1::UserAlphabetIndex1 ( const UserAlphabetIndex1 uAlph)
inline

Definition at line 67 of file UserAlphabetIndex1.h.

◆ ~UserAlphabetIndex1()

virtual bpp::UserAlphabetIndex1::~UserAlphabetIndex1 ( )
inlinevirtual

Definition at line 79 of file UserAlphabetIndex1.h.

Member Function Documentation

◆ clone()

UserAlphabetIndex1* bpp::UserAlphabetIndex1::clone ( ) const
inlinevirtual

Implements bpp::AlphabetIndex1.

Definition at line 81 of file UserAlphabetIndex1.h.

References UserAlphabetIndex1().

◆ getAlphabet()

const Alphabet* bpp::UserAlphabetIndex1::getAlphabet ( ) const
inlinevirtual

Get the alphabet associated to this index.

Returns
Alphabet The alphabet associated to this index.

Implements bpp::AlphabetIndex1.

Definition at line 106 of file UserAlphabetIndex1.h.

References alph_.

◆ getIndex() [1/2]

double bpp::UserAlphabetIndex1::getIndex ( int  state) const
inlinevirtual

Get the index associated to a state.

Parameters
stateThe state to consider, as a int value.
Returns
The index associated to the state

Implements bpp::AlphabetIndex1.

Definition at line 84 of file UserAlphabetIndex1.h.

References alph_, bpp::Alphabet::getStateIndex(), and index_.

◆ getIndex() [2/2]

double bpp::UserAlphabetIndex1::getIndex ( const std::string &  state) const
inlinevirtual

Get the index associated to a state.

Parameters
stateThe state to consider, as a string value.
Returns
The index associated to the state

Implements bpp::AlphabetIndex1.

Definition at line 94 of file UserAlphabetIndex1.h.

References alph_, bpp::Alphabet::getStateIndex(), and index_.

◆ getIndexVector()

std::vector<double>* bpp::UserAlphabetIndex1::getIndexVector ( ) const
inlinevirtual
Returns
A vector object with all indices.

Implements bpp::AlphabetIndex1.

Definition at line 104 of file UserAlphabetIndex1.h.

References index_.

◆ operator=()

UserAlphabetIndex1& bpp::UserAlphabetIndex1::operator= ( const UserAlphabetIndex1 uAlph)
inline

Definition at line 72 of file UserAlphabetIndex1.h.

References alph_, and index_.

◆ setIndex() [1/2]

void bpp::UserAlphabetIndex1::setIndex ( int  state,
double  val 
)
inline

Definition at line 89 of file UserAlphabetIndex1.h.

References alph_, bpp::Alphabet::getStateIndex(), and index_.

◆ setIndex() [2/2]

void bpp::UserAlphabetIndex1::setIndex ( const std::string &  state,
double  val 
)
inline

Definition at line 99 of file UserAlphabetIndex1.h.

References alph_, bpp::Alphabet::getStateIndex(), and index_.

Member Data Documentation

◆ alph_

const Alphabet* bpp::UserAlphabetIndex1::alph_
private

Definition at line 58 of file UserAlphabetIndex1.h.

Referenced by getAlphabet(), getIndex(), operator=(), and setIndex().

◆ index_

std::vector<double> bpp::UserAlphabetIndex1::index_
private

Definition at line 59 of file UserAlphabetIndex1.h.

Referenced by getIndex(), getIndexVector(), operator=(), and setIndex().


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