bpp-core3  3.0.0
bpp::MathOperator Class Reference

Implements a unary operator that applies a math (described in cmath) operator. More...

#include <Bpp/Numeric/Function/Operators/MathOperator.h>

+ Inheritance diagram for bpp::MathOperator:
+ Collaboration diagram for bpp::MathOperator:

Public Member Functions

 MathOperator (double(*func)(double), std::string name, std::shared_ptr< Operator > son)
 
MathOperatorclone () const
 Create a copy of this object and send a pointer to it. More...
 
std::shared_ptr< OperatorgetSon ()
 
double getValue () const
 
std::string getName () const
 
double getFirstOrderDerivative (const std::string &variable) const
 1st order derivative More...
 
double getSecondOrderDerivative (const std::string &variable) const
 
std::string output () const
 

Private Attributes

double(* func_ )(double)
 
std::string name_
 
std::shared_ptr< Operatorson_
 

Detailed Description

Implements a unary operator that applies a math (described in cmath) operator.

Definition at line 56 of file MathOperator.h.

Constructor & Destructor Documentation

◆ MathOperator()

bpp::MathOperator::MathOperator ( double(*)(double)  func,
std::string  name,
std::shared_ptr< Operator son 
)
inline

Definition at line 72 of file MathOperator.h.

Referenced by clone().

Member Function Documentation

◆ clone()

MathOperator* bpp::MathOperator::clone ( ) const
inlinevirtual

Create a copy of this object and send a pointer to it.

Returns
A pointer toward the copy object.

Implements bpp::Clonable.

Definition at line 76 of file MathOperator.h.

References MathOperator().

◆ getFirstOrderDerivative()

double bpp::MathOperator::getFirstOrderDerivative ( const std::string &  variable) const
inlinevirtual

1st order derivative

Implements bpp::Operator.

Definition at line 103 of file MathOperator.h.

References name_, and son_.

◆ getName()

std::string bpp::MathOperator::getName ( ) const
inline

Definition at line 94 of file MathOperator.h.

References name_.

◆ getSecondOrderDerivative()

double bpp::MathOperator::getSecondOrderDerivative ( const std::string &  variable) const
inlinevirtual

Implements bpp::Operator.

Definition at line 116 of file MathOperator.h.

References name_, and son_.

◆ getSon()

std::shared_ptr<Operator> bpp::MathOperator::getSon ( )
inline

Definition at line 81 of file MathOperator.h.

References son_.

◆ getValue()

double bpp::MathOperator::getValue ( ) const
inlinevirtual

Implements bpp::Operator.

Definition at line 86 of file MathOperator.h.

References func_, and son_.

◆ output()

std::string bpp::MathOperator::output ( ) const
inlinevirtual

Implements bpp::Operator.

Definition at line 132 of file MathOperator.h.

References name_, and son_.

Member Data Documentation

◆ func_

double(* bpp::MathOperator::func_) (double)
private

Definition at line 65 of file MathOperator.h.

Referenced by getValue().

◆ name_

std::string bpp::MathOperator::name_
private

Definition at line 67 of file MathOperator.h.

Referenced by getFirstOrderDerivative(), getName(), getSecondOrderDerivative(), and output().

◆ son_

std::shared_ptr<Operator> bpp::MathOperator::son_
private

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