an evaluator applying a unary operation to the values returned by another evaluator
More...
|
| MGIS_HOST_DEVICE constexpr | UnaryOperation (const CallableType &, const EvaluatorType &) |
| | constructor
|
| MGIS_HOST_DEVICE constexpr auto | apply (const evaluator_result< EvaluatorType > &) const |
| | apply the modifier
|
| constexpr | EvaluatorModifierBase (const EvaluatorType &) |
| | constructor
|
| constexpr decltype(auto) | getSpace () const |
| | return the underlying space
|
| constexpr bool | check (AbstractErrorHandler &) const |
| | perform consistency checks
|
| constexpr auto | operator() (const element_index< Space > &) const |
| | call operator: the value computed by the underlying evaluator is passed to the apply member function of the derived class
|
template<typename CallableType, EvaluatorConcept EvaluatorType>
requires ((std::is_copy_constructible_v<CallableType>)&&( std::invocable<CallableType,
evaluator_result<EvaluatorType>>))
struct mgis::function::UnaryOperation< CallableType, EvaluatorType >
an evaluator applying a unary operation to the values returned by another evaluator
Such an evaluator is usually built with the unary_operation or transform functions, which can either be applied directly to an evaluator or be composed with other modifiers using operator|:
const auto e2 = e |
transform([](
const real v) {
return v * v; });
constexpr auto transform(CallableType &&)
create a modifier transforming the values returned by an evaluator
Definition UnaryOperation.ixx:129
mgis_real real
alias to the numeric type used
Definition Config.hxx:140
The callable object is stored in the instance. The number of components of the returned values is the compile-time size of the type returned by the callable, which must thus be known at compile time. Only the call operators which match the way the underlying evaluator can be called are available, as they are inherited from EvaluatorModifierBase.
- Template Parameters
-
| CallableType | type of the unary operation, which must be copy constructible and callable with the values returned by the evaluator |
| EvaluatorType | type of the evaluator whose values are modified |