NCBI C++ ToolKit
|
Search Toolkit Book for CNcbiMatrix
#include <util/math/matrix.hpp>
Public Types | |
typedef vector< T > | TData |
typedef TData::iterator | iterator |
typedef TData::const_iterator | const_iterator |
Public Member Functions | |
CNcbiMatrix () | |
default ctor More... | |
CNcbiMatrix (size_t r, size_t c, T val=T()) | |
void | Identity (size_t size) |
make this matrix an identity matrix of a given size More... | |
void | Identity () |
make this matrix an identity matrix More... | |
void | Diagonal (size_t size, T val) |
make this matrix a diagonal matrix of a given size, with a given value on the diagonal More... | |
void | Diagonal (T val) |
make this matrix a diagonal matrix, with a given value on the diagonal More... | |
void | Transpose () |
transpose this matrix More... | |
void | Resize (size_t i, size_t j, T val=T()) |
resize this matrix, filling the empty cells with a known value More... | |
void | SwapRows (size_t i, size_t j) |
swap two rows in the matrix More... | |
void | RemoveRow (size_t i) |
remove a given row in the matrix More... | |
void | RemoveCol (size_t i) |
remove a given column in the matrix More... | |
size_t | GetRows () const |
get the number of rows in this matrix More... | |
size_t | GetCols () const |
get the number of columns in this matrix More... | |
TData & | GetData () |
retrieve the data associated with this matrix More... | |
const TData & | GetData () const |
iterator | begin () |
iterators More... | |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
void | Set (T val) |
set all values in the matrix to a known value More... | |
void | Swap (CNcbiMatrix< T > &M) |
swap two matrices efficiently More... | |
const T & | operator[] (size_t i) const |
operator[] for raw data indexing More... | |
T & | operator[] (size_t i) |
const T & | operator() (size_t i, size_t j) const |
operator() for row/column indexing More... | |
T & | operator() (size_t i, size_t j) |
Protected Attributes | |
TData | m_Data |
the data strip we use More... | |
size_t | m_Rows |
size of this matrix More... | |
size_t | m_Cols |
Definition at line 46 of file matrix.hpp.
typedef TData::const_iterator CNcbiMatrix< T >::const_iterator |
Definition at line 51 of file matrix.hpp.
typedef TData::iterator CNcbiMatrix< T >::iterator |
Definition at line 50 of file matrix.hpp.
typedef vector<T> CNcbiMatrix< T >::TData |
Definition at line 49 of file matrix.hpp.
|
inline |
default ctor
Definition at line 281 of file matrix.hpp.
|
inline |
Definition at line 289 of file matrix.hpp.
References CNcbiMatrix< T >::m_Data, r(), and val.
|
inline |
iterators
Definition at line 325 of file matrix.hpp.
Referenced by operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/=(), and CClusterer::SetDistMatrix().
|
inline |
Definition at line 339 of file matrix.hpp.
|
inline |
make this matrix a diagonal matrix of a given size, with a given value on the diagonal
Definition at line 461 of file matrix.hpp.
References i, ncbi::grid::netcache::search::fields::size, T, and val.
|
inline |
|
inline |
Definition at line 332 of file matrix.hpp.
Referenced by operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/=(), and CClusterer::SetDistMatrix().
|
inline |
Definition at line 346 of file matrix.hpp.
|
inline |
get the number of columns in this matrix
Definition at line 305 of file matrix.hpp.
Referenced by BOOST_AUTO_TEST_CASE(), CMatrixScoringMethod::CalculateScores(), CDistanceMatrix::FromMatrix(), CBDB_BlobDeMux::GetCoordinates(), CDistMethods::GrishinDist(), CDistMethods::GrishinGeneralDist(), CDistMethods::JukesCantorDist(), CDistMethods::KimuraDist(), CBDB_BlobDeMuxPersistent::Load(), CBDB_BlobDeMux::NewPlane(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator==(), CDistMethods::PoissonDist(), s_CheckAgainstNullData(), s_CheckDistMatrix(), CBDB_BlobDeMuxPersistent::Save(), CClusterer::SetDistMatrix(), SNcbiMatrix2DoubleMatrix::SNcbiMatrix2DoubleMatrix(), CMultiAligner::x_AddRpsFreqsToCluster(), CMultiAligner::x_AlignMSAs(), CMatrixScoringMethod::x_CalculateConsensusRange(), CMatrixScoringMethod::x_CalculateNonConsensusRange(), CMultiAligner::x_ComputeTree(), and CTreeBuilderJob::x_CreateProjectItems().
|
inline |
retrieve the data associated with this matrix
Definition at line 312 of file matrix.hpp.
Referenced by CDistMethods::AllFinite(), operator*(), operator==(), and CBlastTabularInfo::SetFields().
|
inline |
Definition at line 319 of file matrix.hpp.
|
inline |
get the number of rows in this matrix
Definition at line 298 of file matrix.hpp.
Referenced by BOOST_AUTO_TEST_CASE(), CMatrixScoringMethod::CalculateScores(), CDistMethods::FastMeTree(), CDistanceMatrix::FromMatrix(), CBDB_BlobDeMux::GetCoordinates(), CDistMethods::GrishinDist(), CDistMethods::GrishinGeneralDist(), CSequence::InsertGaps(), CDistMethods::JukesCantorDist(), CDistMethods::KimuraDist(), CBDB_BlobDeMuxPersistent::Load(), CBDB_BlobDeMux::NewPlane(), CDistMethods::NjTree(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator==(), CDistMethods::PoissonDist(), s_CheckAgainstNullData(), s_CheckDistMatrix(), s_FindDistAsMax(), s_FindDistAsMean(), s_FindMaxDistFromElem(), s_FindSumDistFromElem(), CBDB_BlobDeMuxPersistent::Save(), CClusterer::SetDistMatrix(), SNcbiMatrix2DoubleMatrix::SNcbiMatrix2DoubleMatrix(), CMultiAligner::x_AddRpsFreqsToCluster(), CMultiAligner::x_AlignMSAs(), CPhyTreeCalc::x_CalcDistMatrix(), CMatrixScoringMethod::x_CalculateConsensusRange(), CMatrixScoringMethod::x_CalculateNonConsensusRange(), CMultiAligner::x_ComputeTree(), CPhyTreeCalc::x_ComputeTree(), and CMultiAligner::x_MakeClusterResidueFrequencies().
|
inline |
make this matrix an identity matrix
Definition at line 425 of file matrix.hpp.
|
inline |
make this matrix an identity matrix of a given size
Definition at line 437 of file matrix.hpp.
References i, ncbi::grid::netcache::search::fields::size, and T.
|
inline |
Definition at line 380 of file matrix.hpp.
|
inline |
operator() for row/column indexing
Definition at line 370 of file matrix.hpp.
|
inline |
Definition at line 362 of file matrix.hpp.
|
inline |
operator[] for raw data indexing
Definition at line 354 of file matrix.hpp.
|
inline |
remove a given column in the matrix
Definition at line 525 of file matrix.hpp.
|
inline |
remove a given row in the matrix
Definition at line 510 of file matrix.hpp.
|
inline |
resize this matrix, filling the empty cells with a known value
Definition at line 390 of file matrix.hpp.
References i, min(), r(), and val.
Referenced by CDistanceMatrix::AsMatrix(), BOOST_AUTO_TEST_CASE(), CMatrixScoringMethod::CMatrixScoringMethod(), TKmerMethods< TKmerCounts >::ComputeDistMatrix(), CDistances::ComputeMatrix(), CAlignFormatUtil::GetAsciiProteinMatrix(), CClusterer::GetClusterDistMatrix(), CBDB_BlobDeMux::GetCoordinates(), CSequence::InsertGaps(), CBDB_BlobDeMuxPersistent::Load(), CMatrixScoringMethod::Load(), CBDB_BlobDeMux::NewPlane(), CDistMethods::NjTree(), NodeToDistMat(), CSequence::Reset(), s_ReadDistMatrix(), CPhyTreeCalc::x_CalcDistMatrix(), CMultiAligner::x_ComputeTree(), and CPhyTreeCalc::x_ComputeTree().
|
inline |
set all values in the matrix to a known value
Definition at line 417 of file matrix.hpp.
References val.
Referenced by CDistanceMatrix::AsMatrix(), CDistances::ComputeMatrix(), and CSequence::Reset().
|
inline |
swap two matrices efficiently
Definition at line 501 of file matrix.hpp.
Referenced by CSequence::InsertGaps(), and CSequence::PropagateGaps().
|
inline |
|
inline |
|
protected |
Definition at line 121 of file matrix.hpp.
|
protected |
the data strip we use
Definition at line 117 of file matrix.hpp.
Referenced by CNcbiMatrix< T >::CNcbiMatrix().
|
protected |
size of this matrix
Definition at line 120 of file matrix.hpp.