MGIS 3.1.0
Loading...
Searching...
No Matches
UnaryOperation.ixx File Reference

Implementation of the UnaryOperation and UnaryOperation2 classes, of the modifiers and of the helpers declared in MGIS/Function/UnaryOperation.hxx. More...

Namespaces

namespace  mgis
 the namespace mgis encloses all the MGIS project.

Functions

template<typename CallableType, EvaluatorConcept EvaluatorType>
constexpr mgis::size_type mgis::function::getNumberOfComponents (const UnaryOperation< CallableType, EvaluatorType > &) MGIS_NOEXCEPT
 return the number of components of the values returned by a unary operation
template<typename CallableType, EvaluatorConcept EvaluatorType>
constexpr mgis::size_type mgis::function::getNumberOfComponents (const UnaryOperation2< CallableType, EvaluatorType > &) MGIS_NOEXCEPT
 return the number of components of the values returned by a unary operation which does not store its callable object
template<typename CallableType>
constexpr auto mgis::function::internals::unary_operation_modifier2 (CallableType)
 the argument is only used to deduce the type of the unary operation
template<typename CallableType>
constexpr auto mgis::function::unary_operation (CallableType &&)
 create a modifier applying a unary operation to the values returned by an evaluator
template<typename CallableType, EvaluatorConcept EvaluatorType>
constexpr auto mgis::function::unary_operation (CallableType &&, const EvaluatorType &)
 apply a unary operation to the values returned by an evaluator
template<typename CallableType>
constexpr auto mgis::function::transform (CallableType &&)
 create a modifier transforming the values returned by an evaluator
template<typename CallableType, EvaluatorConcept EvaluatorType>
constexpr auto mgis::function::transform (CallableType &&, const EvaluatorType &)
 transform the values returned by an evaluator

Detailed Description

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

Function Documentation

◆ getNumberOfComponents() [1/2]

template<typename CallableType, EvaluatorConcept EvaluatorType>
mgis::size_type mgis::function::getNumberOfComponents ( const UnaryOperation2< CallableType, EvaluatorType > & e)
constexpr

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
CallableTypetype of the unary operation
EvaluatorTypetype of the evaluator whose values are modified
Parameters
[in]eunary operation
Returns
number of components of the values returned by the operation

◆ getNumberOfComponents() [2/2]

template<typename CallableType, EvaluatorConcept EvaluatorType>
mgis::size_type mgis::function::getNumberOfComponents ( const UnaryOperation< CallableType, EvaluatorType > & e)
constexpr

return the number of components of the values returned by a unary operation

forwards the call to the getNumberOfComponents member

Template Parameters
CallableTypetype of the unary operation
EvaluatorTypetype of the evaluator whose values are modified
Parameters
[in]eunary operation
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
CallableTypetype of the unary operation, which may be a qualified type
Parameters
[in]cunary 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
CallableTypetype of the unary operation, which may be a qualified type
EvaluatorTypetype of the evaluator
Parameters
[in]cunary operation, which must be callable with the values returned by the evaluator
[in]eevaluator 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
CallableTypetype of the unary operation, which may be a qualified type
Parameters
[in]cunary 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
CallableTypetype of the unary operation, which may be a qualified type
EvaluatorTypetype of the evaluator
Parameters
[in]cunary operation, which must be callable with the values returned by the evaluator
[in]eevaluator 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