Implementation of the UnaryOperation and UnaryOperation2 classes, of the modifiers and of the helpers declared in MGIS/Function/UnaryOperation.hxx.
More...
|
| namespace | mgis |
| | the namespace mgis encloses all the MGIS project.
|
Implementation of the UnaryOperation and UnaryOperation2 classes, of the modifiers and of the helpers declared in MGIS/Function/UnaryOperation.hxx.
- 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).
◆ getNumberOfComponents() [1/2]
template<typename CallableType, EvaluatorConcept EvaluatorType>
return the number of components of the values returned by a unary operation which does not store its callable object
forwards the call to the getNumberOfComponents member
- Template Parameters
-
| CallableType | type of the unary operation |
| EvaluatorType | type of the evaluator whose values are modified |
- Parameters
-
- Returns
- number of components of the values returned by the operation
◆ getNumberOfComponents() [2/2]
template<typename CallableType, EvaluatorConcept EvaluatorType>
return the number of components of the values returned by a unary operation
forwards the call to the getNumberOfComponents member
- Template Parameters
-
| CallableType | type of the unary operation |
| EvaluatorType | type of the evaluator whose values are modified |
- Parameters
-
- Returns
- number of components of the values returned by the operation
◆ transform() [1/2]
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
◆ transform() [2/2]
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
◆ unary_operation() [1/2]
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
◆ unary_operation() [2/2]
template<typename CallableType, EvaluatorConcept EvaluatorType>
| auto mgis::function::unary_operation |
( |
CallableType && | c, |
|
|
const EvaluatorType & | e ) |
|
constexpr |
apply a unary operation to the values returned by an evaluator
applies the modifier to the given evaluator using operator|
- 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
◆ unary_operation_modifier2()
template<typename CallableType>
| auto mgis::function::internals::unary_operation_modifier2 |
( |
CallableType | | ) |
|
|
constexpr |
the argument is only used to deduce the type of the unary operation
create a modifier from a callable object which is only used to deduce the type of the unary operation