|
|
ace | CondMonad (predicate_type condition, ValueType value) |
| | Start a chain: value where condition holds.
|
|
ace predicate_type | condition () const |
| | The lanes some condition in the chain has claimed so far.
|
|
ace ValueType | value () const |
| | The values chosen so far; lanes no condition has claimed are unspecified until else_.
|
|
ace CondMonad | else_if_ (predicate_type new_condition, ValueType new_value) const |
| | new_value in the lanes where new_condition holds and no earlier condition did.
|
| ace CondMonad | else_if_ (predicate_type new_condition, scalar_type new_value) const |
| | new_value in the lanes where new_condition holds and no earlier condition did.
|
| template<std::invocable FunctionType> |
| ace CondMonad | else_if_ (predicate_type new_condition, FunctionType func) const |
| | new_value in the lanes where new_condition holds and no earlier condition did.
|
|
ace ValueType | else_ (ValueType new_value) const |
| | new_value in the lanes no condition claimed; ends the chain.
|
| ace ValueType | else_ (scalar_type new_value) const |
| | new_value in the lanes no condition claimed; ends the chain.
|
| template<std::invocable FunctionType> |
| ace ValueType | else_ (FunctionType func) const |
| | new_value in the lanes no condition claimed; ends the chain.
|
template<typename VectorType, typename ValueType>
requires (ValueType::lanes ==
Predicate<VectorType>::lanes)
class argon::CondMonad< VectorType, ValueType >
The result of if_(...) and each else_if_(...): a value chosen per lane by a chain of conditions.
- Template Parameters
-
| VectorType | The vector type the conditions were computed from. |
| ValueType | The Argon type of the values being chosen. |
Lanes take the value of the first condition that holds for them, as in an if / else-if chain; else_ supplies the value for lanes where none held and ends the chain. Every branch is evaluated (see ternary).