|
| struct | mgis::function::internals::UnaryOperationBase< CallableType, EvaluatorType > |
| | helper base class giving the number of components of the values returned by a unary operation applied to an evaluator More...
|
| struct | mgis::function::UnaryOperation< CallableType, EvaluatorType > |
| | an evaluator applying a unary operation to the values returned by another evaluator More...
|
| struct | mgis::function::UnaryOperation2< CallableType, EvaluatorType > |
| | an evaluator applying a unary operation to the values returned by another evaluator, without storing this operation More...
|
| struct | mgis::function::internals::unary_operation_modifier< CallableType > |
| | a modifier building a UnaryOperation from a callable object which is stored in the modifier itself More...
|
| struct | mgis::function::internals::unary_operation_modifier2_impl< CallableType > |
| | a modifier building a UnaryOperation2 from a callable object which is not stored in the modifier More...
|
| struct | mgis::function::customization_points::AbsoluteValue< real > |
| | specialization for scalar values More...
|
| struct | mgis::function::customization_points::AbsoluteValue< std::span< const real, N > > |
| | specialization for constant fixed sized spans More...
|
| struct | mgis::function::customization_points::AbsoluteValue< std::array< real, N > > |
| | specialization for fixed sized arrays of scalar values More...
|
| struct | mgis::function::customization_points::MaximumComponent< real > |
| | specialization for scalar values More...
|
| struct | mgis::function::customization_points::MaximumComponent< std::span< const real, N > > |
| | specialization for constant fixed sized spans More...
|
| struct | mgis::function::customization_points::MaximumComponent< std::array< real, N > > |
| | specialization for fixed sized arrays of scalar values More...
|
| struct | mgis::function::customization_points::MinimumComponent< real > |
| | specialization for scalar values More...
|
| struct | mgis::function::customization_points::MinimumComponent< std::span< const real, N > > |
| | specialization for constant fixed sized spans More...
|
| struct | mgis::function::customization_points::MinimumComponent< std::array< real, N > > |
| | specialization for fixed sized arrays of scalar values More...
|
| struct | mgis::function::internals::AbsoluteValueOperator |
| | functor returning the absolute value of the values returned by an evaluator, using the customization_points::AbsoluteValue customization point More...
|
| struct | mgis::function::internals::MaximumComponentOperator |
| | functor returning the largest component of the values returned by an evaluator, using the customization_points::MaximumComponent customization point More...
|
| struct | mgis::function::internals::MinimumComponentOperator |
| | functor returning the smallest component of the values returned by an evaluator, using the customization_points::MinimumComponent customization point More...
|
This file declares the UnaryOperation and UnaryOperation2 classes, which build a new evaluator by applying a unary operation to the values returned by an existing evaluator, the unary_operation and transform functions used to build such evaluators, the customization points used to implement unary operations on the supported result types and the predefined modifiers absolute_value, maximum_component, minimum_component, negate, multiply_by_scalar and divide_by_scalar.
- Author
- Thomas Helfer
- Date
- 09/05/2025
- Copyright
- (C) Copyright Thomas Helfer 2018. Use, modification and distribution are subject to one of the following licences:
- GNU Lesser General Public License (LGPL), Version 3.0. (See accompanying file LGPL-3.0.txt)
- CECILL-C, Version 1.0 (See accompanying files CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt).
template<typename CallableType>
| auto mgis::function::transform |
( |
CallableType && | c | ) |
|
|
constexpr |
create a modifier transforming the values returned by an evaluator
alias of the single argument unary_operation function
This function is an alias of the unary_operation function, which is often more readable when the operation is a user defined lambda:
const auto e2 = e | transform([](const real v) { return v * v; });
- Template Parameters
-
| CallableType | type of the unary operation, which may be a qualified type |
- Parameters
-
| [in] | c | unary operation, a copy of it is stored in the modifier |
- Returns
- a internals::unary_operation_modifier object
template<typename CallableType, EvaluatorConcept EvaluatorType>
| auto mgis::function::transform |
( |
CallableType && | c, |
|
|
const EvaluatorType & | e ) |
|
constexpr |
transform the values returned by an evaluator
alias of the two arguments unary_operation function
This function is an alias of the unary_operation function taking an evaluator as second argument.
- Template Parameters
-
| CallableType | type of the unary operation, which may be a qualified type |
| EvaluatorType | type of the evaluator |
- Parameters
-
| [in] | c | unary operation, which must be callable with the values returned by the evaluator |
| [in] | e | evaluator whose values are modified |
- Returns
- a UnaryOperation object, i.e. an evaluator returning the values computed by the callable object
template<typename CallableType>
| auto mgis::function::unary_operation |
( |
CallableType && | c | ) |
|
|
constexpr |
create a modifier applying a unary operation to the values returned by an evaluator
creates a modifier storing a copy of the given callable
The returned modifier can be applied to an evaluator using operator| or composed with other modifiers, as in e | unary_operation(c1) | unary_operation(c2).
- Template Parameters
-
| CallableType | type of the unary operation, which may be a qualified type |
- Parameters
-
| [in] | c | unary operation, a copy of it is stored in the modifier |
- Returns
- a internals::unary_operation_modifier object