12#ifndef ARCANE_EXPR_WHEREEXPRESSIONIMPL_H
13#define ARCANE_EXPR_WHEREEXPRESSIONIMPL_H
17#include "arcane/expr/BadOperandException.h"
18#include "arcane/expr/ExpressionImpl.h"
19#include "arcane/expr/ExpressionResult.h"
38class ARCANE_EXPR_EXPORT WhereExpressionImpl
39:
public ExpressionImpl
94 if (test->type() != ArrayVariant::TBool)
98 if (size != test->size())
101 if (iftrue->type() || iffalse->type())
105 res->allocate(iftrue->type());
109 test->value(test_val);
111 res->
data()->value(res_val);
113 iftrue->value(iftrue_val);
115 iffalse->value(iffalse_val);
119 for (
Integer i = 0; i < size; ++i)
120 test_val[i] ? res_val[i] = iftrue_val[true_i++]
121 : res_val[i] = iffalse_val[false_i++];
Polymorphic base type for arrays (dimension 1).
Modifiable view of an array of type T.
constexpr const_pointer data() const noexcept
Pointer to the start of the view.
Exception for operands in expression operations.
Polymorphic base type of an expression.
Reference to an expression.
Interface for the different implementations of an expression.
virtual Integer vectorSize() const
Number of elements in the vector.
Expression m_iffalse
Expression evaluated when the test is negative.
Expression m_iftrue
Expression evaluated when the test is positive.
Expression m_test
Test expression.
Generic operator for conditional expressions.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
ConstArrayView< Integer > IntegerConstArrayView
C equivalent of a 1D array of integers.