12#ifndef ARCANE_CORE_VARIABLEREFSCALAR_H
13#define ARCANE_CORE_VARIABLEREFSCALAR_H
17#include "arcane/core/VariableRef.h"
40template <
typename DataType>
75 : m_private_part(nullptr)
80 virtual bool isArrayVariable()
const {
return false; }
91 void operator=(
const DataType& v) {
assign(v); }
102 const DataType&
operator()()
const {
return m_private_part->value(); }
105 const DataType&
value()
const {
return m_private_part->value(); }
140 return math::isNearlyZero(m_private_part->value());
144 ARCANE_CORE_EXPORT
void assign(
const DataType& v);
154 PrivatePartType* m_private_part;
Various mathematical functions.
File containing declarations concerning the message passing model.
Modifiable view of an array of type T.
Constant view of an array of type T.
Parameters necessary for building a variable.
Information characterizing a variable.
VariableRefScalarT(const VariableBuildInfo &b)
Constructs a reference to a scalar variable specified in vb.
void refersTo(const VariableRefScalarT< DataType > &rhs)
Positions the instance's reference to the variable rhs.
const DataType & value() const
Scalar value.
void swapValues(VariableRefScalarT< DataType > &rhs)
Exchange the values of variable rhs with those of the instance.
virtual Integer arraySize() const
If the variable is an array, returns its dimension, otherwise returns 0.
bool isNearlyZero() const
Compares the variable with the value 0.
const DataType & operator()() const
Scalar value.
void reset()
Resets the variable to its default value.
VariableRefScalarT()
Default constructor.
bool isEqual(const DataType &v) const
Compares the variable with the value v.
VariableRefScalarT(IVariable *var)
Constructs a reference from var.
bool isNearlyEqual(const DataType &v) const
Compares the variable with the value v.
void reduce(Parallel::eReduceType type)
Performs a type type reduction on the variable.
VariableRef BaseClass
Type of the base class.
VariableRefScalarT(const VariableRefScalarT< DataType > &rhs)
Constructs a reference from rhs.
bool isZero() const
Compares the variable with the value 0.
void assign(const DataType &v)
Assigns the value v to the variable.
virtual void updateFromInternal()
Updates from the internal part.
DataType ElementType
Type of the variable elements.
VariableRef(const VariableBuildInfo &vbi)
Constructs a reference to a variable with the infos vbi.
Information characterizing the type of a variable.
eReduceType
Supported reduction types.
constexpr __host__ __device__ bool isNearlyEqual(const _Type &a, const _Type &b)
Tests if two values are approximately equal. For integer types, this function is equivalent to IsEqua...
bool isZero(const BuiltInProxy< _Type > &a)
Tests if a value is exactly equal to zero.
constexpr __host__ __device__ bool isEqual(const _Type &a, const _Type &b)
Tests the bit-by-bit equality between two values.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.