CMR  1.3.0
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
tu::DenseMatrix< V > Class Template Reference

Dense matrix with entries of type V. More...

#include <matrix.hpp>

Inheritance diagram for tu::DenseMatrix< V >:
tu::Matrix< V >

Classes

class  NonzeroIterator
 

Public Types

typedef Matrix< V >::Value Value
 
typedef Matrix< V >::Index Index
 
typedef Matrix< V >::Nonzero Nonzero
 
typedef detail::Range< NonzeroIterator< true > > NonzeroRowRange
 
typedef detail::Range< NonzeroIterator< false > > NonzeroColumnRange
 
- Public Types inherited from tu::Matrix< V >
typedef V Value
 
typedef std::size_t Index
 Type of entries. More...
 

Public Member Functions

 DenseMatrix ()
 Default constructor for 0x0 matrix. More...
 
 DenseMatrix (DenseMatrix< V > &&other)
 Move constructor that steals the data from other. More...
 
template<typename V2 >
 DenseMatrix (const DenseMatrix< V2 > &other)
 Copy constructor. More...
 
DenseMatrix< V > & operator= (DenseMatrix< V > &&other)
 Move assignment operator that steals the data from other. More...
 
template<typename V2 >
DenseMatrix< V > & operator= (const DenseMatrix< V2 > &other)
 Assignment operator. More...
 
 ~DenseMatrix ()
 Destructor. More...
 
 DenseMatrix (Index numRows, Index numColumns)
 Constructs zero matrix of given size. More...
 
Index numRows () const
 Returns the number of rows. More...
 
Index numColumns () const
 Returns the number of columns. More...
 
const Valueget (Index row, Index column) const
 Returns entry at row, column. More...
 
template<typename V2 >
void set (Index row, Index column, const V2 &value)
 Sets entry at row, column to copy of value. More...
 
std::size_t countRowNonzeros (Index row) const
 Returns the number of nonzeros in row. More...
 
std::size_t countColumnNonzeros (Index column) const
 Returns the number of nonzeros in column. More...
 
NonzeroRowRange iterateRowNonzeros (Index row) const
 Returns a range for iterating over the nonzeros of row. More...
 
NonzeroColumnRange iterateColumnNonzeros (Index column) const
 Returns a range for iterating over the nonzeros of column. More...
 
void ensureConsistency () const
 Checks for consistency, raising a std::runtime_error if inconsistent. More...
 

Protected Attributes

Value_data
 
Index _numRows
 Matrix entries with row-major ordering. More...
 
Index _numColumns
 Number of rows. More...
 

Detailed Description

template<typename V>
class tu::DenseMatrix< V >

Dense matrix with entries of type V.

Member Typedef Documentation

◆ Index

template<typename V >
typedef Matrix<V>::Index tu::DenseMatrix< V >::Index

◆ Nonzero

template<typename V >
typedef Matrix<V>::Nonzero tu::DenseMatrix< V >::Nonzero

◆ NonzeroColumnRange

template<typename V >
typedef detail::Range<NonzeroIterator<false> > tu::DenseMatrix< V >::NonzeroColumnRange

◆ NonzeroRowRange

template<typename V >
typedef detail::Range<NonzeroIterator<true> > tu::DenseMatrix< V >::NonzeroRowRange

◆ Value

template<typename V >
typedef Matrix<V>::Value tu::DenseMatrix< V >::Value

Constructor & Destructor Documentation

◆ DenseMatrix() [1/4]

template<typename V >
tu::DenseMatrix< V >::DenseMatrix ( )
inline

Default constructor for 0x0 matrix.

◆ DenseMatrix() [2/4]

template<typename V >
tu::DenseMatrix< V >::DenseMatrix ( DenseMatrix< V > &&  other)
inline

Move constructor that steals the data from other.

◆ DenseMatrix() [3/4]

template<typename V >
template<typename V2 >
tu::DenseMatrix< V >::DenseMatrix ( const DenseMatrix< V2 > &  other)
inline

Copy constructor.

◆ ~DenseMatrix()

template<typename V >
tu::DenseMatrix< V >::~DenseMatrix ( )
inline

Destructor.

◆ DenseMatrix() [4/4]

template<typename V >
tu::DenseMatrix< V >::DenseMatrix ( Index  numRows,
Index  numColumns 
)
inline

Constructs zero matrix of given size.

Member Function Documentation

◆ countColumnNonzeros()

template<typename V >
std::size_t tu::DenseMatrix< V >::countColumnNonzeros ( Index  column) const
inline

Returns the number of nonzeros in column.

◆ countRowNonzeros()

template<typename V >
std::size_t tu::DenseMatrix< V >::countRowNonzeros ( Index  row) const
inline

Returns the number of nonzeros in row.

◆ ensureConsistency()

template<typename V >
void tu::DenseMatrix< V >::ensureConsistency ( ) const
inline

Checks for consistency, raising a std::runtime_error if inconsistent.

◆ get()

template<typename V >
const Value& tu::DenseMatrix< V >::get ( Index  row,
Index  column 
) const
inline

Returns entry at row, column.

◆ iterateColumnNonzeros()

template<typename V >
NonzeroColumnRange tu::DenseMatrix< V >::iterateColumnNonzeros ( Index  column) const
inline

Returns a range for iterating over the nonzeros of column.

◆ iterateRowNonzeros()

template<typename V >
NonzeroRowRange tu::DenseMatrix< V >::iterateRowNonzeros ( Index  row) const
inline

Returns a range for iterating over the nonzeros of row.

◆ numColumns()

template<typename V >
Index tu::DenseMatrix< V >::numColumns ( ) const
inline

Returns the number of columns.

◆ numRows()

template<typename V >
Index tu::DenseMatrix< V >::numRows ( ) const
inline

Returns the number of rows.

◆ operator=() [1/2]

template<typename V >
template<typename V2 >
DenseMatrix<V>& tu::DenseMatrix< V >::operator= ( const DenseMatrix< V2 > &  other)
inline

Assignment operator.

◆ operator=() [2/2]

template<typename V >
DenseMatrix<V>& tu::DenseMatrix< V >::operator= ( DenseMatrix< V > &&  other)
inline

Move assignment operator that steals the data from other.

◆ set()

template<typename V >
template<typename V2 >
void tu::DenseMatrix< V >::set ( Index  row,
Index  column,
const V2 &  value 
)
inline

Sets entry at row, column to copy of value.

Member Data Documentation

◆ _data

template<typename V >
Value* tu::DenseMatrix< V >::_data
protected

◆ _numColumns

template<typename V >
Index tu::DenseMatrix< V >::_numColumns
protected

Number of rows.

◆ _numRows

template<typename V >
Index tu::DenseMatrix< V >::_numRows
protected

Matrix entries with row-major ordering.


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