Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | Friends | List of all members
CDPL::Math::ZeroMatrix< T > Class Template Reference

Constant matrix expression whose entries are all zero. More...

#include <Matrix.hpp>

+ Inheritance diagram for CDPL::Math::ZeroMatrix< T >:

Public Types

typedef T ValueType
 The scalar value type. More...
 
typedef const T & Reference
 Reference type (always a const reference — all elements are zero). More...
 
typedef const T & ConstReference
 Constant reference type to the zero element. More...
 
typedef std::size_t SizeType
 The unsigned size type. More...
 
typedef std::ptrdiff_t DifferenceType
 The signed difference type. More...
 
typedef MatrixReference< SelfTypeClosureType
 Closure type used when this matrix appears inside another expression. More...
 
typedef const MatrixReference< const SelfTypeConstClosureType
 Constant closure type used when this matrix appears inside another expression. More...
 
typedef Matrix< T > MatrixTemporaryType
 Concrete temporary matrix type used by expression-template machinery. More...
 
typedef Vector< T, std::vector< T > > VectorTemporaryType
 Concrete temporary vector type used when assembling vectors from this matrix. More...
 
- Public Types inherited from CDPL::Math::MatrixContainer< ZeroMatrix< T > >
typedef ZeroMatrix< T > ContainerType
 The derived matrix container type. More...
 
- Public Types inherited from CDPL::Math::MatrixExpression< E >
typedef E ExpressionType
 The derived matrix expression type. More...
 
- Public Types inherited from CDPL::Math::Expression< E >
typedef E ExpressionType
 The derived expression type (made available to expression-template machinery). More...
 

Public Member Functions

 ZeroMatrix ()
 Constructs an empty zero matrix. More...
 
 ZeroMatrix (SizeType m, SizeType n)
 Constructs a zero matrix of size \( m \times n \). More...
 
 ZeroMatrix (const ZeroMatrix &m)
 Constructs a copy of the zero matrix m. More...
 
ConstReference operator() (SizeType i, SizeType j) const
 Returns a const reference to the zero element. More...
 
bool isEmpty () const
 Tells whether the matrix is empty (either dimension is zero). More...
 
SizeType getSize1 () const
 Returns the logical number of rows. More...
 
SizeType getSize2 () const
 Returns the logical number of columns. More...
 
SizeType getMaxSize1 () const
 Returns the maximum representable row count. More...
 
SizeType getMaxSize2 () const
 Returns the maximum representable column count. More...
 
ZeroMatrixoperator= (const ZeroMatrix &m)
 Copy-assigns the dimensions from m. More...
 
void swap (ZeroMatrix &m)
 Swaps the dimensions with m. More...
 
void resize (SizeType m, SizeType n)
 Resizes the dimensions to \( m \times n \). More...
 
- Public Member Functions inherited from CDPL::Math::MatrixContainer< ZeroMatrix< T > >
const ContainerTypeoperator() () const
 Returns a const reference to the derived matrix container. More...
 
ContainerTypeoperator() ()
 Returns a reference to the derived matrix container. More...
 
- Public Member Functions inherited from CDPL::Math::MatrixExpression< E >
const ExpressionTypeoperator() () const
 Returns a const reference to the derived matrix expression. More...
 
ExpressionTypeoperator() ()
 Returns a reference to the derived matrix expression. More...
 

Friends

void swap (ZeroMatrix &m1, ZeroMatrix &m2)
 ADL-enabled free-function form of swap(). More...
 

Additional Inherited Members

- Protected Member Functions inherited from CDPL::Math::MatrixContainer< ZeroMatrix< T > >
 MatrixContainer ()
 
 ~MatrixContainer ()
 
- Protected Member Functions inherited from CDPL::Math::MatrixExpression< E >
 MatrixExpression ()
 
 ~MatrixExpression ()
 
- Protected Member Functions inherited from CDPL::Math::Expression< E >
 Expression ()
 
 ~Expression ()
 

Detailed Description

template<typename T>
class CDPL::Math::ZeroMatrix< T >

Constant matrix expression whose entries are all zero.

Template Parameters
TThe scalar value type.

Member Typedef Documentation

◆ ValueType

template<typename T >
typedef T CDPL::Math::ZeroMatrix< T >::ValueType

The scalar value type.

◆ Reference

template<typename T >
typedef const T& CDPL::Math::ZeroMatrix< T >::Reference

Reference type (always a const reference — all elements are zero).

◆ ConstReference

template<typename T >
typedef const T& CDPL::Math::ZeroMatrix< T >::ConstReference

Constant reference type to the zero element.

◆ SizeType

template<typename T >
typedef std::size_t CDPL::Math::ZeroMatrix< T >::SizeType

The unsigned size type.

◆ DifferenceType

template<typename T >
typedef std::ptrdiff_t CDPL::Math::ZeroMatrix< T >::DifferenceType

The signed difference type.

◆ ClosureType

template<typename T >
typedef MatrixReference<SelfType> CDPL::Math::ZeroMatrix< T >::ClosureType

Closure type used when this matrix appears inside another expression.

◆ ConstClosureType

template<typename T >
typedef const MatrixReference<const SelfType> CDPL::Math::ZeroMatrix< T >::ConstClosureType

Constant closure type used when this matrix appears inside another expression.

◆ MatrixTemporaryType

template<typename T >
typedef Matrix<T> CDPL::Math::ZeroMatrix< T >::MatrixTemporaryType

Concrete temporary matrix type used by expression-template machinery.

◆ VectorTemporaryType

template<typename T >
typedef Vector<T, std::vector<T> > CDPL::Math::ZeroMatrix< T >::VectorTemporaryType

Concrete temporary vector type used when assembling vectors from this matrix.

Constructor & Destructor Documentation

◆ ZeroMatrix() [1/3]

template<typename T >
CDPL::Math::ZeroMatrix< T >::ZeroMatrix ( )
inline

Constructs an empty zero matrix.

◆ ZeroMatrix() [2/3]

template<typename T >
CDPL::Math::ZeroMatrix< T >::ZeroMatrix ( SizeType  m,
SizeType  n 
)
inline

Constructs a zero matrix of size \( m \times n \).

Parameters
mThe number of rows.
nThe number of columns.

◆ ZeroMatrix() [3/3]

template<typename T >
CDPL::Math::ZeroMatrix< T >::ZeroMatrix ( const ZeroMatrix< T > &  m)
inline

Constructs a copy of the zero matrix m.

Parameters
mThe zero matrix to copy.

Member Function Documentation

◆ operator()()

template<typename T >
ConstReference CDPL::Math::ZeroMatrix< T >::operator() ( SizeType  i,
SizeType  j 
) const
inline

Returns a const reference to the zero element.

Parameters
iThe zero-based row index.
jThe zero-based column index.
Returns
A const reference to the zero element.
Exceptions
Base::IndexErrorif either index is out of range.

◆ isEmpty()

template<typename T >
bool CDPL::Math::ZeroMatrix< T >::isEmpty ( ) const
inline

Tells whether the matrix is empty (either dimension is zero).

Returns
true if either dimension is zero, and false otherwise.

◆ getSize1()

template<typename T >
SizeType CDPL::Math::ZeroMatrix< T >::getSize1 ( ) const
inline

Returns the logical number of rows.

Returns
The number of rows.

◆ getSize2()

template<typename T >
SizeType CDPL::Math::ZeroMatrix< T >::getSize2 ( ) const
inline

Returns the logical number of columns.

Returns
The number of columns.

◆ getMaxSize1()

template<typename T >
SizeType CDPL::Math::ZeroMatrix< T >::getMaxSize1 ( ) const
inline

Returns the maximum representable row count.

Returns
The maximum number of rows.

◆ getMaxSize2()

template<typename T >
SizeType CDPL::Math::ZeroMatrix< T >::getMaxSize2 ( ) const
inline

Returns the maximum representable column count.

Returns
The maximum number of columns.

◆ operator=()

template<typename T >
ZeroMatrix& CDPL::Math::ZeroMatrix< T >::operator= ( const ZeroMatrix< T > &  m)
inline

Copy-assigns the dimensions from m.

Parameters
mThe source zero matrix.
Returns
A reference to itself.

◆ swap()

template<typename T >
void CDPL::Math::ZeroMatrix< T >::swap ( ZeroMatrix< T > &  m)
inline

Swaps the dimensions with m.

Parameters
mThe zero matrix to swap with.

◆ resize()

template<typename T >
void CDPL::Math::ZeroMatrix< T >::resize ( SizeType  m,
SizeType  n 
)
inline

Resizes the dimensions to \( m \times n \).

Parameters
mThe new row count.
nThe new column count.

Friends And Related Function Documentation

◆ swap

template<typename T >
void swap ( ZeroMatrix< T > &  m1,
ZeroMatrix< T > &  m2 
)
friend

ADL-enabled free-function form of swap().

Parameters
m1The first zero matrix.
m2The second zero matrix.

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