Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | List of all members
CDPL::Math::MatrixUnary< E, F > Class Template Reference

Expression-template node applying a unary functor F element-wise to a matrix expression E. More...

#include <MatrixExpression.hpp>

+ Inheritance diagram for CDPL::Math::MatrixUnary< E, F >:

Public Types

typedef F::ResultType ValueType
 The element value type of the expression (the functor's result type). More...
 
typedef const ValueType ConstReference
 Constant reference type to an element value. More...
 
typedef const ValueType Reference
 Mutable reference type (degrades to const for expression-template results). More...
 
typedef const SelfType ConstClosureType
 Constant closure type used when this expression appears inside another expression. More...
 
typedef SelfType ClosureType
 Closure type used when this expression appears inside another expression. More...
 
typedef E::SizeType SizeType
 The size type inherited from the wrapped expression. More...
 
typedef E::DifferenceType DifferenceType
 The signed difference type inherited from the wrapped expression. More...
 
- Public Types inherited from CDPL::Math::MatrixExpression< MatrixUnary< E, F > >
typedef MatrixUnary< E, F > 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

 MatrixUnary (const ExpressionType &e)
 Constructs the expression-template node wrapping e. More...
 
SizeType getSize1 () const
 Returns the wrapped expression's first-dimension size. More...
 
SizeType getSize2 () const
 Returns the wrapped expression's second-dimension size. More...
 
ConstReference operator() (SizeType i, SizeType j) const
 Applies the unary functor to element (i, j) of the wrapped expression and returns the result. More...
 
- Public Member Functions inherited from CDPL::Math::MatrixExpression< MatrixUnary< E, F > >
const ExpressionTypeoperator() () const
 Returns a const reference to the derived matrix expression. More...
 
ExpressionTypeoperator() ()
 Returns a reference to the derived matrix expression. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CDPL::Math::MatrixExpression< MatrixUnary< E, F > >
 MatrixExpression ()
 
 ~MatrixExpression ()
 
- Protected Member Functions inherited from CDPL::Math::Expression< E >
 Expression ()
 
 ~Expression ()
 

Detailed Description

template<typename E, typename F>
class CDPL::Math::MatrixUnary< E, F >

Expression-template node applying a unary functor F element-wise to a matrix expression E.

Template Parameters
EThe wrapped matrix expression type.
FThe unary functor type.

Member Typedef Documentation

◆ ValueType

template<typename E , typename F >
typedef F::ResultType CDPL::Math::MatrixUnary< E, F >::ValueType

The element value type of the expression (the functor's result type).

◆ ConstReference

template<typename E , typename F >
typedef const ValueType CDPL::Math::MatrixUnary< E, F >::ConstReference

Constant reference type to an element value.

◆ Reference

template<typename E , typename F >
typedef const ValueType CDPL::Math::MatrixUnary< E, F >::Reference

Mutable reference type (degrades to const for expression-template results).

◆ ConstClosureType

template<typename E , typename F >
typedef const SelfType CDPL::Math::MatrixUnary< E, F >::ConstClosureType

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

◆ ClosureType

template<typename E , typename F >
typedef SelfType CDPL::Math::MatrixUnary< E, F >::ClosureType

Closure type used when this expression appears inside another expression.

◆ SizeType

template<typename E , typename F >
typedef E::SizeType CDPL::Math::MatrixUnary< E, F >::SizeType

The size type inherited from the wrapped expression.

◆ DifferenceType

template<typename E , typename F >
typedef E::DifferenceType CDPL::Math::MatrixUnary< E, F >::DifferenceType

The signed difference type inherited from the wrapped expression.

Constructor & Destructor Documentation

◆ MatrixUnary()

template<typename E , typename F >
CDPL::Math::MatrixUnary< E, F >::MatrixUnary ( const ExpressionType e)
inline

Constructs the expression-template node wrapping e.

Parameters
eThe matrix expression to wrap.

Member Function Documentation

◆ getSize1()

template<typename E , typename F >
SizeType CDPL::Math::MatrixUnary< E, F >::getSize1 ( ) const
inline

Returns the wrapped expression's first-dimension size.

Returns
The number of rows.

◆ getSize2()

template<typename E , typename F >
SizeType CDPL::Math::MatrixUnary< E, F >::getSize2 ( ) const
inline

Returns the wrapped expression's second-dimension size.

Returns
The number of columns.

◆ operator()()

template<typename E , typename F >
ConstReference CDPL::Math::MatrixUnary< E, F >::operator() ( SizeType  i,
SizeType  j 
) const
inline

Applies the unary functor to element (i, j) of the wrapped expression and returns the result.

Parameters
iThe zero-based row index.
jThe zero-based column index.
Returns
The element value as transformed by the functor.

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