bpp-core  2.1.0
bpp::RowMatrix< Scalar > Class Template Reference

Matrix storage by row. More...

#include <Bpp/Numeric/Matrix/Matrix.h>

+ Inheritance diagram for bpp::RowMatrix< Scalar >:
+ Collaboration diagram for bpp::RowMatrix< Scalar >:

List of all members.

Public Member Functions

 RowMatrix ()
 RowMatrix (size_t nRow, size_t nCol)
 RowMatrix (const Matrix< Scalar > &m)
RowMatrixoperator= (const Matrix< Scalar > &m)
virtual ~RowMatrix ()
RowMatrixclone () const
 Create a copy of this object and send a pointer to it.
const Scalar & operator() (size_t i, size_t j) const
Scalar & operator() (size_t i, size_t j)
size_t getNumberOfRows () const
size_t getNumberOfColumns () const
std::vector< Scalar > row (size_t i) const
std::vector< Scalar > col (size_t j) const
void resize (size_t nRows, size_t nCols)
 Resize the matrix.
void addRow (const std::vector< Scalar > &newRow) throw (DimensionException)
virtual bool equals (const Matrix &m, double threshold=NumConstants::TINY())

Private Attributes

std::vector< std::vector
< Scalar > > 
m_

Detailed Description

template<class Scalar>
class bpp::RowMatrix< Scalar >

Matrix storage by row.

This matrix is a vector of vector of Scalar. Row access is in $O(1)$ while column access is in $O(nRow)$.

Definition at line 126 of file Matrix.h.


Constructor & Destructor Documentation

template<class Scalar>
bpp::RowMatrix< Scalar >::RowMatrix ( ) [inline]

Definition at line 133 of file Matrix.h.

Referenced by bpp::RowMatrix< Real >::clone().

template<class Scalar>
bpp::RowMatrix< Scalar >::RowMatrix ( size_t  nRow,
size_t  nCol 
) [inline]

Definition at line 135 of file Matrix.h.

template<class Scalar>
bpp::RowMatrix< Scalar >::RowMatrix ( const Matrix< Scalar > &  m) [inline]

Definition at line 143 of file Matrix.h.

template<class Scalar>
virtual bpp::RowMatrix< Scalar >::~RowMatrix ( ) [inline, virtual]

Definition at line 173 of file Matrix.h.


Member Function Documentation

template<class Scalar>
void bpp::RowMatrix< Scalar >::addRow ( const std::vector< Scalar > &  newRow) throw (DimensionException) [inline]

Definition at line 209 of file Matrix.h.

template<class Scalar>
RowMatrix* bpp::RowMatrix< Scalar >::clone ( ) const [inline, virtual]

Create a copy of this object and send a pointer to it.

Returns:
A pointer toward the copy object.

Implements bpp::Clonable.

Definition at line 176 of file Matrix.h.

template<class Scalar>
std::vector<Scalar> bpp::RowMatrix< Scalar >::col ( size_t  j) const [inline, virtual]
Returns:
the column at position j as a vector.
Parameters:
jThe index of the column.

Implements bpp::Matrix< Scalar >.

Definition at line 193 of file Matrix.h.

template<class Scalar>
virtual bool bpp::Matrix< Scalar >::equals ( const Matrix< Scalar > &  m,
double  threshold = NumConstants::TINY() 
) [inline, virtual, inherited]

Definition at line 79 of file Matrix.h.

template<class Scalar>
size_t bpp::RowMatrix< Scalar >::getNumberOfColumns ( ) const [inline, virtual]
Returns:
The number of columns.

Implements bpp::Matrix< Scalar >.

Definition at line 184 of file Matrix.h.

Referenced by bpp::RowMatrix< Real >::addRow(), and bpp::RowMatrix< Real >::row().

template<class Scalar>
size_t bpp::RowMatrix< Scalar >::getNumberOfRows ( ) const [inline, virtual]
Returns:
The number of rows.

Implements bpp::Matrix< Scalar >.

Definition at line 182 of file Matrix.h.

Referenced by bpp::RowMatrix< Real >::col().

template<class Scalar>
const Scalar& bpp::RowMatrix< Scalar >::operator() ( size_t  i,
size_t  j 
) const [inline, virtual]
Returns:
$m_{i,j}$.
Parameters:
irow index.
jcolumn index.

Implements bpp::Matrix< Scalar >.

Definition at line 178 of file Matrix.h.

Referenced by bpp::RowMatrix< Real >::col(), and bpp::RowMatrix< Real >::row().

template<class Scalar>
Scalar& bpp::RowMatrix< Scalar >::operator() ( size_t  i,
size_t  j 
) [inline, virtual]
Returns:
$m_{i,j}$.
Parameters:
irow index.
jcolumn index.

Implements bpp::Matrix< Scalar >.

Definition at line 180 of file Matrix.h.

template<class Scalar>
RowMatrix& bpp::RowMatrix< Scalar >::operator= ( const Matrix< Scalar > &  m) [inline]

Definition at line 157 of file Matrix.h.

template<class Scalar>
void bpp::RowMatrix< Scalar >::resize ( size_t  nRows,
size_t  nCols 
) [inline, virtual]

Resize the matrix.

Parameters:
nRowsThe new number of rows.
nColsThe new number of columns.

Implements bpp::Matrix< Scalar >.

Definition at line 200 of file Matrix.h.

Referenced by bpp::DualityDiagram::compute_(), bpp::EigenValue< Real >::EigenValue(), and bpp::AbstractNumericalDerivative::setParametersToDerivate().

template<class Scalar>
std::vector<Scalar> bpp::RowMatrix< Scalar >::row ( size_t  i) const [inline, virtual]
Returns:
the row at position i as a vector.
Parameters:
iThe index of the row.

Implements bpp::Matrix< Scalar >.

Definition at line 186 of file Matrix.h.


Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends