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

Functor producing the diagonal-matrix entry at (i, j) from a vector expression ( \( e(i) \) on the diagonal, 0 elsewhere). More...

#include <Functional.hpp>

+ Inheritance diagram for CDPL::Math::DiagonalMatrixFromVector< V >:

Public Types

typedef VectorScalarUnaryFunctor< V >::ResultType ResultType
 
typedef VectorScalarUnaryFunctor< V >::SizeType SizeType
 
- Public Types inherited from CDPL::Math::VectorMatrixUnaryFunctor< V >
typedef V::ValueType ResultType
 The matrix-entry result type (the vector's element value type). More...
 
typedef V::SizeType SizeType
 The unsigned size type used by the vector. More...
 

Static Public Member Functions

template<typename E >
static ResultType apply (const VectorExpression< E > &e, SizeType i, SizeType j)
 Returns \( e(i) \) if i equals j, otherwise 0. More...
 

Detailed Description

template<typename V>
struct CDPL::Math::DiagonalMatrixFromVector< V >

Functor producing the diagonal-matrix entry at (i, j) from a vector expression ( \( e(i) \) on the diagonal, 0 elsewhere).

Template Parameters
VThe vector expression type.

Member Typedef Documentation

◆ ResultType

◆ SizeType

Member Function Documentation

◆ apply()

template<typename V >
template<typename E >
static ResultType CDPL::Math::DiagonalMatrixFromVector< V >::apply ( const VectorExpression< E > &  e,
SizeType  i,
SizeType  j 
)
inlinestatic

Returns \( e(i) \) if i equals j, otherwise 0.

Template Parameters
EThe vector expression type.
Parameters
eThe vector expression.
iThe zero-based row index.
jThe zero-based column index.
Returns
The diagonal-matrix entry.

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