MGIS 3.1.0
Loading...
Searching...
No Matches
mgis::function::internals::binary_operation_modifier< CallableType > Struct Template Reference

helper applying a stored binary operation to one or two evaluators More...

#include </home/runner/work/MFrontGenericInterfaceSupport/MFrontGenericInterfaceSupport/include/MGIS/Function/BinaryOperation.hxx>

Public Member Functions

MGIS_HOST_DEVICE constexpr binary_operation_modifier (const CallableType &)
 constructor
template<typename SecondEvaluatorType>
requires (EvaluatorConcept<std::decay_t<SecondEvaluatorType>>)
MGIS_HOST_DEVICE constexpr auto operator() (SecondEvaluatorType &&) const
 partially apply the binary operation to the evaluator of its second argument
template<typename FirstEvaluatorType, typename SecondEvaluatorType>
requires ((EvaluatorConcept<std::decay_t<FirstEvaluatorType>>)&& // (EvaluatorConcept<std::decay_t<SecondEvaluatorType>>)&& // (std::invocable< CallableType, evaluator_result<std::decay_t<FirstEvaluatorType>>, evaluator_result<std::decay_t<SecondEvaluatorType>>>))
MGIS_HOST_DEVICE constexpr auto operator() (FirstEvaluatorType &&, SecondEvaluatorType &&) const
 build the evaluator of the result of the binary operation

Detailed Description

template<typename CallableType>
struct mgis::function::internals::binary_operation_modifier< CallableType >

helper applying a stored binary operation to one or two evaluators

The binary operation is stored in the helper. Calling the helper with the evaluator of the second argument only gives a BinaryOperatorCurrying object, i.e. a modifier which is applied to the evaluator of the first argument. Calling the helper with the two evaluators gives the evaluator of the result of the binary operation.

Template Parameters
CallableTypetype of the binary operation, which must be copy constructible
Note
this helper does not match the EvaluatorModifierConcept concept itself: its single argument call operator returns such a modifier

Constructor & Destructor Documentation

◆ binary_operation_modifier()

template<typename CallableType>
MGIS_HOST_DEVICE constexpr mgis::function::internals::binary_operation_modifier< CallableType >::binary_operation_modifier ( const CallableType & c)
constexpr

constructor

stores a copy of the callable object

Parameters
[in]cbinary operation, a copy of it is stored in the helper

Member Function Documentation

◆ operator()() [1/2]

template<typename CallableType>
requires ((EvaluatorConcept<std::decay_t<FirstEvaluatorType>>)&& // (EvaluatorConcept<std::decay_t<SecondEvaluatorType>>)&& // (std::invocable< CallableType, evaluator_result<std::decay_t<FirstEvaluatorType>>, evaluator_result<std::decay_t<SecondEvaluatorType>>>))
template<typename FirstEvaluatorType, typename SecondEvaluatorType>
requires ((EvaluatorConcept<std::decay_t<FirstEvaluatorType>>)&& // (EvaluatorConcept<std::decay_t<SecondEvaluatorType>>)&& // (std::invocable< CallableType, evaluator_result<std::decay_t<FirstEvaluatorType>>, evaluator_result<std::decay_t<SecondEvaluatorType>>>))
MGIS_HOST_DEVICE constexpr auto mgis::function::internals::binary_operation_modifier< CallableType >::operator() ( FirstEvaluatorType && e1,
SecondEvaluatorType && e2 ) const
constexpr

build the evaluator of the result of the binary operation

builds a BinaryOperationModifier from the two evaluators

Template Parameters
FirstEvaluatorTypetype of the evaluator of the first argument, which may be a qualified type
SecondEvaluatorTypetype of the evaluator of the second argument, which may be a qualified type
Parameters
[in]e1evaluator used to compute the first argument
[in]e2evaluator used to compute the second argument
Returns
a BinaryOperationModifier object, i.e. an evaluator returning the values computed by the binary operation

◆ operator()() [2/2]

template<typename CallableType>
requires (EvaluatorConcept<std::decay_t<SecondEvaluatorType>>)
template<typename SecondEvaluatorType>
requires (EvaluatorConcept<std::decay_t<SecondEvaluatorType>>)
MGIS_HOST_DEVICE constexpr auto mgis::function::internals::binary_operation_modifier< CallableType >::operator() ( SecondEvaluatorType && e2) const
constexpr

partially apply the binary operation to the evaluator of its second argument

partially applies the operation to the given evaluator

Template Parameters
SecondEvaluatorTypetype of the evaluator, which may be a qualified type
Parameters
[in]e2evaluator used to compute the second argument
Returns
a BinaryOperatorCurrying object, which can be applied to the evaluator of the first argument using operator|

The documentation for this struct was generated from the following files: