FuncSketch
Loading...
Searching...
No Matches
func_sketch::math::MathFunction Class Reference

Class of mathematical functions. More...

#include <func_sketch/math/math_function.h>

Collaboration diagram for func_sketch::math::MathFunction:

Public Member Functions

template<MathFunctionType T>
 MathFunction (T function)
 Constructor.
std::string_view name () const
 Get the name of the function.
void operator() (const std::vector< Number > &args, Number &result) const
 Operate on scalars.

Private Types

using GetNameSignature
 Signature of function to get the name of the function.
using ScalarOperatorSignature
 Signature of function to operate on scalars.

Private Attributes

utilities::Any function_
 Function object.
GetNameSignatureget_name_
 Function to get the name of the function.
ScalarOperatorSignaturescalar_operator_
 Function to operate on scalars.

Detailed Description

Class of mathematical functions.

Definition at line 35 of file math_function.h.

Member Typedef Documentation

◆ GetNameSignature

Initial value:
std::string_view(
const utilities::Any& )
Class to store any type of value.
Definition any.h:33

Signature of function to get the name of the function.

Definition at line 72 of file math_function.h.

◆ ScalarOperatorSignature

Initial value:
void(
const utilities::Any& ,
const std::vector<Number>& , Number& )
std::variant< Integer, Real, Complex > Number
Type of numbers.

Signature of function to operate on scalars.

Definition at line 76 of file math_function.h.

Constructor & Destructor Documentation

◆ MathFunction()

template<MathFunctionType T>
func_sketch::math::MathFunction::MathFunction ( T function)
inlineexplicit

Constructor.

Template Parameters
TType of the function object.
Parameters
[in]functionFunction object.

Definition at line 44 of file math_function.h.

Member Function Documentation

◆ name()

std::string_view func_sketch::math::MathFunction::name ( ) const
inlinenodiscard

Get the name of the function.

Returns
Name of the function.

Definition at line 58 of file math_function.h.

◆ operator()()

void func_sketch::math::MathFunction::operator() ( const std::vector< Number > & args,
Number & result ) const
inline

Operate on scalars.

Parameters
[in]argsArguments.
[out]resultResult.

Definition at line 66 of file math_function.h.

Member Data Documentation

◆ function_

utilities::Any func_sketch::math::MathFunction::function_
private

Function object.

Definition at line 81 of file math_function.h.

◆ get_name_

GetNameSignature* func_sketch::math::MathFunction::get_name_
private

Function to get the name of the function.

Definition at line 84 of file math_function.h.

◆ scalar_operator_

ScalarOperatorSignature* func_sketch::math::MathFunction::scalar_operator_
private

Function to operate on scalars.

Definition at line 87 of file math_function.h.


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