Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Static Public Member Functions | List of all members
CDPL::Math::MatrixTrace< M > Struct Template Reference

Functor returning the trace (sum of diagonal entries) of a matrix expression. More...

#include <Functional.hpp>

+ Inheritance diagram for CDPL::Math::MatrixTrace< M >:

Public Types

typedef MatrixScalarUnaryFunctor< M >::ResultType ResultType
 
- Public Types inherited from CDPL::Math::MatrixScalarUnaryFunctor< M >
typedef M::ValueType ResultType
 The scalar result type (the matrix's element value type). More...
 

Static Public Member Functions

static ResultType apply (const MatrixExpression< M > &e)
 Returns the trace of e. More...
 

Detailed Description

template<typename M>
struct CDPL::Math::MatrixTrace< M >

Functor returning the trace (sum of diagonal entries) of a matrix expression.

Template Parameters
MThe matrix expression type.

Member Typedef Documentation

◆ ResultType

template<typename M >
typedef MatrixScalarUnaryFunctor<M>::ResultType CDPL::Math::MatrixTrace< M >::ResultType

Member Function Documentation

◆ apply()

template<typename M >
static ResultType CDPL::Math::MatrixTrace< M >::apply ( const MatrixExpression< M > &  e)
inlinestatic

Returns the trace of e.

Parameters
eThe matrix expression.
Returns
\( \sum_i e(i, i) \).
Exceptions
Base::SizeErrorif e is not square.

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