imate
C++/CUDA Reference
Power Class Reference

Defines the function \( f: \lambda \mapsto \lambda^{p} \), where \( p \in \mathbb{R} \) is a parameter and should be set by this->exponent member. More...

#include <power.h>

Inheritance diagram for Power:
Collaboration diagram for Power:

Public Member Functions

 Power ()
 Sets the default for the parameter exponent to 2.0. More...
 
virtual float function (const float lambda_) const
 
virtual double function (const double lambda_) const
 
virtual long double function (const long double lambda_) const
 
- Public Member Functions inherited from Function
virtual ~Function ()
 Default virtual destructor. More...
 

Public Attributes

double exponent
 

Detailed Description

Defines the function \( f: \lambda \mapsto \lambda^{p} \), where \( p \in \mathbb{R} \) is a parameter and should be set by this->exponent member.

The matrix function \( f: \mathbb{R}^{n \times n} \to \mathbb{R}^{n \times n} \) is used in

\[ \mathrm{trace} \left( f(\mathbf{A}) \right). \]

However, instead of a matrix function, the equivalent scalar function \( f: \mathbb{R} \to \mathbb{R} \) is defiend which acts on the eigenvalues of the matrix.

Definition at line 42 of file power.h.

Constructor & Destructor Documentation

◆ Power()

Power::Power ( )

Sets the default for the parameter exponent to 2.0.

Definition at line 27 of file power.cpp.

27  :
28  exponent(2.0)
29 {
30 }
double exponent
Definition: power.h:49

Member Function Documentation

◆ function() [1/3]

double Power::function ( const double  lambda_) const
virtual
Parameters
[in]lambda_Eigenvalue (or singular value) of matrix.
Returns
The value of matrix function for the given eigenvalue.

Implements Function.

Definition at line 55 of file power.cpp.

56 {
57  return pow(lambda_, this->exponent);
58 }

References exponent.

◆ function() [2/3]

float Power::function ( const float  lambda_) const
virtual
Parameters
[in]lambda_Eigenvalue (or singular value) of matrix.
Returns
The value of matrix function for the given eigenvalue.

Implements Function.

Definition at line 41 of file power.cpp.

42 {
43  return pow(lambda_, static_cast<float>(this->exponent));
44 }

References exponent.

◆ function() [3/3]

long double Power::function ( const long double  lambda_) const
virtual
Parameters
[in]lambda_Eigenvalue (or singular value) of matrix.
Returns
The value of matrix function for the given eigenvalue.

Implements Function.

Definition at line 69 of file power.cpp.

70 {
71  return pow(lambda_, static_cast<long double>(this->exponent));
72 }

References exponent.

Member Data Documentation

◆ exponent

double Power::exponent

Definition at line 49 of file power.h.

Referenced by function().


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