NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Static Private Attributes | List of all members
DistanceMatrix Class Referenceabstract

Search Toolkit Book for DistanceMatrix

#include <algo/structure/cd_utils/cuDistmat.hpp>

+ Inheritance diagram for DistanceMatrix:
+ Collaboration diagram for DistanceMatrix:

Public Types

typedef double TMatType
 

Public Member Functions

 DistanceMatrix ()
 
 DistanceMatrix (const int nrows)
 
bool UseAll () const
 
bool UseAligned () const
 
void SetUseAligned (bool useAligned)
 
double ** GetMatrix ()
 
double GetMaxEntry ()
 
double GetMinEntry ()
 
void EnforceSymmetry ()
 
void ReplaceZeroWithTinyValue (const double tiny=TINY_DISTANCE)
 
void SetData (AlignmentCollection *aligns)
 
string GetDistMethodName ()
 
EDistMethod GetDistMethod ()
 
bool ResetMatrixType (EScoreMatrixType newType)
 
string GetMatrixName ()
 
EScoreMatrixType GetMatrixType ()
 
void SetNTermExt (int ext)
 
void SetCTermExt (int ext)
 
int GetNTermExt ()
 
int GetCTermExt ()
 
virtual bool ComputeMatrix (pProgressFunction pFunc)=0
 
virtual ~DistanceMatrix ()
 
void printMat (bool triangular=true)
 
- Public Member Functions inherited from AMatrix
 AMatrix ()
 
 AMatrix (const int NumRows, const int NumCols)
 
 AMatrix (const AMatrix &Matrix)
 
AMatrix_baseoperator[] (int RowIndex)
 
- Public Member Functions inherited from AMatrix_base
 AMatrix_base ()
 
 AMatrix_base (const int NumRows, const int NumCols)
 
 AMatrix_base (const AMatrix_base &Matrix)
 
AMatrix_baseoperator= (const AMatrix_base &Matrix)
 
 ~AMatrix_base ()
 
void GetSize (int &NumRows, int &NumCols)
 
int GetNumRows () const
 
int GetNumCols () const
 
double FastGet (const int RowIndex, const int ColIndex) const
 
bool IsColSet (int ColIndex) const
 
bool Shrink (const int NumRows, const int NumCols)
 
void ReSize (const int NumRows, const int NumCols)
 
double & operator[] (int ColIndex)
 
double Get (int RowIndex, int ColIndex)
 
void Set (int RowIndex, int ColIndex, double Val)
 
void LinearTransform (double b, double m, bool ignoreDiagonal=false)
 
void GetExtremalEntries (double &max, double &min, bool ignoreDiagonal=false)
 
void DeAllocate ()
 

Static Public Member Functions

static string GetDistMethodName (EDistMethod method)
 
static bool DistMethodUsesScoringMatrix (EDistMethod method)
 
static bool ExtensionsAllowed (EDistMethod method)
 
static bool RequireAlignedBlocks (EDistMethod method)
 
static void readMat (ifstream &ifs, DistanceMatrix &dm, bool triangular)
 
static void writeMat (ofstream &ofs, const DistanceMatrix &dm, bool triangular)
 

Static Public Attributes

static const bool USE_ALIGNED_DEFAULT = true
 
static const int NO_EXTENSION = 0
 

Protected Types

typedef char * CharPtr
 

Protected Member Functions

virtual void initialize ()
 
void writeMat (ostream &os, bool triangular=true) const
 
- Protected Member Functions inherited from AMatrix_base
int Max (int Val1, int Val2)
 

Protected Attributes

std::vector< std::stringm_ConvertedSequences
 
ScoreMatrixm_scoreMatrix
 
EDistMethod m_dMethod
 
bool m_useAligned
 
AlignmentCollectionm_aligns
 
int m_nTermExt
 
int m_cTermExt
 
- Protected Attributes inherited from AMatrix_base
double ** m_Array
 
boolm_ColumnFlags
 
int m_NumRows
 
int m_NumCols
 
int m_RowIndex
 

Static Protected Attributes

static const int OUTPUT_PRECISION = 3
 
static const int INITIAL_SCORE_BOUND = kMax_Int
 

Static Private Attributes

static const double TINY_DISTANCE = 0.0003
 
static const double HUGE_DISTANCE = kMax_Double
 

Detailed Description

Definition at line 78 of file cuDistmat.hpp.

Member Typedef Documentation

◆ CharPtr

typedef char* DistanceMatrix::CharPtr
protected

Definition at line 152 of file cuDistmat.hpp.

◆ TMatType

typedef double DistanceMatrix::TMatType

Definition at line 91 of file cuDistmat.hpp.

Constructor & Destructor Documentation

◆ DistanceMatrix() [1/2]

DistanceMatrix::DistanceMatrix ( )
inline

Definition at line 93 of file cuDistmat.hpp.

References initialize().

◆ DistanceMatrix() [2/2]

DistanceMatrix::DistanceMatrix ( const int  nrows)
inline

Definition at line 104 of file cuDistmat.hpp.

References initialize().

◆ ~DistanceMatrix()

DistanceMatrix::~DistanceMatrix ( )
virtual

Definition at line 82 of file cuDistmat.cpp.

References m_scoreMatrix.

Member Function Documentation

◆ ComputeMatrix()

virtual bool DistanceMatrix::ComputeMatrix ( pProgressFunction  pFunc)
pure virtual

◆ DistMethodUsesScoringMatrix()

bool DistanceMatrix::DistMethodUsesScoringMatrix ( EDistMethod  method)
static

Definition at line 57 of file cuDistmat.cpp.

References ePercentIdentity, and ePercIdWithKimura.

Referenced by SeqTreeAPI::layoutSeqTree().

◆ EnforceSymmetry()

void DistanceMatrix::EnforceSymmetry ( )

◆ ExtensionsAllowed()

bool DistanceMatrix::ExtensionsAllowed ( EDistMethod  method)
static

Definition at line 62 of file cuDistmat.cpp.

References eScoreAlignedOptimal, and eScoreBlastFoot.

◆ GetCTermExt()

int DistanceMatrix::GetCTermExt ( )

Definition at line 165 of file cuDistmat.cpp.

References m_cTermExt.

Referenced by DM_BlastScore::CalcPairwiseScoresOnTheFly().

◆ GetDistMethod()

EDistMethod DistanceMatrix::GetDistMethod ( )
inline

Definition at line 128 of file cuDistmat.hpp.

References m_dMethod.

◆ GetDistMethodName() [1/2]

string DistanceMatrix::GetDistMethodName ( )
inline

Definition at line 127 of file cuDistmat.hpp.

References DISTANCE_METHOD_NAMES, and m_dMethod.

Referenced by SeqTreeAPI::layoutSeqTree().

◆ GetDistMethodName() [2/2]

string DistanceMatrix::GetDistMethodName ( EDistMethod  method)
static

Definition at line 52 of file cuDistmat.cpp.

References DISTANCE_METHOD_NAMES.

◆ GetMatrix()

double** DistanceMatrix::GetMatrix ( void  )
inline

Definition at line 112 of file cuDistmat.hpp.

References AMatrix_base::m_Array.

◆ GetMatrixName()

string DistanceMatrix::GetMatrixName ( void  )

◆ GetMatrixType()

EScoreMatrixType DistanceMatrix::GetMatrixType ( )

Definition at line 178 of file cuDistmat.cpp.

References eInvalidMatrixType, ScoreMatrix::GetType(), and m_scoreMatrix.

◆ GetMaxEntry()

double DistanceMatrix::GetMaxEntry ( )

◆ GetMinEntry()

double DistanceMatrix::GetMinEntry ( )

Definition at line 118 of file cuDistmat.cpp.

References AMatrix_base::GetExtremalEntries().

◆ GetNTermExt()

int DistanceMatrix::GetNTermExt ( )

Definition at line 158 of file cuDistmat.cpp.

References m_nTermExt.

Referenced by DM_BlastScore::CalcPairwiseScoresOnTheFly().

◆ initialize()

void DistanceMatrix::initialize ( )
protectedvirtual

◆ printMat()

void DistanceMatrix::printMat ( bool  triangular = true)

Definition at line 258 of file cuDistmat.cpp.

References writeMat().

◆ readMat()

void DistanceMatrix::readMat ( ifstream &  ifs,
DistanceMatrix dm,
bool  triangular 
)
static

Definition at line 201 of file cuDistmat.cpp.

References exit(), AMatrix_base::ReSize(), row, and rapidjson::value.

◆ ReplaceZeroWithTinyValue()

void DistanceMatrix::ReplaceZeroWithTinyValue ( const double  tiny = TINY_DISTANCE)

Definition at line 139 of file cuDistmat.cpp.

References AMatrix_base::GetNumRows(), i, and AMatrix_base::m_Array.

◆ RequireAlignedBlocks()

bool DistanceMatrix::RequireAlignedBlocks ( EDistMethod  method)
static

Definition at line 69 of file cuDistmat.cpp.

References ePercentIdentity, ePercIdWithKimura, eScoreAligned, and eScoreAlignedOptimal.

◆ ResetMatrixType()

bool DistanceMatrix::ResetMatrixType ( EScoreMatrixType  newType)

Definition at line 187 of file cuDistmat.cpp.

References m_scoreMatrix, NULL, and true.

◆ SetCTermExt()

void DistanceMatrix::SetCTermExt ( int  ext)

Definition at line 161 of file cuDistmat.cpp.

References m_cTermExt, and m_useAligned.

Referenced by TreeFactory::GetMatrix().

◆ SetData()

void DistanceMatrix::SetData ( AlignmentCollection aligns)

◆ SetNTermExt()

void DistanceMatrix::SetNTermExt ( int  ext)

Definition at line 154 of file cuDistmat.cpp.

References m_nTermExt, and m_useAligned.

Referenced by TreeFactory::GetMatrix().

◆ SetUseAligned()

void DistanceMatrix::SetUseAligned ( bool  useAligned)
inline

Definition at line 110 of file cuDistmat.hpp.

References m_useAligned.

◆ UseAligned()

bool DistanceMatrix::UseAligned ( ) const
inline

Definition at line 109 of file cuDistmat.hpp.

References m_useAligned.

◆ UseAll()

bool DistanceMatrix::UseAll ( ) const
inline

Definition at line 108 of file cuDistmat.hpp.

References m_useAligned.

◆ writeMat() [1/2]

void DistanceMatrix::writeMat ( ofstream &  ofs,
const DistanceMatrix dm,
bool  triangular 
)
static

Definition at line 254 of file cuDistmat.cpp.

References writeMat().

Referenced by printMat(), and writeMat().

◆ writeMat() [2/2]

void DistanceMatrix::writeMat ( ostream &  os,
bool  triangular = true 
) const
protected

Member Data Documentation

◆ HUGE_DISTANCE

const double DistanceMatrix::HUGE_DISTANCE = kMax_Double
staticprivate

Definition at line 81 of file cuDistmat.hpp.

◆ INITIAL_SCORE_BOUND

const int DistanceMatrix::INITIAL_SCORE_BOUND = kMax_Int
staticprotected

◆ m_aligns

AlignmentCollection* DistanceMatrix::m_aligns
protected

◆ m_ConvertedSequences

std::vector< std::string > DistanceMatrix::m_ConvertedSequences
protected

◆ m_cTermExt

int DistanceMatrix::m_cTermExt
protected

◆ m_dMethod

EDistMethod DistanceMatrix::m_dMethod
protected

◆ m_nTermExt

int DistanceMatrix::m_nTermExt
protected

◆ m_scoreMatrix

ScoreMatrix* DistanceMatrix::m_scoreMatrix
protected

◆ m_useAligned

bool DistanceMatrix::m_useAligned
protected

◆ NO_EXTENSION

const int DistanceMatrix::NO_EXTENSION = 0
static

Definition at line 85 of file cuDistmat.hpp.

Referenced by initialize().

◆ OUTPUT_PRECISION

const int DistanceMatrix::OUTPUT_PRECISION = 3
staticprotected

Definition at line 150 of file cuDistmat.hpp.

Referenced by writeMat().

◆ TINY_DISTANCE

const double DistanceMatrix::TINY_DISTANCE = 0.0003
staticprivate

Definition at line 80 of file cuDistmat.hpp.

◆ USE_ALIGNED_DEFAULT

const bool DistanceMatrix::USE_ALIGNED_DEFAULT = true
static

Definition at line 84 of file cuDistmat.hpp.

Referenced by initialize().


The documentation for this class was generated from the following files:
Modified on Mon May 27 04:37:23 2024 by modify_doxy.py rev. 669887