bpp-seq3  3.0.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 (std::shared_ptr< const Alphabet > alph)
 
 UserAlphabetIndex1 (const UserAlphabetIndex1 &uAlph)
 
UserAlphabetIndex1operator= (const UserAlphabetIndex1 &uAlph)
 
virtual ~UserAlphabetIndex1 ()
 
UserAlphabetIndex1clone () const override
 
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)
 
const std::vector< double > & indexVector () const
 
std::shared_ptr< const AlphabetgetAlphabet () const
 Get the alphabet associated to this index. More...
 
const Alphabetalphabet () const
 Get the alphabet associated to this index. More...
 

Private Attributes

std::shared_ptr< const Alphabetalph_
 
std::vector< double > index_
 

Detailed Description

Alphabet index given by user.

Definition at line 19 of file UserAlphabetIndex1.h.

Constructor & Destructor Documentation

◆ UserAlphabetIndex1() [1/2]

bpp::UserAlphabetIndex1::UserAlphabetIndex1 ( std::shared_ptr< const Alphabet alph)
inline

Definition at line 27 of file UserAlphabetIndex1.h.

Referenced by clone().

◆ UserAlphabetIndex1() [2/2]

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

Definition at line 32 of file UserAlphabetIndex1.h.

◆ ~UserAlphabetIndex1()

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

Definition at line 44 of file UserAlphabetIndex1.h.

Member Function Documentation

◆ alphabet()

const Alphabet& bpp::UserAlphabetIndex1::alphabet ( ) const
inlinevirtual

Get the alphabet associated to this index.

Returns
Alphabet The alphabet associated to this index.

Implements bpp::AlphabetIndex1.

Definition at line 73 of file UserAlphabetIndex1.h.

References alph_.

◆ clone()

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

Implements bpp::AlphabetIndex1.

Definition at line 46 of file UserAlphabetIndex1.h.

References UserAlphabetIndex1().

◆ getAlphabet()

std::shared_ptr<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 71 of file UserAlphabetIndex1.h.

References alph_.

◆ getIndex() [1/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 59 of file UserAlphabetIndex1.h.

References alph_, and index_.

◆ getIndex() [2/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 49 of file UserAlphabetIndex1.h.

References alph_, and index_.

◆ indexVector()

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

Implements bpp::AlphabetIndex1.

Definition at line 69 of file UserAlphabetIndex1.h.

References index_.

◆ operator=()

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

Definition at line 37 of file UserAlphabetIndex1.h.

References alph_, and index_.

◆ setIndex() [1/2]

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

Definition at line 64 of file UserAlphabetIndex1.h.

References alph_, and index_.

◆ setIndex() [2/2]

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

Definition at line 54 of file UserAlphabetIndex1.h.

References alph_, and index_.

Member Data Documentation

◆ alph_

std::shared_ptr<const Alphabet> bpp::UserAlphabetIndex1::alph_
private

Definition at line 23 of file UserAlphabetIndex1.h.

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

◆ index_

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

Definition at line 24 of file UserAlphabetIndex1.h.

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


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