bpp-seq3  3.0.0
bpp::SimpleScore Class Reference

Simple Substitution Matrix, with match and mismatch penalties. More...

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

+ Inheritance diagram for bpp::SimpleScore:
+ Collaboration diagram for bpp::SimpleScore:

Public Member Functions

 SimpleScore (const Alphabet *alphabet, double match, double mismatch)
 Build a new simpleScore object. More...
 
 SimpleScore (const SimpleScore &sc)
 
SimpleScoreoperator= (const SimpleScore &sc)
 
virtual ~SimpleScore ()
 
SimpleScoreclone () const override
 
Methods from the AlphabetIndex2 interface.
double getIndex (int state1, int state2) const override
 Get the index associated to a pair of states. More...
 
double getIndex (const std::string &state1, const std::string &state2) const override
 Get the index associated to a pair of states. More...
 
std::shared_ptr< const AlphabetgetAlphabet () const override
 Get the alphabet associated to this index. More...
 
const Alphabetalphabet () const override
 Get the alphabet associated to this index. More...
 
const Matrix< double > & getIndexMatrix () const override
 
bool isSymmetric () const override
 

Private Attributes

LinearMatrix< double > distanceMatrix_
 
std::shared_ptr< const Alphabetalphabet_
 

Detailed Description

Simple Substitution Matrix, with match and mismatch penalties.

Definition at line 23 of file SimpleScore.h.

Constructor & Destructor Documentation

◆ SimpleScore() [1/2]

SimpleScore::SimpleScore ( const Alphabet alphabet,
double  match,
double  mismatch 
)

Build a new simpleScore object.

Parameters
alphabetThe alphabet to use.
matchMatching score.
mismatchMismatching penalty.

Definition at line 14 of file SimpleScore.cpp.

References alphabet_, and distanceMatrix_.

Referenced by clone().

◆ SimpleScore() [2/2]

bpp::SimpleScore::SimpleScore ( const SimpleScore sc)
inline

Definition at line 40 of file SimpleScore.h.

◆ ~SimpleScore()

virtual bpp::SimpleScore::~SimpleScore ( )
inlinevirtual

Definition at line 52 of file SimpleScore.h.

Member Function Documentation

◆ alphabet()

const Alphabet& bpp::SimpleScore::alphabet ( ) const
inlineoverridevirtual

Get the alphabet associated to this index.

Returns
Alphabet The alphabet associated to this index.

Implements bpp::AlphabetIndex2.

Definition at line 65 of file SimpleScore.h.

References alphabet_.

◆ clone()

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

Implements bpp::AlphabetIndex2.

Definition at line 54 of file SimpleScore.h.

References SimpleScore().

◆ getAlphabet()

std::shared_ptr<const Alphabet> bpp::SimpleScore::getAlphabet ( ) const
inlineoverridevirtual

Get the alphabet associated to this index.

Returns
Alphabet The alphabet associated to this index.

Implements bpp::AlphabetIndex2.

Definition at line 64 of file SimpleScore.h.

References alphabet_.

◆ getIndex() [1/2]

double SimpleScore::getIndex ( const std::string &  state1,
const std::string &  state2 
) const
overridevirtual

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 36 of file SimpleScore.cpp.

References alphabet_, and distanceMatrix_.

◆ getIndex() [2/2]

double SimpleScore::getIndex ( int  state1,
int  state2 
) const
overridevirtual

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 29 of file SimpleScore.cpp.

References alphabet_, and distanceMatrix_.

◆ getIndexMatrix()

const Matrix<double>& bpp::SimpleScore::getIndexMatrix ( ) const
inlineoverridevirtual
Returns
A matrix object with all indices.

Implements bpp::AlphabetIndex2.

Definition at line 66 of file SimpleScore.h.

References distanceMatrix_.

◆ isSymmetric()

bool bpp::SimpleScore::isSymmetric ( ) const
inlineoverridevirtual
Returns
True if the index is symetric (that is, index(i,j) == index(j, i)).

Implements bpp::AlphabetIndex2.

Definition at line 67 of file SimpleScore.h.

◆ operator=()

SimpleScore& bpp::SimpleScore::operator= ( const SimpleScore sc)
inline

Definition at line 45 of file SimpleScore.h.

References alphabet_, and distanceMatrix_.

Member Data Documentation

◆ alphabet_

std::shared_ptr<const Alphabet> bpp::SimpleScore::alphabet_
private

Definition at line 28 of file SimpleScore.h.

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

◆ distanceMatrix_

LinearMatrix<double> bpp::SimpleScore::distanceMatrix_
private

Definition at line 27 of file SimpleScore.h.

Referenced by getIndex(), getIndexMatrix(), operator=(), and SimpleScore().


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