|
bpp-core
2.1.0
|
Functions dealing with matrices. More...
#include <Bpp/Numeric/Matrix/MatrixTools.h>
Public Member Functions | |
| MatrixTools () | |
| ~MatrixTools () | |
Static Public Member Functions | |
| template<class MatrixA , class MatrixO > | |
| static void | copy (const MatrixA &A, MatrixO &O) |
| Copy operation. This function supplies the lack of inheritence of the assigment operator :D . | |
| template<class Matrix > | |
| static void | getId (size_t n, Matrix &O) |
| Get a identity matrix of a given size. | |
| template<class Scalar > | |
| static void | diag (const std::vector< Scalar > &D, Matrix< Scalar > &O) |
| template<class Scalar > | |
| static void | diag (const Scalar x, size_t n, Matrix< Scalar > &O) |
| template<class Scalar > | |
| static void | diag (const Matrix< Scalar > &M, std::vector< Scalar > &O) throw (DimensionException) |
| template<class Matrix , class Scalar > | |
| static void | fill (Matrix &M, Scalar x) |
| Set all elements in M to value x. | |
| template<class Matrix , class Scalar > | |
| static void | scale (Matrix &A, Scalar a, Scalar b=0) |
| Multiply all elements of a matrix by a given value, and add a constant. | |
| template<class Scalar > | |
| static void | mult (const Matrix< Scalar > &A, const Matrix< Scalar > &B, Matrix< Scalar > &O) throw (DimensionException) |
| template<class Scalar > | |
| static void | mult (const Matrix< Scalar > &A, const std::vector< Scalar > &D, const Matrix< Scalar > &B, Matrix< Scalar > &O) throw (DimensionException) |
| Compute A . D . B where D is a diagonal matrix in O(n^3). | |
| template<class Scalar > | |
| static void | mult (const Matrix< Scalar > &A, const std::vector< Scalar > &D, const std::vector< Scalar > &U, const std::vector< Scalar > &L, const Matrix< Scalar > &B, Matrix< Scalar > &O) throw (DimensionException) |
| Compute A . (U+D+L) . B where D is a diagonal matrix, U (resp. L) is a matrix in which the only non-zero terms are on the diagonal that is over (resp. under) the main diagonal, in O(n^3). | |
| template<class MatrixA , class MatrixB > | |
| static void | add (MatrixA &A, const MatrixB &B) throw (DimensionException) |
| Add matrix B to matrix A. | |
| template<class MatrixA , class MatrixB , class Scalar > | |
| static void | add (MatrixA &A, Scalar &x, const MatrixB &B) throw (DimensionException) |
| Add matrix x.B to matrix A. | |
| template<class Matrix > | |
| static void | pow (const Matrix &A, size_t p, Matrix &O) throw (DimensionException) |
| Compute the power of a given matrix. | |
| template<class Scalar > | |
| static void | pow (const Matrix< Scalar > &A, double p, Matrix< Scalar > &O) throw (DimensionException) |
| Compute the power of a given matrix, using eigen value decomposition. | |
| template<class Scalar > | |
| static void | exp (const Matrix< Scalar > &A, Matrix< Scalar > &O) throw (DimensionException) |
| Perform matrix exponentiation using diagonalization. | |
| template<class Matrix , class Scalar > | |
| static void | Taylor (const Matrix &A, size_t p, std::vector< RowMatrix< Scalar > > &vO) throw (DimensionException) |
| Compute a vector of the first powers of a given matrix. | |
| template<class Matrix > | |
| static std::vector< size_t > | whichMax (const Matrix &m) |
| template<class Matrix > | |
| static std::vector< size_t > | whichMin (const Matrix &m) |
| template<class Real > | |
| static Real | max (const Matrix< Real > &m) |
| template<class Real > | |
| static Real | min (const Matrix< Real > &m) |
| template<class Matrix > | |
| static void | print (const Matrix &m, std::ostream &out=std::cout) |
| Print a matrix to a stream. | |
| template<class Matrix > | |
| static void | printForR (const Matrix &m, const std::string &variableName="x", std::ostream &out=std::cout) |
| Print a matrix to a stream, so that it is read by R. | |
| template<class Real > | |
| static void | print (const std::vector< Real > &v, std::ostream &out=std::cout) |
| Print a vector to a stream. | |
| template<class Matrix > | |
| static bool | isSquare (const Matrix &A) |
| template<class Scalar > | |
| static Scalar | inv (const Matrix< Scalar > &A, Matrix< Scalar > &O) throw (DimensionException, ZeroDivisionException) |
| template<class Scalar > | |
| static double | det (const Matrix< Scalar > &A) throw (DimensionException) |
| Get determinant of a square matrix. | |
| template<class MatrixA , class MatrixO > | |
| static void | transpose (const MatrixA &A, MatrixO &O) |
| template<class Scalar > | |
| static void | covar (const Matrix< Scalar > &A, Matrix< Scalar > &O) |
| Compute the variance-covariance matrix of an input matrix. | |
| template<class Scalar > | |
| static void | kroneckerMult (const Matrix< Scalar > &A, const Matrix< Scalar > &B, Matrix< Scalar > &O) |
| Compute the Kronecker product of two row matrices. | |
| template<class Scalar > | |
| static void | hadamardMult (const Matrix< Scalar > &A, const Matrix< Scalar > &B, Matrix< Scalar > &O) |
| Compute the Hadamard product of two row matrices with same dimensions. | |
| template<class Scalar > | |
| static void | hadamardMult (const Matrix< Scalar > &A, const std::vector< Scalar > &B, Matrix< Scalar > &O, bool row=true) |
| Compute the "Hadamard" product of a row matrix and a vector containing weights, according to rows or columns. | |
| template<class Scalar > | |
| static void | kroneckerSum (const Matrix< Scalar > &A, const Matrix< Scalar > &B, Matrix< Scalar > &O) |
| Compute the Kronecker sum of two row matrices. | |
| template<class Scalar > | |
| static void | kroneckerSum (const std::vector< Matrix< Scalar > * > &vA, Matrix< Scalar > &O) |
| Compute the Kronecker sum of n row matrices. | |
| template<class Scalar > | |
| static void | toVVdouble (const Matrix< Scalar > &M, std::vector< std::vector< Scalar > > &vO) |
| Convert to a vector of vector. | |
| template<class Scalar > | |
| static Scalar | sumElements (const Matrix< Scalar > &M) |
| Sum all elements in M. | |
| template<class Scalar > | |
| static Scalar | lap (Matrix< Scalar > &assignCost, std::vector< int > &rowSol, std::vector< int > &colSol, std::vector< Scalar > &u, std::vector< Scalar > &v) throw (Exception) |
| Linear Assignment Problem. | |
Functions dealing with matrices.
Definition at line 56 of file MatrixTools.h.
| bpp::MatrixTools::MatrixTools | ( | ) | [inline] |
Definition at line 59 of file MatrixTools.h.
| bpp::MatrixTools::~MatrixTools | ( | ) | [inline] |
Definition at line 60 of file MatrixTools.h.
| static void bpp::MatrixTools::add | ( | MatrixA & | A, |
| const MatrixB & | B | ||
| ) | throw (DimensionException) [inline, static] |
Add matrix B to matrix A.
| DimensionException | If A and B have note the same size. |
Definition at line 299 of file MatrixTools.h.
Referenced by covar().
| static void bpp::MatrixTools::add | ( | MatrixA & | A, |
| Scalar & | x, | ||
| const MatrixB & | B | ||
| ) | throw (DimensionException) [inline, static] |
Add matrix x.B to matrix A.
| DimensionException | If A and B have note the same size. |
Definition at line 325 of file MatrixTools.h.
| static void bpp::MatrixTools::copy | ( | const MatrixA & | A, |
| MatrixO & | O | ||
| ) | [inline, static] |
Copy operation. This function supplies the lack of inheritence of the assigment operator :D .
| A | [in] Original matrix. |
| O | [out] A copy of the given matrix. |
Definition at line 70 of file MatrixTools.h.
| static void bpp::MatrixTools::covar | ( | const Matrix< Scalar > & | A, |
| Matrix< Scalar > & | O | ||
| ) | [inline, static] |
Compute the variance-covariance matrix of an input matrix.
The input matrix represent a n-sample of a random vector of dimension r. It is assumed to have r rows and n columns. The variance matrix is then computed as
, where
is the mean vector of the sample. the output matrix is a square matrix of size r.
| A | [in] The intput matrix. |
| O | [out] The resulting variance covariance matrix. |
Definition at line 702 of file MatrixTools.h.
References add(), bpp::Matrix< Scalar >::getNumberOfColumns(), bpp::Matrix< Scalar >::getNumberOfRows(), mult(), bpp::Matrix< Scalar >::resize(), scale(), and transpose().
Referenced by bpp::AdaptiveKernelDensityEstimation::init_().
| static double bpp::MatrixTools::det | ( | const Matrix< Scalar > & | A | ) | throw (DimensionException) [inline, static] |
Get determinant of a square matrix.
This implementation is in
and uses the LU decomposition method.
| A | [in] The input matrix. |
| DimensionException | If A is not a square matrix. |
Definition at line 665 of file MatrixTools.h.
References isSquare().
Referenced by bpp::AdaptiveKernelDensityEstimation::init_().
| static void bpp::MatrixTools::diag | ( | const std::vector< Scalar > & | D, |
| Matrix< Scalar > & | O | ||
| ) | [inline, static] |
| D | [in] A vector of diagonal elements. |
| O | [out] A diagonal matrix with diagonal elements taken from a vector. |
Definition at line 105 of file MatrixTools.h.
References bpp::Matrix< Scalar >::resize().
| static void bpp::MatrixTools::diag | ( | const Scalar | x, |
| size_t | n, | ||
| Matrix< Scalar > & | O | ||
| ) | [inline, static] |
| x | [in] A scalar |
| n | [in] the dimension of the output matrix |
| O | [out] A diagonal matrix with diagonal elements equal to x |
Definition at line 121 of file MatrixTools.h.
References bpp::Matrix< Scalar >::resize().
| static void bpp::MatrixTools::diag | ( | const Matrix< Scalar > & | M, |
| std::vector< Scalar > & | O | ||
| ) | throw (DimensionException) [inline, static] |
| M | [in] The matrix. |
| O | [out] The diagonal elements of a square matrix as a vector. |
| DimensionException | If M is not a square matrix. |
Definition at line 136 of file MatrixTools.h.
| static void bpp::MatrixTools::exp | ( | const Matrix< Scalar > & | A, |
| Matrix< Scalar > & | O | ||
| ) | throw (DimensionException) [inline, static] |
Perform matrix exponentiation using diagonalization.
| A | [in] The matrix. |
| O | [out] . |
| DimensionException | If m is not a square matrix. |
Definition at line 415 of file MatrixTools.h.
References bpp::VectorTools::exp(), bpp::EigenValue< Real >::getRealEigenValues(), bpp::EigenValue< Real >::getV(), inv(), and mult().
| static void bpp::MatrixTools::fill | ( | Matrix & | M, |
| Scalar | x | ||
| ) | [inline, static] |
Set all elements in M to value x.
| M | A matrix. |
| x | The value to use. |
Definition at line 151 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), and bpp::Matrix< Scalar >::getNumberOfRows().
| static void bpp::MatrixTools::getId | ( | size_t | n, |
| Matrix & | O | ||
| ) | [inline, static] |
Get a identity matrix of a given size.
| n | the size of the matrix. |
| O | [out] A identity matrix of size n. |
Definition at line 89 of file MatrixTools.h.
References bpp::Matrix< Scalar >::resize().
Referenced by inv().
| static void bpp::MatrixTools::hadamardMult | ( | const Matrix< Scalar > & | A, |
| const Matrix< Scalar > & | B, | ||
| Matrix< Scalar > & | O | ||
| ) | [inline, static] |
Compute the Hadamard product of two row matrices with same dimensions.
| A | [in] The first row matrix. |
| B | [in] The second row matrix. |
| O | [out] The Hadamard product. |
Definition at line 767 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), bpp::Matrix< Scalar >::getNumberOfRows(), and bpp::Matrix< Scalar >::resize().
Referenced by bpp::DualityDiagram::compute_(), and bpp::CorrespondenceAnalysis::CorrespondenceAnalysis().
| static void bpp::MatrixTools::hadamardMult | ( | const Matrix< Scalar > & | A, |
| const std::vector< Scalar > & | B, | ||
| Matrix< Scalar > & | O, | ||
| bool | row = true |
||
| ) | [inline, static] |
Compute the "Hadamard" product of a row matrix and a vector containing weights, according to rows or columns.
| A | [in] The row matrix. |
| B | [in] The vector of row or column weights. |
| O | [out] The 'Hadamard' product. |
| row | Boolean. If row is set to 'true', the vector contains weights for rows. Otherwise the vector contains weights for columns. |
Definition at line 794 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), bpp::Matrix< Scalar >::getNumberOfRows(), and bpp::Matrix< Scalar >::resize().
| static Scalar bpp::MatrixTools::inv | ( | const Matrix< Scalar > & | A, |
| Matrix< Scalar > & | O | ||
| ) | throw (DimensionException, ZeroDivisionException) [inline, static] |
| A | [in] The matrix to inverse. |
| O | [out] The inverse matrix of A. |
| DimensionException | If A is not a square matrix. |
Definition at line 646 of file MatrixTools.h.
References getId(), and isSquare().
| static bool bpp::MatrixTools::isSquare | ( | const Matrix & | A | ) | [inline, static] |
| A | A matrix. |
Definition at line 637 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), and bpp::Matrix< Scalar >::getNumberOfRows().
| static void bpp::MatrixTools::kroneckerMult | ( | const Matrix< Scalar > & | A, |
| const Matrix< Scalar > & | B, | ||
| Matrix< Scalar > & | O | ||
| ) | [inline, static] |
Compute the Kronecker product of two row matrices.
| A | [in] The first row matrix. |
| B | [in] The second row matrix. |
| O | [out] The product . |
Definition at line 736 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), bpp::Matrix< Scalar >::getNumberOfRows(), and bpp::Matrix< Scalar >::resize().
| static void bpp::MatrixTools::kroneckerSum | ( | const Matrix< Scalar > & | A, |
| const Matrix< Scalar > & | B, | ||
| Matrix< Scalar > & | O | ||
| ) | [inline, static] |
Compute the Kronecker sum of two row matrices.
| A | [in] The first row matrix. |
| B | [in] The second row matrix. |
| O | [out] The product . |
Definition at line 832 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), bpp::Matrix< Scalar >::getNumberOfRows(), and bpp::Matrix< Scalar >::resize().
| static void bpp::MatrixTools::kroneckerSum | ( | const std::vector< Matrix< Scalar > * > & | vA, |
| Matrix< Scalar > & | O | ||
| ) | [inline, static] |
Compute the Kronecker sum of n row matrices.
| vA | [in] A vector of row matrices of any size. |
| O | [out] The product . |
Definition at line 862 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), bpp::Matrix< Scalar >::getNumberOfRows(), and bpp::Matrix< Scalar >::resize().
| static Scalar bpp::MatrixTools::lap | ( | Matrix< Scalar > & | assignCost, |
| std::vector< int > & | rowSol, | ||
| std::vector< int > & | colSol, | ||
| std::vector< Scalar > & | u, | ||
| std::vector< Scalar > & | v | ||
| ) | throw (Exception) [inline, static] |
Linear Assignment Problem.
The algorithm coded here is described in * A Shortest Augmenting Path Algorithm for Dense and Sparse Linear Assignment Problems, Computing 38, 325-340, 1987 by R. Jonker and A. Volgenant, University of Amsterdam.
| assignCost | [input/output] Cost matrix |
| rowSol | [output] Column assigned to row in solution |
| colSol | [output] Row assigned to column in solution |
| u | [output] Dual variables, row reduction numbers |
| v | [output] Dual variables, column reduction numbers |
Definition at line 947 of file MatrixTools.h.
References min().
| static Real bpp::MatrixTools::max | ( | const Matrix< Real > & | m | ) | [inline, static] |
| m | The matrix. |
Definition at line 520 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), and bpp::Matrix< Scalar >::getNumberOfRows().
| static Real bpp::MatrixTools::min | ( | const Matrix< Real > & | m | ) | [inline, static] |
| m | The matrix. |
Definition at line 546 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), and bpp::Matrix< Scalar >::getNumberOfRows().
Referenced by lap().
| static void bpp::MatrixTools::mult | ( | const Matrix< Scalar > & | A, |
| const Matrix< Scalar > & | B, | ||
| Matrix< Scalar > & | O | ||
| ) | throw (DimensionException) [inline, static] |
| A | [in] First matrix. |
| B | [in] Second matrix. |
| O | [out] The dot product of two matrices. |
Definition at line 189 of file MatrixTools.h.
Referenced by bpp::DualityDiagram::compute_(), covar(), exp(), bpp::AdaptiveKernelDensityEstimation::init_(), bpp::AdaptiveKernelDensityEstimation::kDensity(), pow(), and Taylor().
| static void bpp::MatrixTools::mult | ( | const Matrix< Scalar > & | A, |
| const std::vector< Scalar > & | D, | ||
| const Matrix< Scalar > & | B, | ||
| Matrix< Scalar > & | O | ||
| ) | throw (DimensionException) [inline, static] |
Compute A . D . B where D is a diagonal matrix in O(n^3).
Since D is a diagonal matrix, this function is more efficient than doing mult(mult(A, diag(D)), B), which involves two 0(n^3) operations.
| A | [in] The first matrix. |
| D | [in] The diagonal matrix (only diagonal elements in a vector) |
| B | [in] The second matrix. |
| O | [out] The result matrix. |
| DimensionException | If matrices have not the appropriate size. |
Definition at line 223 of file MatrixTools.h.
| static void bpp::MatrixTools::mult | ( | const Matrix< Scalar > & | A, |
| const std::vector< Scalar > & | D, | ||
| const std::vector< Scalar > & | U, | ||
| const std::vector< Scalar > & | L, | ||
| const Matrix< Scalar > & | B, | ||
| Matrix< Scalar > & | O | ||
| ) | throw (DimensionException) [inline, static] |
Compute A . (U+D+L) . B where D is a diagonal matrix, U (resp. L) is a matrix in which the only non-zero terms are on the diagonal that is over (resp. under) the main diagonal, in O(n^3).
Since D is a diagonal matrix, this function is more efficient than doing mult(mult(A, diag(D)), B), which involves two 0(n^3) operations.
| A | [in] The first matrix. |
| D | [in] The diagonal matrix (only diagonal elements in a vector) |
| U | [in] The upper diagonal matrix (only upper diagonal elements in a vector) |
| L | [in] The lower diagonal matrix (only lower diagonal elements in a vector) |
| B | [in] The second matrix. |
| O | [out] The result matrix. |
| DimensionException | If matrices have not the appropriate size. |
Definition at line 262 of file MatrixTools.h.
| static void bpp::MatrixTools::pow | ( | const Matrix & | A, |
| size_t | p, | ||
| Matrix & | O | ||
| ) | throw (DimensionException) [inline, static] |
Compute the power of a given matrix.
| A | [in] The matrix. |
| p | The number of multiplications. |
| O | [out] computed recursively: If p = 0, sends the identity matrix. |
| DimensionException | If m is not a square matrix. |
Definition at line 354 of file MatrixTools.h.
| static void bpp::MatrixTools::pow | ( | const Matrix< Scalar > & | A, |
| double | p, | ||
| Matrix< Scalar > & | O | ||
| ) | throw (DimensionException) [inline, static] |
Compute the power of a given matrix, using eigen value decomposition.
| A | [in] The matrix. |
| p | The power of the matrix. |
| O | [out] . If p = 0, sends the identity matrix. |
| DimensionException | If m is not a square matrix. |
Definition at line 393 of file MatrixTools.h.
References bpp::EigenValue< Real >::getRealEigenValues(), bpp::EigenValue< Real >::getV(), inv(), mult(), and bpp::VectorTools::pow().
| static void bpp::MatrixTools::print | ( | const Matrix & | m, |
| std::ostream & | out = std::cout |
||
| ) | [inline, static] |
Print a matrix to a stream.
| m | The matrix to print. |
| out | The stream to use. |
Definition at line 572 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), and bpp::Matrix< Scalar >::getNumberOfRows().
| static void bpp::MatrixTools::print | ( | const std::vector< Real > & | v, |
| std::ostream & | out = std::cout |
||
| ) | [inline, static] |
Print a vector to a stream.
| v | The vector to print. |
| out | The stream to use. |
Definition at line 620 of file MatrixTools.h.
| static void bpp::MatrixTools::printForR | ( | const Matrix & | m, |
| const std::string & | variableName = "x", |
||
| std::ostream & | out = std::cout |
||
| ) | [inline, static] |
Print a matrix to a stream, so that it is read by R.
| m | The matrix to print. |
| variableName | The name of the R variable handeling the matrix |
| out | The stream to use. |
Definition at line 596 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), and bpp::Matrix< Scalar >::getNumberOfRows().
| static void bpp::MatrixTools::scale | ( | Matrix & | A, |
| Scalar | a, | ||
| Scalar | b = 0 |
||
| ) | [inline, static] |
Multiply all elements of a matrix by a given value, and add a constant.
Performs
.
| A | A matrix. |
| a | Multiplicator. |
| b | Constant. |
Definition at line 172 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), and bpp::Matrix< Scalar >::getNumberOfRows().
Referenced by bpp::CorrespondenceAnalysis::CorrespondenceAnalysis(), covar(), bpp::AdaptiveKernelDensityEstimation::init_(), and bpp::AdaptiveKernelDensityEstimation::kDensity().
| static Scalar bpp::MatrixTools::sumElements | ( | const Matrix< Scalar > & | M | ) | [inline, static] |
Sum all elements in M.
| M | A matrix. |
Definition at line 917 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), and bpp::Matrix< Scalar >::getNumberOfRows().
| static void bpp::MatrixTools::Taylor | ( | const Matrix & | A, |
| size_t | p, | ||
| std::vector< RowMatrix< Scalar > > & | vO | ||
| ) | throw (DimensionException) [inline, static] |
Compute a vector of the first powers of a given matrix.
| A | [in] The matrix. |
| p | The number of powers. |
| vO | [out] the vector of the powers (from 0 to p) |
| DimensionException | If m is not a square matrix. |
Definition at line 437 of file MatrixTools.h.
References copy(), bpp::Matrix< Scalar >::getNumberOfColumns(), bpp::Matrix< Scalar >::getNumberOfRows(), and mult().
| static void bpp::MatrixTools::toVVdouble | ( | const Matrix< Scalar > & | M, |
| std::vector< std::vector< Scalar > > & | vO | ||
| ) | [inline, static] |
Convert to a vector of vector.
| M | [in] A matrix object. |
| vO | [out] The output vector of vector (will be resized accordingly). |
Definition at line 896 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), and bpp::Matrix< Scalar >::getNumberOfRows().
| static void bpp::MatrixTools::transpose | ( | const MatrixA & | A, |
| MatrixO & | O | ||
| ) | [inline, static] |
| A | [in] The matrix to transpose. |
| O | [out] The transposition of A. |
Definition at line 677 of file MatrixTools.h.
Referenced by bpp::DualityDiagram::compute_(), and covar().
| static std::vector<size_t> bpp::MatrixTools::whichMax | ( | const Matrix & | m | ) | [inline, static] |
| m | The matrix. |
Definition at line 457 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), and bpp::Matrix< Scalar >::getNumberOfRows().
| static std::vector<size_t> bpp::MatrixTools::whichMin | ( | const Matrix & | m | ) | [inline, static] |
| m | The matrix. |
Definition at line 489 of file MatrixTools.h.
References bpp::Matrix< Scalar >::getNumberOfColumns(), and bpp::Matrix< Scalar >::getNumberOfRows().