dune-common  2.7.0
Public Types | Public Member Functions | List of all members
Dune::DynamicMatrix< K > Class Template Reference

Construct a matrix with a dynamic size. More...

#include <dune/common/dynmatrix.hh>

Public Types

typedef Base::size_type size_type
 
typedef Base::value_type value_type
 
typedef Base::row_type row_type
 

Public Member Functions

 DynamicMatrix ()
 Default constructor. More...
 
 DynamicMatrix (size_type r, size_type c, value_type v=value_type())
 Constructor initializing the whole matrix with a scalar. More...
 
 DynamicMatrix (std::initializer_list< DynamicVector< K >> const &ll)
 Constructor initializing the matrix from a list of vector. More...
 
template<class T , typename = std::enable_if_t<!Dune::IsNumber<T>::value && HasDenseMatrixAssigner<DynamicMatrix, T>::value>>
 DynamicMatrix (T const &rhs)
 
void resize (size_type r, size_type c, value_type v=value_type())
 resize matrix to r × c More...
 
template<typename T , typename = std::enable_if_t<!Dune::IsNumber<T>::value>>
DynamicMatrixoperator= (T const &rhs)
 
template<typename T , typename = std::enable_if_t<Dune::IsNumber<T>::value>>
DynamicMatrixoperator= (T scalar)
 
size_type mat_rows () const
 
size_type mat_cols () const
 
row_typemat_access (size_type i)
 
const row_typemat_access (size_type i) const
 

Detailed Description

template<class K>
class Dune::DynamicMatrix< K >

Construct a matrix with a dynamic size.

Template Parameters
Kis the field type (use float, double, complex, etc)

Member Typedef Documentation

◆ row_type

template<class K >
typedef Base::row_type Dune::DynamicMatrix< K >::row_type

◆ size_type

template<class K >
typedef Base::size_type Dune::DynamicMatrix< K >::size_type

◆ value_type

template<class K >
typedef Base::value_type Dune::DynamicMatrix< K >::value_type

Constructor & Destructor Documentation

◆ DynamicMatrix() [1/4]

template<class K >
Dune::DynamicMatrix< K >::DynamicMatrix ( )
inline

Default constructor.

◆ DynamicMatrix() [2/4]

template<class K >
Dune::DynamicMatrix< K >::DynamicMatrix ( size_type  r,
size_type  c,
value_type  v = value_type() 
)
inline

Constructor initializing the whole matrix with a scalar.

◆ DynamicMatrix() [3/4]

template<class K >
Dune::DynamicMatrix< K >::DynamicMatrix ( std::initializer_list< DynamicVector< K >> const &  ll)
inline

Constructor initializing the matrix from a list of vector.

◆ DynamicMatrix() [4/4]

template<class K >
template<class T , typename = std::enable_if_t<!Dune::IsNumber<T>::value && HasDenseMatrixAssigner<DynamicMatrix, T>::value>>
Dune::DynamicMatrix< K >::DynamicMatrix ( T const &  rhs)
inline

Member Function Documentation

◆ mat_access() [1/2]

template<class K >
row_type& Dune::DynamicMatrix< K >::mat_access ( size_type  i)
inline

◆ mat_access() [2/2]

template<class K >
const row_type& Dune::DynamicMatrix< K >::mat_access ( size_type  i) const
inline

◆ mat_cols()

template<class K >
size_type Dune::DynamicMatrix< K >::mat_cols ( ) const
inline

◆ mat_rows()

template<class K >
size_type Dune::DynamicMatrix< K >::mat_rows ( ) const
inline

◆ operator=() [1/2]

template<class K >
template<typename T , typename = std::enable_if_t<!Dune::IsNumber<T>::value>>
DynamicMatrix& Dune::DynamicMatrix< K >::operator= ( T const &  rhs)
inline

◆ operator=() [2/2]

template<class K >
template<typename T , typename = std::enable_if_t<Dune::IsNumber<T>::value>>
DynamicMatrix& Dune::DynamicMatrix< K >::operator= ( scalar)
inline

◆ resize()

template<class K >
void Dune::DynamicMatrix< K >::resize ( size_type  r,
size_type  c,
value_type  v = value_type() 
)
inline

resize matrix to r × c

Resize the matrix to r × c, using v as the value of all entries.

Warning
All previous entries are lost, even when the matrix was not actually resized.
Parameters
rnumber of rows
cnumber of columns
vvalue of matrix entries

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