14#include "arcane/utils/ArcanePrecomp.h"
16#include "arcane/datatype/ArrayVariant.h"
18#include "arcane/expr/ArrayExpressionImpl.h"
19#include "arcane/expr/OperatorMng.h"
20#include "arcane/expr/BadOperationException.h"
65 res->
data()->value(res_val);
68 var_res.data()->value(var_val);
71 for (
Integer i = 0; i < size; ++i)
72 var_val[res_indices[i]] = res_val[i];
81 cerr <<
"** SIZE res=" << size <<
" var=" << vsize <<
" res=" << res <<
'\n';
87 VariantBase::eType type = var->type();
92 res->
data()->value(res_val);
95 var_res.data()->value(var_val);
98 for (
Integer i = 0; i < max_size; ++i)
99 res_val[i] = var_val[res_indices[i]];
112 switch (variant->type()) {
113 case VariantBase::TReal:
114 m_op = new ArrayOperatorT<Real>();
117 throw BadOperationException(
"ArrayExpressionImpl::ArrayExpressionImpl",
118 "bad type", variant->type());
126~ArrayExpressionImpl()
136void ArrayExpressionImpl::
139 ExpressionResult result(m_variant);
140 expr->apply(&result);
146void ArrayExpressionImpl::
149 ExpressionResult result(indices);
150 result.allocate(m_variant->type());
151 expr->apply(&result);
152 m_op->assign(&result, m_variant);
158void ArrayExpressionImpl::
161 m_op->evaluate(result, m_variant);
170 return m_variant->size();
Various mathematical functions.
virtual Integer vectorSize() const
Number of elements in the vector.
Generic binary operator for expressions.
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.
Constant view of an array of type T.
Base class for the expression implementation.
Polymorphic base type of an expression.
Interface for the different implementations of an expression.
__host__ __device__ Real2 min(Real2 a, Real2 b)
Returns the minimum of two Real2.
-- 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.