|
bpp-seq
2.1.0
|
A Matrix class to store phylogenetic distances. More...
#include <Bpp/Seq/DistanceMatrix.h>
Inheritance diagram for bpp::DistanceMatrix:
Collaboration diagram for bpp::DistanceMatrix:Public Member Functions | |
| DistanceMatrix (const std::vector< std::string > &names) | |
| Build a new distance matrix with specified names. More... | |
| DistanceMatrix (size_t n) | |
| Build a new distance matrix with specified size. More... | |
| virtual | ~DistanceMatrix () |
| DistanceMatrix (const DistanceMatrix &dist) | |
| DistanceMatrix & | operator= (const DistanceMatrix &dist) |
| void | reset () |
| Reset the distance matrix: all distances are set to 0. More... | |
| size_t | size () const |
| const std::vector< std::string > & | getNames () const |
| const std::string & | getName (size_t i) const throw (IndexOutOfBoundsException) |
| void | setName (size_t i, const std::string &name) throw (IndexOutOfBoundsException) |
| Set the ith name. More... | |
| void | setNames (const std::vector< std::string > &names) throw (DimensionException) |
| Set the names associated to the matrix. More... | |
| size_t | getNameIndex (const std::string &name) const throw (Exception) |
| Get the index of a given name. More... | |
| void | resize (size_t n) |
| Change the dimension of the matrix. More... | |
| virtual const double & | operator() (const std::string &iName, const std::string &jName) const throw (Exception) |
| Access by name. More... | |
| virtual double & | operator() (const std::string &iName, const std::string &jName) throw (Exception) |
| Access by name. More... | |
| virtual const double & | operator() (size_t i, size_t j) const |
| virtual double & | operator() (size_t i, size_t j) |
| RowMatrix * | clone () const |
| size_t | getNumberOfRows () const |
| size_t | getNumberOfColumns () const |
| std::vector< double > | row (size_t i) const |
| std::vector< double > | col (size_t j) const |
| void | resize (size_t nRows, size_t nCols) |
| void | addRow (const std::vector< double > &newRow) |
| virtual bool | equals (const Matrix &m, double threshold=NumConstants::TINY()) |
Private Attributes | |
| std::vector< std::string > | names_ |
A Matrix class to store phylogenetic distances.
Definition at line 55 of file DistanceMatrix.h.
|
inline |
Build a new distance matrix with specified names.
The dimension of the matrix will be equal to the number of names
| names | The names to use. |
Definition at line 71 of file DistanceMatrix.h.
References reset().
|
inline |
Build a new distance matrix with specified size.
Row names will be named 'Taxon 0', 'Taxon 1', and so on.
| n | The size of the matrix. |
Definition at line 84 of file DistanceMatrix.h.
References resize().
|
inlinevirtual |
Definition at line 90 of file DistanceMatrix.h.
|
inline |
Definition at line 92 of file DistanceMatrix.h.
|
inherited |
|
virtualinherited |
Implements bpp::Clonable.
|
virtualinherited |
Implements bpp::Matrix< Scalar >.
|
inline |
| i | Name index. |
| IndexOutOfBoundsException | If i is not a valid index. |
Definition at line 141 of file DistanceMatrix.h.
| size_t DistanceMatrix::getNameIndex | ( | const std::string & | name | ) | const throw (Exception) |
Get the index of a given name.
| name | The name to look for. |
| Exception | If no names are attached to this matrix, or if the name was not found. |
Definition at line 45 of file DistanceMatrix.cpp.
Referenced by operator()(), operator()(), operator()(), and operator()().
|
inline |
Definition at line 134 of file DistanceMatrix.h.
References names_.
|
virtualinherited |
Implements bpp::Matrix< Scalar >.
|
virtualinherited |
Implements bpp::Matrix< Scalar >.
|
inlinevirtual |
Access by name.
| iName | Name 1 (row) |
| jName | Name 2 (column) |
| Exception | if the matrix has no name of if one of the name do not match existing names. |
Definition at line 202 of file DistanceMatrix.h.
References getNameIndex(), and getNameIndex().
Referenced by operator()(), operator=(), and reset().
|
inlinevirtual |
Access by name.
| iName | Name 1 (row) |
| jName | Name 2 (column) |
| Exception | if the matrix has no name of if one of the name do not match existing names. |
Definition at line 217 of file DistanceMatrix.h.
References getNameIndex(), getNameIndex(), and operator()().
|
inlinevirtual |
Implements bpp::Matrix< Scalar >.
Definition at line 224 of file DistanceMatrix.h.
References bpp::RowMatrix< Scalar >::operator()().
|
inlinevirtual |
Implements bpp::Matrix< Scalar >.
Definition at line 228 of file DistanceMatrix.h.
References bpp::RowMatrix< Scalar >::operator()().
|
inline |
Definition at line 94 of file DistanceMatrix.h.
References names_, names_, operator()(), resize(), and size().
|
inline |
Reset the distance matrix: all distances are set to 0.
Definition at line 114 of file DistanceMatrix.h.
References operator()(), and size().
Referenced by DistanceMatrix(), and resize().
|
virtualinherited |
Implements bpp::Matrix< Scalar >.
|
inline |
Change the dimension of the matrix.
| n | the new dimension of the matrix. |
Definition at line 186 of file DistanceMatrix.h.
References names_, names_, reset(), bpp::RowMatrix< Scalar >::resize(), and bpp::TextTools::toString().
Referenced by DistanceMatrix(), and operator=().
|
virtualinherited |
Implements bpp::Matrix< Scalar >.
|
inline |
Set the ith name.
| i | Name index. |
| name | The new name. |
| IndexOutOfBoundsException | If i is not a valid index. |
Definition at line 154 of file DistanceMatrix.h.
|
inline |
Set the names associated to the matrix.
| names | Matrix names. |
| DimensionException | If 'names' have not the same size as the matrix. |
Definition at line 166 of file DistanceMatrix.h.
|
inline |
Definition at line 129 of file DistanceMatrix.h.
References names_.
Referenced by getName(), getName(), operator=(), reset(), setName(), and setName().
|
private |
Definition at line 60 of file DistanceMatrix.h.
Referenced by getName(), getNames(), operator=(), operator=(), resize(), resize(), setName(), setNames(), setNames(), setNames(), and size().