NCBI C++ ToolKit
Public Member Functions | Private Attributes | List of all members
CPhyTreeCalc::CDistMatrix Class Reference

Search Toolkit Book for CPhyTreeCalc::CDistMatrix

Distance matrix (square, symmetric with zeros on diagnol) More...

#include <algo/phy_tree/phytree_calc.hpp>

+ Collaboration diagram for CPhyTreeCalc::CDistMatrix:

Public Member Functions

 CDistMatrix (int num_elements=0)
 Constructor. More...
 
int GetNumElements (void) const
 Get number of rows/columns. More...
 
bool Empty (void) const
 Is matrix size zero. More...
 
void Resize (int num_elements)
 Resize matrix. More...
 
const double & operator() (int i, int j) const
 Get distance value. More...
 
double & operator() (int i, int j)
 Get distance value. More...
 

Private Attributes

int m_NumElements
 Number of rows/columns. More...
 
vector< double > m_Distances
 Storage for distance values. More...
 
const double m_Diagnol
 Storage for matrix diagnol value. More...
 

Detailed Description

Distance matrix (square, symmetric with zeros on diagnol)

Definition at line 73 of file phytree_calc.hpp.

Constructor & Destructor Documentation

◆ CDistMatrix()

CPhyTreeCalc::CDistMatrix::CDistMatrix ( int  num_elements = 0)

Constructor.

Definition at line 58 of file phytree_calc.cpp.

References m_Distances.

Member Function Documentation

◆ Empty()

bool CPhyTreeCalc::CDistMatrix::Empty ( void  ) const
inline

Is matrix size zero.

Returns
true if the matrx has zero elements and false otherwise

Definition at line 86 of file phytree_calc.hpp.

References GetNumElements().

Referenced by CPhyTreeCalc::x_CalcDistMatrix().

◆ GetNumElements()

int CPhyTreeCalc::CDistMatrix::GetNumElements ( void  ) const
inline

Get number of rows/columns.

Returns
Number of rows/columns

Definition at line 82 of file phytree_calc.hpp.

References m_NumElements.

Referenced by Empty(), s_TestCalc(), s_ValidateMatrix(), and CPhyTreeCalc::x_CalcDistMatrix().

◆ operator()() [1/2]

double & CPhyTreeCalc::CDistMatrix::operator() ( int  i,
int  j 
)

Get distance value.

Parameters
iRow index [in]
jColumn index [in]
Returns
Distance between i-th and j-th element

Definition at line 95 of file phytree_calc.cpp.

References _ASSERT, i, NCBI_THROW, and swap().

◆ operator()() [2/2]

const double & CPhyTreeCalc::CDistMatrix::operator() ( int  i,
int  j 
) const

Get distance value.

Parameters
iRow index [in]
jColumn index [in]
Returns
Distance between i-th and j-th element

Definition at line 74 of file phytree_calc.cpp.

References _ASSERT, i, NCBI_THROW, and swap().

◆ Resize()

void CPhyTreeCalc::CDistMatrix::Resize ( int  num_elements)

Resize matrix.

Parameters
num_elementsNew number of rows/columns [in]

Definition at line 66 of file phytree_calc.cpp.

Referenced by CPhyTreeCalc::x_CalcDistMatrix(), and CPhyTreeCalc::x_CalcDivergenceMatrix().

Member Data Documentation

◆ m_Diagnol

const double CPhyTreeCalc::CDistMatrix::m_Diagnol
private

Storage for matrix diagnol value.

Definition at line 112 of file phytree_calc.hpp.

◆ m_Distances

vector<double> CPhyTreeCalc::CDistMatrix::m_Distances
private

Storage for distance values.

Definition at line 109 of file phytree_calc.hpp.

Referenced by CDistMatrix().

◆ m_NumElements

int CPhyTreeCalc::CDistMatrix::m_NumElements
private

Number of rows/columns.

Definition at line 106 of file phytree_calc.hpp.

Referenced by GetNumElements().


The documentation for this class was generated from the following files:
Modified on Fri Apr 12 17:23:16 2024 by modify_doxy.py rev. 669887