plll  1.0
plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject > Class Template Reference

Represents a matrix with coefficients in T. More...

#include <matrix.hpp>

Inheritance diagram for plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >:
plll::linalg::implementation::row_count_storage< Rows > plll::linalg::implementation::col_count_storage< Cols >

Classes

class  ColEnumerator
 An enumerator for a matrix' column. More...
 
class  ColsEnumerator
 Enumerates over all columns. For every column, a ColsEnumerator::ColEnumerator object is returned which allows to enumerate over that column. More...
 
class  ConstColEnumerator
 An enumerator for a matrix' column. More...
 
class  ConstColsEnumerator
 Enumerates over all columns. For every column, a ConstColsEnumerator::ColEnumerator object is returned which allows to enumerate over that column. More...
 
class  ConstEnumerator
 An enumerator for matrix elements. More...
 
class  ConstRowsEnumerator
 Enumerates over all rows. For every row, a ConstRowsEnumerator::RowEnumerator object is returned which allows to enumerate over that row. More...
 
class  Enumerator
 An enumerator for matrix elements. More...
 
class  GetCoeffSteps_Type
 Allows to retrieve a coefficient of the matrix in two steps. More...
 
class  RowsEnumerator
 Enumerates over all rows. For every row, a RowsEnumerator::RowEnumerator object is returned which allows to enumerate over that row. More...
 

Public Types

typedef
StorageTraits::constpointer_type 
data_pointer_type
 Return type for the method data() const.
 
typedef
StorageTraits::constref_type 
data_ref_type
 Return type for the method data(size_type) const.
 

Public Member Functions

template<typename MatrixType >
void assign_resize (const MatrixType &mat)
 Resizes the matrix to fit the format of mat and assigns the contents of mat to the matrix. More...
 
 base_matrix ()
 Creates a new matrix. The dimensions are set to zero if no compile-time dimensions were specified. The elements are default-constructed.
 
 base_matrix (const base_matrix< T, Rows, Cols, StorageTraits, MathObject > &mat)
 Creates a copy of the matrix mat. More...
 
template<int Rs, int Cs, bool MO>
 base_matrix (const base_matrix< T, Rs, Cs, StorageTraits, MO > &mat)
 Creates a copy of the matrix mat. More...
 
template<typename S , int Rs, int Cs, typename ST , bool MO>
 base_matrix (const base_matrix< S, Rs, Cs, ST, MO > &mat)
 Creates a copy of the matrix mat. More...
 
template<template< typename > class Op, typename Data >
 base_matrix (const implementation::expressions::expr< Op, Data > &mat)
 Creates a copy of the matrix mat. More...
 
 base_matrix (size_type entries)
 Creates a vector with entries entries. Its coefficients are default-constructed. More...
 
 base_matrix (int entries)
 Creates a vector with entries entries. Its coefficients are default-constructed. More...
 
template<typename S , bool def>
 base_matrix (size_type entries, const implementation::Initialize_Impl< S, def > &i)
 Creates a vector with entries entries. Its coefficients are copy-constructed from i.ref(). More...
 
 base_matrix (size_type rows, size_type cols)
 Creates a matrix with rows times cols entries. Its coefficients are default-constructed. More...
 
template<typename S , bool def>
 base_matrix (size_type rows, size_type cols, const implementation::Initialize_Impl< S, def > &i)
 Creates a matrix with rows times cols entries. Its coefficients are copy-constructed from i.ref(). More...
 
template<unsigned SRows, unsigned SCols>
implementation::expressions::expr
< implementation::expressions::sub
< SRows, SCols >::template
operation_generic,
implementation::expressions::MatrixWrapper
< base_matrix< T, Rows, Cols,
StorageTraits, MathObject > > > 
block (size_type r_ofs, size_type c_ofs)
 Returns a submatrix of SRows rows and SCols columns starting at (r_ofs, c_ofs). More...
 
template<unsigned SRows, unsigned SCols>
implementation::expressions::expr
< implementation::expressions::sub
< SRows, SCols >::template
operation_generic,
implementation::expressions::ConstMatrixWrapper
< base_matrix< T, Rows, Cols,
StorageTraits, MathObject > > > 
block (size_type r_ofs, size_type c_ofs) const
 Returns a submatrix of SRows rows and SCols columns starting at (r_ofs, c_ofs). More...
 
implementation::expressions::expr
< implementation::expressions::sub
< Flexible, Flexible >
::template operation_generic,
implementation::expressions::MatrixWrapper
< base_matrix< T, Rows, Cols,
StorageTraits, MathObject > > > 
block (size_type r_ofs, size_type c_ofs, size_type rows, size_type cols)
 Returns a submatrix of rows rows and cols columns starting at (r_ofs, c_ofs). More...
 
implementation::expressions::expr
< implementation::expressions::sub
< Flexible, Flexible >
::template operation_generic,
implementation::expressions::ConstMatrixWrapper
< base_matrix< T, Rows, Cols,
StorageTraits, MathObject > > > 
block (size_type r_ofs, size_type c_ofs, size_type rows, size_type cols) const
 Returns a submatrix of rows rows and cols columns starting at (r_ofs, c_ofs). More...
 
implementation::expressions::expr
< implementation::expressions::sub_1d
< Rows >::template
operation_col,
implementation::expressions::MatrixWrapper
< base_matrix< T, Rows, Cols,
StorageTraits, MathObject > > > 
col (size_type col_index)
 Returns the col_index-th column of this matrix. More...
 
implementation::expressions::expr
< implementation::expressions::sub_1d
< Rows >::template
operation_col,
implementation::expressions::ConstMatrixWrapper
< base_matrix< T, Rows, Cols,
StorageTraits, MathObject > > > 
col (size_type col_index) const
 Returns the col_index-th column of this matrix. More...
 
size_type cols () const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns the number of columns of the matrix. More...
 
StorageTraits::constpointer_type data () const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns a pointer to the raw data of the matrix. More...
 
StorageTraits::pointer_type data () PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns a pointer to the raw data of the matrix. More...
 
StorageTraits::constref_type data (size_type i) const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns a (raw) reference to the i-th entry. More...
 
StorageTraits::ref_type data (size_type i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns a (raw) reference to the i-th entry. More...
 
Enumerator enumerate () PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Enumerates all entries of the current matrix. More...
 
ConstEnumerator enumerate () const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Enumerates all entries of the current matrix. More...
 
ColEnumerator enumerate_col (size_type col) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Enumerates all entries of the given column. More...
 
ConstColEnumerator enumerate_col (size_type col) const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Enumerates all entries of the given column. More...
 
ColsEnumerator enumerate_cols () PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Enumerates all columns. For each column, a column enumerator is given. More...
 
ConstColsEnumerator enumerate_cols () const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Enumerates all columns. For each column, a column enumerator is given. More...
 
RowEnumerator enumerate_row (size_type row) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Enumerates all entries of the given row. More...
 
ConstRowEnumerator enumerate_row (size_type row) const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Enumerates all entries of the given row. More...
 
RowsEnumerator enumerate_rows () PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Enumerates all rows. For each row, a row enumerator is given. More...
 
ConstRowsEnumerator enumerate_rows () const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Enumerates all rows. For each row, a row enumerator is given. More...
 
template<typename ResultType >
void get_coeff (ResultType &result, size_type i, size_type j) const PLLL_INTERNAL_NOTHROW_POSTFIX_CONDITIONAL(noexcept(result=d_data[i *implementation::col_count_storage< Cols >::cols()+j]))
 Retrieves the coefficient (i, j) and stores its value into result. More...
 
bool get_coeff_alwayszero () const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Queries whether all coefficients are definitely zero. More...
 
GetCoeffSteps_Type get_coeff_steps (size_type i, size_type j) const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns a object of type GetCoeffSteps_Type which constructs the coefficient at (i, j). More...
 
bool involves_this_matrix (const base_matrix< T, Rows, Cols, StorageTraits, MathObject > &A) const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests whether this matrix (or expression) involves A. More...
 
template<typename MatrixType >
bool involves_this_matrix (const MatrixType &A) const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests whether this matrix (or expression) involves A. More...
 
template<typename MatrixType >
void move_resize (const MatrixType &mat)
 Resizes the matrix to fit the format of mat and moves the contents of mat to the matrix. More...
 
StorageTraits::constref_type operator() (size_type i, size_type j) const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Retrieves and returns the coefficient (i, j). More...
 
StorageTraits::ref_type operator() (size_type i, size_type j) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Retrieves and returns the coefficient (i, j). More...
 
base_matrix< T, Rows, Cols,
StorageTraits, MathObject > & 
operator= (const base_matrix< T, Rows, Cols, StorageTraits, MathObject > &m)
 Copies the contents of the matrix m into *this. More...
 
template<typename T_ , int Rows_, int Cols_, typename StorageTraits_ , bool MathObject_>
base_matrix< T, Rows, Cols,
StorageTraits, MathObject > & 
operator= (const base_matrix< T_, Rows_, Cols_, StorageTraits_, MathObject_ > &m)
 Copies the contents of the matrix m into *this. More...
 
template<template< typename > class Op, typename Data >
base_matrix< T, Rows, Cols,
StorageTraits, MathObject > & 
operator= (const implementation::expressions::expr< Op, Data > &m)
 Copies the contents of the matrix m into *this. More...
 
StorageTraits::constref_type operator[] (size_type i) const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Retrieves and returns the i-th entry of the vector. More...
 
StorageTraits::ref_type operator[] (size_type i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Retrieves and returns the i-th entry of the vector. More...
 
void resize (size_type new_size)
 Resizes the vector to new_size entries. If new_size exceeds the current size, new elements are default-constructed. More...
 
template<typename S , bool def>
void resize (size_type new_size, const implementation::Initialize_Impl< S, def > &init)
 Resizes the vector to new_size entries. If new_size exceeds the current size, new elements are copy-constructed from init.ref(). More...
 
void resize (size_type new_rows, size_type new_cols)
 Resizes the matrix to new_rows times new_cols entries. If the new matrix has entries which cannot be taken from the old matrix, they are default-constructed. More...
 
template<typename S , bool def>
void resize (size_type new_rows, size_type new_cols, const implementation::Initialize_Impl< S, def > &init)
 Resizes the matrix to new_rows times new_cols entries. If the new matrix has entries which cannot be taken from the old matrix, they are copy-constructed from init.ref(). More...
 
implementation::expressions::expr
< implementation::expressions::sub_1d
< Cols >::template
operation_row,
implementation::expressions::MatrixWrapper
< base_matrix< T, Rows, Cols,
StorageTraits, MathObject > > > 
row (size_type row_index)
 Returns the row_index-th row of this matrix. More...
 
implementation::expressions::expr
< implementation::expressions::sub_1d
< Cols >::template
operation_row,
implementation::expressions::ConstMatrixWrapper
< base_matrix< T, Rows, Cols,
StorageTraits, MathObject > > > 
row (size_type row_index) const
 Returns the row_index-th row of this matrix. More...
 
size_type rows () const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns the number of rows of the matrix. More...
 
size_type size () const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns the number of entries of the matrix. This equals rows() * cols(). More...
 
template<typename MatrixType >
void swap (MatrixType &B)
 Swaps the contents of this matrix with the matrix B. More...
 
template<typename MatrixType >
bool test_involvement (const MatrixType &A) const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 For the underlying matrices U of the current expression, calls A.involves_this_matrix(U). Returns true if any of these returns true. More...
 
implementation::expressions::expr
< implementation::expressions::transpose,
implementation::expressions::MatrixWrapper
< base_matrix< T, Rows, Cols,
StorageTraits, MathObject > > > 
transpose () PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns the transpose of this matrix. More...
 
implementation::expressions::expr
< implementation::expressions::transpose,
implementation::expressions::ConstMatrixWrapper
< base_matrix< T, Rows, Cols,
StorageTraits, MathObject > > > 
transpose () const PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns the transpose of this matrix. More...
 
 ~base_matrix () PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Releases the memory allocated for the matrix.
 

Detailed Description

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
class plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >

Represents a matrix with coefficients in T.

The main template. Stores a matrix with coefficients in T with possible compile-time row and column numbers enforcements (controlled with Rows and Cols) and storage management (StorageTraits). Can store both math objects and non-math objects (via parameter MathObject).

Template Parameters
TThe coefficient type.
RowsIf set to plll::linalg::Flexible, allows to flexibly choose and change the number of rows. Otherwise, enforces fixed number of rows during compile time. Default value is plll::linalg::Flexible.
ColsIf set to plll::linalg::Flexible, allows to flexibly choose and change the number of columns. Otherwise, enforces fixed number of columns during compile time. Default value is plll::linalg::Flexible.
StorageTraitsAllows to determine how the matrix's contents are stored. The default value is plll::linalg::storage_traits<T>, which should usually not be changed.
MathObjectAllows to determine whether the matrix is a math object (true) and thus operations can be performed on it, or whether it is a non-math object (false) which allows no operations except reading and storing coefficients and resizing.

There exists more specialized versions of base_matrix<> for row and colum vectors (plll::linalg::base_rowvector<> and plll::linalg::base_colvector<>), as well as for math objects (plll::linalg::math_matrix<>, plll::linalg::math_rowvector<> and plll::linalg::math_colvector<>).

Definition at line 165 of file matrix.hpp.

Constructor & Destructor Documentation

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::base_matrix ( const base_matrix< T, Rows, Cols, StorageTraits, MathObject > &  mat)
inline

Creates a copy of the matrix mat.

Parameters
matThe matrix to copy from.

Definition at line 1162 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<int Rs, int Cs, bool MO>
plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::base_matrix ( const base_matrix< T, Rs, Cs, StorageTraits, MO > &  mat)
inline

Creates a copy of the matrix mat.

Parameters
matThe matrix to copy from.

Definition at line 1176 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<typename S , int Rs, int Cs, typename ST , bool MO>
plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::base_matrix ( const base_matrix< S, Rs, Cs, ST, MO > &  mat)
inline

Creates a copy of the matrix mat.

Parameters
matThe matrix to copy from.

Definition at line 1232 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<template< typename > class Op, typename Data >
plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::base_matrix ( const implementation::expressions::expr< Op, Data > &  mat)
inline

Creates a copy of the matrix mat.

Parameters
matThe matrix to copy from.

Definition at line 1270 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::base_matrix ( size_type  entries)
inline

Creates a vector with entries entries. Its coefficients are default-constructed.

Note that the number of rows or columns must be forced to be 1 during compile time; otherwise, this constructor will not compile.

Parameters
entriesThe number of entries.

Definition at line 1318 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::base_matrix ( int  entries)
inline

Creates a vector with entries entries. Its coefficients are default-constructed.

Note that the number of rows or columns must be forced to be 1 during compile time; otherwise, this constructor will not compile.

Parameters
entriesThe number of entries.

Definition at line 1336 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<typename S , bool def>
plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::base_matrix ( size_type  entries,
const implementation::Initialize_Impl< S, def > &  i 
)
inline

Creates a vector with entries entries. Its coefficients are copy-constructed from i.ref().

Note that the number of rows or columns must be forced to be 1 during compile time; otherwise, this constructor will not compile.

Parameters
entriesThe number of entries.
iThe element from which to copy-construct the coefficients.

Definition at line 1356 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::base_matrix ( size_type  rows,
size_type  cols 
)
inline

Creates a matrix with rows times cols entries. Its coefficients are default-constructed.

Parameters
rowsThe number of rows of the matrix.
colsThe number of columns of the matrix.

Definition at line 1372 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<typename S , bool def>
plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::base_matrix ( size_type  rows,
size_type  cols,
const implementation::Initialize_Impl< S, def > &  i 
)
inline

Creates a matrix with rows times cols entries. Its coefficients are copy-constructed from i.ref().

Parameters
rowsThe number of rows of the matrix.
colsThe number of columns of the matrix.
iThe element from which to copy-construct the coefficients.

Definition at line 1391 of file matrix.hpp.

Member Function Documentation

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<typename MatrixType >
void plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::assign_resize ( const MatrixType &  mat)
inline

Resizes the matrix to fit the format of mat and assigns the contents of mat to the matrix.

Note that if mat is an expression involving *this, there will be no problems as the old elements will only be released after the new elements are created.

Parameters
matThe matrix to copy from.

Definition at line 2146 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<unsigned SRows, unsigned SCols>
implementation::expressions::expr<implementation::expressions::sub<SRows, SCols>::template operation_generic, implementation::expressions::MatrixWrapper<base_matrix<T, Rows, Cols, StorageTraits, MathObject> > > plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::block ( size_type  r_ofs,
size_type  c_ofs 
)
inline

Returns a submatrix of SRows rows and SCols columns starting at (r_ofs, c_ofs).

Parameters
r_ofsThe row to begin the submatrix in.
c_ofsThe column to begin the submatrix in.
Returns
An object representing a submatrix of *this of a number of rows and columns fixed at compile-time.

Definition at line 1764 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<unsigned SRows, unsigned SCols>
implementation::expressions::expr<implementation::expressions::sub<SRows, SCols>::template operation_generic, implementation::expressions::ConstMatrixWrapper<base_matrix<T, Rows, Cols, StorageTraits, MathObject> > > plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::block ( size_type  r_ofs,
size_type  c_ofs 
) const
inline

Returns a submatrix of SRows rows and SCols columns starting at (r_ofs, c_ofs).

The number of rows and columns must be specified at compile-time.

Parameters
r_ofsThe row to begin the submatrix in.
c_ofsThe column to begin the submatrix in.
Returns
An object representing a submatrix of *this of a number of rows and columns fixed at compile-time.

Definition at line 1788 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
implementation::expressions::expr<implementation::expressions::sub<Flexible, Flexible>::template operation_generic, implementation::expressions::MatrixWrapper<base_matrix<T, Rows, Cols, StorageTraits, MathObject> > > plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::block ( size_type  r_ofs,
size_type  c_ofs,
size_type  rows,
size_type  cols 
)
inline

Returns a submatrix of rows rows and cols columns starting at (r_ofs, c_ofs).

The number of rows and columns must be specified at runtime.

Parameters
r_ofsThe row to begin the submatrix in.
c_ofsThe column to begin the submatrix in.
rowsThe number of rows of the submatrix.
colsThe number of columns of the submatrix.
Returns
An object representing a submatrix of *this.

Definition at line 1812 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
implementation::expressions::expr<implementation::expressions::sub<Flexible, Flexible>::template operation_generic, implementation::expressions::ConstMatrixWrapper<base_matrix<T, Rows, Cols, StorageTraits, MathObject> > > plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::block ( size_type  r_ofs,
size_type  c_ofs,
size_type  rows,
size_type  cols 
) const
inline

Returns a submatrix of rows rows and cols columns starting at (r_ofs, c_ofs).

The number of rows and columns must be specified at runtime.

Parameters
r_ofsThe row to begin the submatrix in.
c_ofsThe column to begin the submatrix in.
rowsThe number of rows of the submatrix.
colsThe number of columns of the submatrix.
Returns
An object representing a submatrix of *this.

Definition at line 1836 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
implementation::expressions::expr<implementation::expressions::sub_1d<Rows>::template operation_col, implementation::expressions::MatrixWrapper<base_matrix<T, Rows, Cols, StorageTraits, MathObject> > > plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::col ( size_type  col_index)
inline

Returns the col_index-th column of this matrix.

Parameters
col_indexThe index of the column.
Returns
An object representing a column of *this.

Definition at line 1890 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
implementation::expressions::expr<implementation::expressions::sub_1d<Rows>::template operation_col, implementation::expressions::ConstMatrixWrapper<base_matrix<T, Rows, Cols, StorageTraits, MathObject> > > plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::col ( size_type  col_index) const
inline

Returns the col_index-th column of this matrix.

Parameters
col_indexThe index of the column.
Returns
An object representing a column of *this.

Definition at line 1908 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
size_type plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::cols ( ) const
inline

Returns the number of columns of the matrix.

Returns
The number of columns.

Definition at line 1735 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
StorageTraits::constpointer_type plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::data ( ) const
inline

Returns a pointer to the raw data of the matrix.

Returns
A pointer to a block of memory containing size() elements of type T.

Definition at line 1674 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
StorageTraits::pointer_type plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::data ( )
inline

Returns a pointer to the raw data of the matrix.

Returns
A pointer to a block of memory containing size() elements of type T.

Definition at line 1686 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
StorageTraits::constref_type plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::data ( size_type  i) const
inline

Returns a (raw) reference to the i-th entry.

Parameters
iThe index of the entry to retrieve.
Returns
A (raw) refrence into a block of memory containing size() elements of type T.

Definition at line 1699 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
StorageTraits::ref_type plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::data ( size_type  i)
inline

Returns a (raw) reference to the i-th entry.

Parameters
iThe index of the entry to retrieve.
Returns
A (raw) refrence into a block of memory containing size() elements of type T.

Definition at line 1712 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
Enumerator plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::enumerate ( )
inline

Enumerates all entries of the current matrix.

Returns
Returns a Enumerator object for the current matrix.

Definition at line 2728 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
ConstEnumerator plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::enumerate ( ) const
inline

Enumerates all entries of the current matrix.

Returns
Returns a ConstEnumerator object for the current matrix.

Definition at line 2738 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
ColEnumerator plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::enumerate_col ( size_type  col)
inline

Enumerates all entries of the given column.

Parameters
colThe column to enumerate.
Returns
Returns a ColumnEnumerator object for the specified column.

Definition at line 2773 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
ConstColEnumerator plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::enumerate_col ( size_type  col) const
inline

Enumerates all entries of the given column.

Parameters
colThe column to enumerate.
Returns
Returns a ConstColumnEnumerator object for the specified column.

Definition at line 2785 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
ColsEnumerator plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::enumerate_cols ( )
inline

Enumerates all columns. For each column, a column enumerator is given.

Returns
Returns a ColsEnumerator object for this matrix.

Definition at line 3070 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
ConstColsEnumerator plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::enumerate_cols ( ) const
inline

Enumerates all columns. For each column, a column enumerator is given.

Returns
Returns a ConstColsEnumerator object for this matrix.

Definition at line 3080 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
RowEnumerator plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::enumerate_row ( size_type  row)
inline

Enumerates all entries of the given row.

Parameters
rowThe row to enumerate.
Returns
Returns a RowEnumerator object for the specified row.

Definition at line 2749 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
ConstRowEnumerator plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::enumerate_row ( size_type  row) const
inline

Enumerates all entries of the given row.

Parameters
rowThe row to enumerate.
Returns
Returns a ConstRowEnumerator object for the specified row.

Definition at line 2761 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
RowsEnumerator plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::enumerate_rows ( )
inline

Enumerates all rows. For each row, a row enumerator is given.

Returns
Returns a RowsEnumerator object for this matrix.

Definition at line 3050 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
ConstRowsEnumerator plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::enumerate_rows ( ) const
inline

Enumerates all rows. For each row, a row enumerator is given.

Returns
Returns a ConstRowsEnumerator object for this matrix.

Definition at line 3060 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<typename ResultType >
void plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::get_coeff ( ResultType &  result,
size_type  i,
size_type  j 
) const
inlinenoexcept

Retrieves the coefficient (i, j) and stores its value into result.

Parameters
resultWhere to store the value of coefficient (i, j).
iThe row of the coefficient.
jThe column of the coefficient.

Definition at line 1518 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
bool plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::get_coeff_alwayszero ( ) const
inline

Queries whether all coefficients are definitely zero.

Returns
true if all coefficients will be zero, and false if we are not sure.

Definition at line 1534 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
GetCoeffSteps_Type plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::get_coeff_steps ( size_type  i,
size_type  j 
) const
inline

Returns a object of type GetCoeffSteps_Type which constructs the coefficient at (i, j).

This should only be called if get_coeff_alwayszero() returns false. Otherwise, the behavior is undefined.

Parameters
iThe row of the coefficient.
jThe column of the coefficient.
Returns
A GetCoeffSteps_Type object for coefficient (i, j).

Definition at line 1592 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
bool plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::involves_this_matrix ( const base_matrix< T, Rows, Cols, StorageTraits, MathObject > &  A) const
inline

Tests whether this matrix (or expression) involves A.

This will effectively compare the addresses of A and *this.

Parameters
AThe other matrix to compare this one to.

Definition at line 2323 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<typename MatrixType >
bool plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::involves_this_matrix ( const MatrixType &  A) const
inline

Tests whether this matrix (or expression) involves A.

This will always return false, since possible equality is already handled by the other overload.

Parameters
AThe other matrix to compare this one to.

Definition at line 2338 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<typename MatrixType >
void plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::move_resize ( const MatrixType &  mat)
inline

Resizes the matrix to fit the format of mat and moves the contents of mat to the matrix.

Note that if mat is an expression involving *this, there will be no problems as the old elements will only be released after the new elements are created.

Parameters
matThe matrix to move from.

Definition at line 2259 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
StorageTraits::constref_type plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::operator() ( size_type  i,
size_type  j 
) const
inline

Retrieves and returns the coefficient (i, j).

Parameters
iThe row of the coefficient.
jThe column of the coefficient.
Returns
The value of coefficient (i, j).

Definition at line 1608 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
StorageTraits::ref_type plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::operator() ( size_type  i,
size_type  j 
)
inline

Retrieves and returns the coefficient (i, j).

Parameters
iThe row of the coefficient.
jThe column of the coefficient.
Returns
The value of coefficient (i, j).

Definition at line 1624 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
base_matrix<T, Rows, Cols, StorageTraits, MathObject>& plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::operator= ( const base_matrix< T, Rows, Cols, StorageTraits, MathObject > &  m)
inline

Copies the contents of the matrix m into *this.

Parameters
mThe matrix whose contents to copy into the current matrix.

Definition at line 1416 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<typename T_ , int Rows_, int Cols_, typename StorageTraits_ , bool MathObject_>
base_matrix<T, Rows, Cols, StorageTraits, MathObject>& plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::operator= ( const base_matrix< T_, Rows_, Cols_, StorageTraits_, MathObject_ > &  m)
inline

Copies the contents of the matrix m into *this.

Parameters
mThe matrix whose contents to copy into the current matrix.

Definition at line 1431 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<template< typename > class Op, typename Data >
base_matrix<T, Rows, Cols, StorageTraits, MathObject>& plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::operator= ( const implementation::expressions::expr< Op, Data > &  m)
inline

Copies the contents of the matrix m into *this.

Parameters
mThe matrix whose contents to copy into the current matrix.

Definition at line 1446 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
StorageTraits::constref_type plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::operator[] ( size_type  i) const
inline

Retrieves and returns the i-th entry of the vector.

Note that the number of rows or columns must be forced to be 1 during compile time; otherwise, this method will not compile.

Parameters
iThe entry of the vector to retrieve.
Returns
The value of the i-th entry.

Definition at line 1642 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
StorageTraits::ref_type plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::operator[] ( size_type  i)
inline

Retrieves and returns the i-th entry of the vector.

Note that the number of rows or columns must be forced to be 1 during compile time; otherwise, this method will not compile.

Parameters
iThe entry of the vector to retrieve.
Returns
The value of the i-th entry.

Definition at line 1660 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
void plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::resize ( size_type  new_size)
inline

Resizes the vector to new_size entries. If new_size exceeds the current size, new elements are default-constructed.

Note that the number of rows or columns must be forced to be 1 during compile time; otherwise, this method will not compile.

Parameters
new_sizeThe new number of entries of the vector.

Definition at line 1957 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<typename S , bool def>
void plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::resize ( size_type  new_size,
const implementation::Initialize_Impl< S, def > &  init 
)
inline

Resizes the vector to new_size entries. If new_size exceeds the current size, new elements are copy-constructed from init.ref().

Note that the number of rows or columns must be forced to be 1 during compile time; otherwise, this method will not compile.

Parameters
new_sizeThe new number of entries of the vector.
initAn initializer object carrying a reference to an instance of S.

Definition at line 1998 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
void plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::resize ( size_type  new_rows,
size_type  new_cols 
)
inline

Resizes the matrix to new_rows times new_cols entries. If the new matrix has entries which cannot be taken from the old matrix, they are default-constructed.

Parameters
new_rowsThe new number of rows for the matrix.
new_colsThe new number of columns for the matrix.

Definition at line 2036 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<typename S , bool def>
void plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::resize ( size_type  new_rows,
size_type  new_cols,
const implementation::Initialize_Impl< S, def > &  init 
)
inline

Resizes the matrix to new_rows times new_cols entries. If the new matrix has entries which cannot be taken from the old matrix, they are copy-constructed from init.ref().

Parameters
new_rowsThe new number of rows for the matrix.
new_colsThe new number of columns for the matrix.
initAn initializer object carrying a reference to an instance of S.

Definition at line 2091 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
implementation::expressions::expr<implementation::expressions::sub_1d<Cols>::template operation_row, implementation::expressions::MatrixWrapper<base_matrix<T, Rows, Cols, StorageTraits, MathObject> > > plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::row ( size_type  row_index)
inline

Returns the row_index-th row of this matrix.

Parameters
row_indexThe index of the row.
Returns
An object representing a row of *this.

Definition at line 1854 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
implementation::expressions::expr<implementation::expressions::sub_1d<Cols>::template operation_row, implementation::expressions::ConstMatrixWrapper<base_matrix<T, Rows, Cols, StorageTraits, MathObject> > > plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::row ( size_type  row_index) const
inline

Returns the row_index-th row of this matrix.

Parameters
row_indexThe index of the row.
Returns
An object representing a row of *this.

Definition at line 1872 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
size_type plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::rows ( ) const
inline

Returns the number of rows of the matrix.

Returns
The number of rows.

Definition at line 1724 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
size_type plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::size ( ) const
inline

Returns the number of entries of the matrix. This equals rows() * cols().

Returns
The number of entries of the matrix.

Definition at line 1746 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<typename MatrixType >
void plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::swap ( MatrixType &  B)
inline

Swaps the contents of this matrix with the matrix B.

Parameters
BAnother matrix to swap the contents with.

Definition at line 2308 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
template<typename MatrixType >
bool plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::test_involvement ( const MatrixType &  A) const
inline

For the underlying matrices U of the current expression, calls A.involves_this_matrix(U). Returns true if any of these returns true.

Since this is already a matrix, will call A.involves_this_matrix(*this) directly.

Parameters
AA matrix to call involves_this_matrix() of.

Definition at line 2353 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
implementation::expressions::expr<implementation::expressions::transpose, implementation::expressions::MatrixWrapper<base_matrix<T, Rows, Cols, StorageTraits, MathObject> > > plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::transpose ( )
inline

Returns the transpose of this matrix.

Returns
An object representing the transpose of *this.

Definition at line 1925 of file matrix.hpp.

template<typename T, int Rows, int Cols, typename StorageTraits, bool MathObject>
implementation::expressions::expr<implementation::expressions::transpose, implementation::expressions::ConstMatrixWrapper<base_matrix<T, Rows, Cols, StorageTraits, MathObject> > > plll::linalg::base_matrix< T, Rows, Cols, StorageTraits, MathObject >::transpose ( ) const
inline

Returns the transpose of this matrix.

Returns
An object representing the transpose of *this.

Definition at line 1940 of file matrix.hpp.


The documentation for this class was generated from the following file: