12#ifndef ARCANE_UTILS_REAL2PROXY_H
13#define ARCANE_UTILS_REAL2PROXY_H
17#include "arcane/utils/Real2.h"
18#include "arcane/utils/BuiltInProxy.h"
65 const Real2& operator=(Real2 f)
78 operator Real2()
const
141 return math::isNearlyZero(
x.getValue()) && math::isNearlyZero(
y.getValue());
147 return x *
x +
y *
y;
328 Real2 getValue()
const
333 Real2& getValueMutable()
335 m_info.setReadOrWrite();
366 return Real2(vec.
x * sca, vec.
y * sca);
378 return Real2(vec.
x * sca, vec.
y * sca);
390 return Real2(vec.
x / sca, vec.
y / sca);
405 return v1.getValue() < v2.getValue();
Class managing a 2-dimensional real vector.
Real abs2() const
Returns the squared norm of the pair .
Real2 copy() const
Returns a copy of the pair.
void operator/=(Real b)
Divides each component of the pair by the real b.
RealProxy x
first component of the pair
Real2Proxy & subSame(Real b)
Subtracts b from each component of the pair.
Real2 operator*(Real2 b) const
Creates a pair that equals this pair where each component has been multiplied by the corresponding co...
Real2Proxy & mulSame(Real b)
Multiplies each component of the pair by b.
istream & operator>>(istream &i, Real2Proxy &t)
Reads the pair t from the stream o.
Real2Proxy & operator/=(Real2 b)
Divides each component of the pair by the corresponding component of b.
Real2Proxy & sub(Real2 b)
Subtracts b from the pair.
void operator*=(Real b)
Multiplies each component of the pair by the real b.
Real2Proxy & div(Real2 b)
Divides each component of the pair by the corresponding component of b.
Real2Proxy & assign(Real2 f)
Copies the pair f.
Real2 operator-() const
Creates a pair opposite to the current pair.
ostream & print(ostream &o) const
Writes the pair to the stream o readable by an assign().
Real2Proxy & add(Real2 b)
Adds b to the pair.
bool operator!=(Real2 b) const
Compares two pairs. For the notion of equality, see operator==().
Real abs() const
Returns the norm of the pair .
static Real _sqrt(Real a)
Returns the square root of a.
Real2Proxy & normalize()
Normalizes the pair.
Real2Proxy & operator-=(Real2 b)
Subtracts b from the pair.
Real2 operator+(Real2 b) const
Creates a pair that equals this pair added to b.
Real2Proxy & operator*=(Real2 b)
Multiplies each component of the pair by the corresponding component of b.
ostream & printXy(ostream &o) const
Writes the pair to the stream o in the form (x,y).
Real2Proxy & divSame(Real b)
Divides each component of the pair by b.
bool operator==(Real2 b) const
Compares the pair to b.
Real2Proxy & reset()
Resets the pair with default constructors.
Real2Proxy & addSame(Real b)
Adds b to each component of the pair.
Real2 operator/(Real2 b) const
Creates a pair that equals this pair where each component has been divided by the corresponding compo...
Real2Proxy & mul(Real2 b)
Multiplies each component of the pair by the corresponding component of b.
bool isNearlyZero() const
Compares the pair with the zero pair.
const Real2 & operator=(Real v)
Assigns the pair (v,v) to the instance.
ostream & operator<<(ostream &o, Real2Proxy t)
Writes the pair t to the stream o.
RealProxy y
second component of the pair
Real2Proxy & operator+=(Real2 b)
Adds b to the pair.
Real2Proxy & assign(Real ax, Real ay)
Assigns the pair (ax,ay,az) to the instance.
istream & assign(istream &i)
Reads a pair from the stream i The pair is read in the form of three value_type values.
Real2Proxy(Real2 &value, const MemoryAccessInfo &info)
Constructs the pair (ax,ay).
static bool _eq(Real a, Real b)
Compares the values of a and b with the TypeEqualT comparator.
Real2 operator-(Real2 b) const
Creates a pair that equals b subtracted from this pair.
Real2Proxy(const Real2Proxy &f)
Constructs a pair identical to f.
Class managing a 2-dimensional real vector.
Namespace for accelerator usage.
__host__ __device__ double sqrt(double v)
Square root of v.
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 --
bool operator<(const Item &item1, const Item &item2)
Compare two entities.
double Real
Type representing a real number.
Real2 operator/(const Real2Proxy &vec, Real sca)
Division by a scalar.
Real y
second component of the pair
Real x
first component of the pair