bpp-seq3  3.0.0
bpp::UserAlphabetIndex2 Class Reference

Alphabet index given by user. More...

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

+ Inheritance diagram for bpp::UserAlphabetIndex2:
+ Collaboration diagram for bpp::UserAlphabetIndex2:

Public Member Functions

 UserAlphabetIndex2 (std::shared_ptr< const Alphabet > alph, const Matrix< double > &mat)
 
 UserAlphabetIndex2 (const UserAlphabetIndex2 &uAlph)
 
UserAlphabetIndex2 & operator= (const UserAlphabetIndex2 &uAlph)
 
virtual ~UserAlphabetIndex2 ()
 
UserAlphabetIndex2 * clone () const
 
double getIndex (int state1, int state2) const
 Get the index associated to a pair of states. More...
 
double getIndex (const std::string &state1, const std::string &state2) const
 Get the index associated to a pair of states. More...
 
void setIndexMatrix (const Matrix< double > &mat)
 
LinearMatrix< double > * getIndexMatrix () const
 
std::shared_ptr< const Alphabet > getAlphabet () const
 Get the alphabet associated to this index. More...
 
const Alphabet & alphabet () const
 Get the alphabet associated to this index. More...
 
virtual bool isSymmetric () const
 

Private Attributes

std::shared_ptr< const Alphabet > alph_
 
LinearMatrix< double > index_
 
bool sym_
 

Detailed Description

Alphabet index given by user.

Definition at line 21 of file UserAlphabetIndex2.h.

Constructor & Destructor Documentation

◆ UserAlphabetIndex2() [1/2]

bpp::UserAlphabetIndex2::UserAlphabetIndex2 ( std::shared_ptr< const Alphabet >  alph,
const Matrix< double > &  mat 
)
inline

Definition at line 30 of file UserAlphabetIndex2.h.

References index_, bpp::MatrixTools::isSymmetric(), and sym_.

Referenced by clone().

◆ UserAlphabetIndex2() [2/2]

bpp::UserAlphabetIndex2::UserAlphabetIndex2 ( const UserAlphabetIndex2 &  uAlph)
inline

Definition at line 38 of file UserAlphabetIndex2.h.

◆ ~UserAlphabetIndex2()

virtual bpp::UserAlphabetIndex2::~UserAlphabetIndex2 ( )
inlinevirtual

Definition at line 53 of file UserAlphabetIndex2.h.

Member Function Documentation

◆ alphabet()

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

Get the alphabet associated to this index.

Returns
Alphabet The alphabet associated to this index.

Implements bpp::AlphabetIndex2.

Definition at line 78 of file UserAlphabetIndex2.h.

References alph_.

◆ clone()

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

Implements bpp::AlphabetIndex2.

Definition at line 55 of file UserAlphabetIndex2.h.

References UserAlphabetIndex2().

◆ getAlphabet()

std::shared_ptr<const Alphabet> bpp::UserAlphabetIndex2::getAlphabet ( ) const
inlinevirtual

Get the alphabet associated to this index.

Returns
Alphabet The alphabet associated to this index.

Implements bpp::AlphabetIndex2.

Definition at line 76 of file UserAlphabetIndex2.h.

References alph_.

◆ getIndex() [1/2]

double bpp::UserAlphabetIndex2::getIndex ( const std::string &  state1,
const std::string &  state2 
) const
inlinevirtual

Get the index associated to a pair of states.

Parameters
state1First state to consider, as a string value.
state2Second state to consider, as a string value.
Returns
The index associated to the pair of states.

Implements bpp::AlphabetIndex2.

Definition at line 63 of file UserAlphabetIndex2.h.

References alph_, and index_.

◆ getIndex() [2/2]

double bpp::UserAlphabetIndex2::getIndex ( int  state1,
int  state2 
) const
inlinevirtual

Get the index associated to a pair of states.

Parameters
state1First state to consider, as a int value in the Alphabet
state2Second state to consider, as a int value in the Alphabet
Returns
The index associated to the pair of states.

Implements bpp::AlphabetIndex2.

Definition at line 58 of file UserAlphabetIndex2.h.

References alph_, and index_.

◆ getIndexMatrix()

LinearMatrix<double>* bpp::UserAlphabetIndex2::getIndexMatrix ( ) const
inlinevirtual
Returns
A matrix object with all indices.

Implements bpp::AlphabetIndex2.

Definition at line 74 of file UserAlphabetIndex2.h.

References index_.

◆ isSymmetric()

virtual bool bpp::UserAlphabetIndex2::isSymmetric ( ) const
inlinevirtual
Returns
True if the index is symatric (that is, index(i,j) == index(j, i)).

Implements bpp::AlphabetIndex2.

Definition at line 83 of file UserAlphabetIndex2.h.

References sym_.

◆ operator=()

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

Definition at line 44 of file UserAlphabetIndex2.h.

References alph_, index_, and sym_.

◆ setIndexMatrix()

void bpp::UserAlphabetIndex2::setIndexMatrix ( const Matrix< double > &  mat)
inline

Definition at line 68 of file UserAlphabetIndex2.h.

References index_, bpp::MatrixTools::isSymmetric(), and sym_.

Member Data Documentation

◆ alph_

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

Definition at line 25 of file UserAlphabetIndex2.h.

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

◆ index_

LinearMatrix<double> bpp::UserAlphabetIndex2::index_
private

◆ sym_

bool bpp::UserAlphabetIndex2::sym_
private

Definition at line 27 of file UserAlphabetIndex2.h.

Referenced by isSymmetric(), operator=(), setIndexMatrix(), and UserAlphabetIndex2().


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