Class of general implementation of mathematical functions.
More...
#include <func_sketch/math/general_math_function.h>
|
| template<typename InputFunctionType> |
| | GeneralMathFunction (std::string name, InputFunctionType &&function) |
| | Constructor.
|
| std::string_view | name () const noexcept |
| | Get the name of the function.
|
| void | operator() (const std::vector< Number > &args, Number &result) const |
| | Operate on scalars.
|
|
| using | AcceptableTypesTuples = std::tuple<AcceptableTypesPerArgument...> |
| | Type of tuples of acceptable types.
|
|
| template<std::size_t... Indices> |
| void | operate_impl (const std::vector< Number > &args, Number &result, std::index_sequence< Indices... >) const |
| | Operate on scalars (internal implementation).
|
|
| template<typename GivenType, std::size_t Index> |
| static constexpr bool | is_acceptable () |
| | Check whether the given type is acceptable for the argument at the given index.
|
| template<typename GivenType, std::size_t Index> |
| static auto | convert_to_acceptable_type (const GivenType &value) |
| | Convert the given value to an acceptable type for the argument at the given index.
|
| template<std::same_as< bool >... T> |
| static constexpr std::size_t | get_first_false (bool first, T... remaining) |
| | Get the index of the first false value.
|
| static constexpr std::size_t | get_first_false () |
| | Get the first false. (Variadic template base case).
|
|
| std::string | name_ |
| | Function name.
|
| FunctionType | function_ |
| | Function object to compute numbers.
|
template<typename FunctionType, AcceptableTypesSpec... AcceptableTypesPerArgument>
class func_sketch::math::GeneralMathFunction< FunctionType, AcceptableTypesPerArgument >
Class of general implementation of mathematical functions.
- Template Parameters
-
Definition at line 49 of file general_math_function.h.
◆ AcceptableTypesTuples
template<typename FunctionType, AcceptableTypesSpec... AcceptableTypesPerArgument>
◆ GeneralMathFunction()
template<typename FunctionType, AcceptableTypesSpec... AcceptableTypesPerArgument>
template<typename InputFunctionType>
Constructor.
- Template Parameters
-
| InputFunctionType | Type of the function object to compute numbers. |
- Parameters
-
| [in] | name | Name of the function. |
| [in] | function | Function object to compute numbers. |
Definition at line 59 of file general_math_function.h.
◆ name()
template<typename FunctionType, AcceptableTypesSpec... AcceptableTypesPerArgument>
◆ operator()()
template<typename FunctionType, AcceptableTypesSpec... AcceptableTypesPerArgument>
◆ operate_impl()
template<typename FunctionType, AcceptableTypesSpec... AcceptableTypesPerArgument>
template<std::size_t... Indices>
Operate on scalars (internal implementation).
- Template Parameters
-
| Indices | Indices of arguments. |
- Parameters
-
| [in] | args | Arguments. |
| [out] | result | Result. |
Definition at line 98 of file general_math_function.h.
◆ is_acceptable()
template<typename FunctionType, AcceptableTypesSpec... AcceptableTypesPerArgument>
template<typename GivenType, std::size_t Index>
|
|
inlinestaticnodiscardconstexprprivate |
Check whether the given type is acceptable for the argument at the given index.
- Template Parameters
-
| GivenType | Type of the given argument. |
| Index | Index of the argument. |
- Return values
-
| true | The given type is acceptable for the argument at the given index. |
| false | The given type is not acceptable for the argument at the given index. |
Definition at line 139 of file general_math_function.h.
◆ convert_to_acceptable_type()
template<typename FunctionType, AcceptableTypesSpec... AcceptableTypesPerArgument>
template<typename GivenType, std::size_t Index>
|
|
inlinestaticnodiscardprivate |
Convert the given value to an acceptable type for the argument at the given index.
- Template Parameters
-
| GivenType | Type of the given argument. |
| Index | Index of the argument. |
- Parameters
-
| [in] | value | Value to convert. |
- Returns
- Converted value.
Definition at line 157 of file general_math_function.h.
◆ get_first_false() [1/2]
template<typename FunctionType, AcceptableTypesSpec... AcceptableTypesPerArgument>
template<std::same_as< bool >... T>
|
|
inlinestaticnodiscardconstexprprivate |
Get the index of the first false value.
- Template Parameters
-
| T | Types of the remaining boolean values. |
- Parameters
-
| [in] | first | The first boolean value. |
| [in] | remaining | The remaining boolean values. |
- Returns
- Index of the first false value. Returns the size of the list if all values are true.
Definition at line 175 of file general_math_function.h.
◆ get_first_false() [2/2]
template<typename FunctionType, AcceptableTypesSpec... AcceptableTypesPerArgument>
|
|
inlinestaticnodiscardconstexprprivate |
Get the first false. (Variadic template base case).
- Returns
- Index of the first false value. Returns 0 in this base case.
Definition at line 188 of file general_math_function.h.
◆ name_
template<typename FunctionType, AcceptableTypesSpec... AcceptableTypesPerArgument>
◆ function_
template<typename FunctionType, AcceptableTypesSpec... AcceptableTypesPerArgument>
The documentation for this class was generated from the following file: