Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::Real3Proxy Class Reference

Proxy for a Real3. More...

#include <arcane/utils/Real3Proxy.h>

Public Member Functions

 Real3Proxy (Real3 &value, const MemoryAccessInfo &info)
 Constructs the triplet (ax,ay,az).
 Real3Proxy (const Real3Proxy &f)
 Constructs a triplet identical to f.
Real3 operator= (const Real3Proxy f)
Real3 operator= (Real3 f)
Real3 operator= (Real v)
 Assigns the triplet (v,v,v) to the instance.
 operator Real3 () const
Real3 copy () const
 Returns a copy of the triplet.
Real3Proxyreset ()
 Resets the triplet with default constructors.
Real3Proxyassign (Real ax, Real ay, Real az)
 Assigns the triplet (ax,ay,az) to the instance.
Real3Proxyassign (Real3 f)
 Copies the triplet f.
bool isNearlyZero () const
 Compares the triplet with the zero triplet.
Real abs2 () const
 Returns the square of the norm of the triplet \(x^2+y^2+z^2\).
Real abs () const
 Returns the norm of the triplet \(\sqrt{x^2+y^2+z^2}\).
std::istream & assign (std::istream &i)
 Reads a triplet from the stream i The triplet is read in the form of three values of type #value_type.
std::ostream & print (std::ostream &o) const
 Writes the triplet to the stream o readable by an assign().
std::ostream & printXyz (std::ostream &o) const
 Writes the triplet to the stream o in the form (x,y,z).
Real3Proxyadd (Real3 b)
 Adds b to the triplet.
Real3Proxysub (Real3 b)
 Subtracts b from the triplet.
Real3Proxymul (Real3 b)
 Multiplies each component of the triplet by the corresponding component of b.
Real3Proxydiv (Real3 b)
 Divides each component of the triplet by the corresponding component of b.
Real3ProxyaddSame (Real b)
 Adds b to each component of the triplet.
Real3ProxysubSame (Real b)
 Subtracts b from each component of the triplet.
Real3ProxymulSame (Real b)
 Multiplies each component of the triplet by b.
Real3ProxydivSame (Real b)
 Divides each component of the triplet by b.
Real3Proxyoperator+= (Real3 b)
 Adds b to the triplet.
Real3Proxyoperator-= (Real3 b)
 Subtracts b from the triplet.
Real3Proxyoperator*= (Real3 b)
 Multiplies each component of the triplet by the corresponding component of b.
void operator*= (Real b)
 Multiplies each component of the triplet by the real number b.
Real3Proxyoperator/= (Real3 b)
 Divides each component of the triplet by the corresponding component of b.
void operator/= (Real b)
 Divides each component of the triplet by the real number b.
Real3 operator+ (Real3 b) const
 Creates a triplet that equals this triplet added to b.
Real3 operator- (Real3 b) const
 Creates a triplet that equals b subtracted from this triplet.
Real3 operator- () const
 Creates a triplet opposite to the current triplet.
Real3 operator* (Real3 b) const
 Creates a triplet that equals this triplet whose each component has been multiplied by the corresponding component of b.
Real3 operator/ (Real3 b) const
 Creates a triplet that equals this triplet whose each component has been divided by the corresponding component of b.
Real3Proxynormalize ()
 Normalizes the triplet.
Real3 getValue () const
Real3getValueMutable ()
Public Member Functions inherited from Arcane::Real3POD
__host__ __device__ Real operator[] (Integer i) const
__host__ __device__ Real operator() (Integer i) const
__host__ __device__ Realoperator[] (Integer i)
__host__ __device__ Realoperator() (Integer i)
__host__ __device__ void setComponent (Integer i, Real value)
 Sets the i-th component to value.

Public Attributes

RealProxy x
 first component of the triplet
RealProxy y
 second component of the triplet
RealProxy z
 third component of the triplet
Public Attributes inherited from Arcane::Real3POD
Real x
 first component of the triplet
Real y
 second component of the triplet
Real z
 third component of the triplet

Friends

bool operator== (Real3Proxy a, Real3Proxy b)
 Compares the triplet to b.
bool operator!= (Real3Proxy a, Real3Proxy b)
 Compares two triplets. For the notion of equality, see operator==().

Detailed Description

Proxy for a Real3.

Definition at line 37 of file Real3Proxy.h.

Constructor & Destructor Documentation

◆ Real3Proxy() [1/2]

Arcane::Real3Proxy::Real3Proxy ( Real3 & value,
const MemoryAccessInfo & info )
inline

Constructs the triplet (ax,ay,az).

Definition at line 43 of file Real3Proxy.h.

References x, y, and z.

Referenced by add(), addSame(), assign(), assign(), div(), divSame(), mul(), mulSame(), normalize(), operator!=, operator*=(), operator+=(), operator-=(), operator/=(), operator==, Real3Proxy(), reset(), sub(), and subSame().

◆ Real3Proxy() [2/2]

Arcane::Real3Proxy::Real3Proxy ( const Real3Proxy & f)
inline

Constructs a triplet identical to f.

Definition at line 52 of file Real3Proxy.h.

References Real3Proxy(), x, y, and z.

Member Function Documentation

◆ abs()

Real Arcane::Real3Proxy::abs ( ) const
inline

Returns the norm of the triplet \(\sqrt{x^2+y^2+z^2}\).

Definition at line 158 of file Real3Proxy.h.

References abs2().

Referenced by normalize().

◆ abs2()

Real Arcane::Real3Proxy::abs2 ( ) const
inline

Returns the square of the norm of the triplet \(x^2+y^2+z^2\).

Definition at line 152 of file Real3Proxy.h.

References x, y, and z.

Referenced by abs().

◆ add()

Real3Proxy & Arcane::Real3Proxy::add ( Real3 b)
inline

Adds b to the triplet.

Definition at line 176 of file Real3Proxy.h.

References Real3Proxy(), Arcane::Real3POD::x, x, Arcane::Real3POD::y, y, Arcane::Real3POD::z, and z.

Referenced by operator+=().

◆ addSame()

Real3Proxy & Arcane::Real3Proxy::addSame ( Real b)
inline

Adds b to each component of the triplet.

Definition at line 212 of file Real3Proxy.h.

References Real3Proxy(), x, y, and z.

◆ assign() [1/3]

Real3Proxy & Arcane::Real3Proxy::assign ( Real ax,
Real ay,
Real az )
inline

Assigns the triplet (ax,ay,az) to the instance.

Definition at line 114 of file Real3Proxy.h.

References Real3Proxy(), x, y, and z.

Referenced by assign(), and Arcane::Real3::operator>>().

◆ assign() [2/3]

Real3Proxy & Arcane::Real3Proxy::assign ( Real3 f)
inline

Copies the triplet f.

Definition at line 123 of file Real3Proxy.h.

References Real3Proxy(), Arcane::Real3POD::x, x, Arcane::Real3POD::y, y, Arcane::Real3POD::z, and z.

◆ assign() [3/3]

std::istream & Arcane::Real3Proxy::assign ( std::istream & i)

Reads a triplet from the stream i The triplet is read in the form of three values of type #value_type.

Definition at line 61 of file Real3.cc.

References assign().

◆ copy()

Real3 Arcane::Real3Proxy::copy ( ) const
inline

Returns a copy of the triplet.

Definition at line 104 of file Real3Proxy.h.

References x, y, and z.

◆ div()

Real3Proxy & Arcane::Real3Proxy::div ( Real3 b)
inline

Divides each component of the triplet by the corresponding component of b.

Definition at line 203 of file Real3Proxy.h.

References Real3Proxy(), Arcane::Real3POD::x, x, Arcane::Real3POD::y, y, Arcane::Real3POD::z, and z.

Referenced by operator/=().

◆ divSame()

Real3Proxy & Arcane::Real3Proxy::divSame ( Real b)
inline

Divides each component of the triplet by b.

Definition at line 239 of file Real3Proxy.h.

References Real3Proxy(), x, y, and z.

Referenced by normalize().

◆ getValue()

Real3 Arcane::Real3Proxy::getValue ( ) const
inline

Definition at line 345 of file Real3Proxy.h.

◆ getValueMutable()

Real3 & Arcane::Real3Proxy::getValueMutable ( )
inline

Definition at line 350 of file Real3Proxy.h.

◆ isNearlyZero()

bool Arcane::Real3Proxy::isNearlyZero ( ) const
inline

Compares the triplet with the zero triplet.

In the case of an integral type #value_type, the triplet is zero if and only if each of its components is equal to 0.

For #value_type of the floating-point type (float, double or Real), the triplet is zero if and only if each of its components is less than a given epsilon. The value of the epsilon used is that of float_info<value_type>::nearlyEpsilon():

\[A=0 \Leftrightarrow |A.x|<\epsilon,|A.y|<\epsilon,|A.z|<\epsilon \]

Return values
trueif the triplet is equal to the zero triplet,
falseotherwise.

Definition at line 146 of file Real3Proxy.h.

References x, y, and z.

◆ mul()

Real3Proxy & Arcane::Real3Proxy::mul ( Real3 b)
inline

Multiplies each component of the triplet by the corresponding component of b.

Definition at line 194 of file Real3Proxy.h.

References Real3Proxy(), Arcane::Real3POD::x, x, Arcane::Real3POD::y, y, Arcane::Real3POD::z, and z.

Referenced by operator*=().

◆ mulSame()

Real3Proxy & Arcane::Real3Proxy::mulSame ( Real b)
inline

Multiplies each component of the triplet by b.

Definition at line 230 of file Real3Proxy.h.

References Real3Proxy(), x, y, and z.

◆ normalize()

Real3Proxy & Arcane::Real3Proxy::normalize ( )
inline

Normalizes the triplet.

If the triplet is non-zero, divides each component by the norm of the triplet (abs()), so that after calling this method, abs() equals 1. If the triplet is zero, does nothing.

Definition at line 303 of file Real3Proxy.h.

References abs(), divSame(), Arcane::math::isZero(), and Real3Proxy().

◆ operator Real3()

Arcane::Real3Proxy::operator Real3 ( ) const
inline

Definition at line 82 of file Real3Proxy.h.

◆ operator*()

Real3 Arcane::Real3Proxy::operator* ( Real3 b) const
inline

Creates a triplet that equals this triplet whose each component has been multiplied by the corresponding component of b.

Definition at line 288 of file Real3Proxy.h.

References Arcane::Real3POD::x, x, Arcane::Real3POD::y, y, Arcane::Real3POD::z, and z.

◆ operator*=() [1/2]

void Arcane::Real3Proxy::operator*= ( Real b)
inline

Multiplies each component of the triplet by the real number b.

Definition at line 257 of file Real3Proxy.h.

References x, y, and z.

◆ operator*=() [2/2]

Real3Proxy & Arcane::Real3Proxy::operator*= ( Real3 b)
inline

Multiplies each component of the triplet by the corresponding component of b.

Definition at line 254 of file Real3Proxy.h.

References mul(), and Real3Proxy().

◆ operator+()

Real3 Arcane::Real3Proxy::operator+ ( Real3 b) const
inline

Creates a triplet that equals this triplet added to b.

Definition at line 276 of file Real3Proxy.h.

References Arcane::Real3POD::x, x, Arcane::Real3POD::y, y, Arcane::Real3POD::z, and z.

◆ operator+=()

Real3Proxy & Arcane::Real3Proxy::operator+= ( Real3 b)
inline

Adds b to the triplet.

Definition at line 248 of file Real3Proxy.h.

References add(), and Real3Proxy().

◆ operator-() [1/2]

Real3 Arcane::Real3Proxy::operator- ( ) const
inline

Creates a triplet opposite to the current triplet.

Definition at line 282 of file Real3Proxy.h.

References x, y, and z.

◆ operator-() [2/2]

Real3 Arcane::Real3Proxy::operator- ( Real3 b) const
inline

Creates a triplet that equals b subtracted from this triplet.

Definition at line 279 of file Real3Proxy.h.

References Arcane::Real3POD::x, x, Arcane::Real3POD::y, y, Arcane::Real3POD::z, and z.

◆ operator-=()

Real3Proxy & Arcane::Real3Proxy::operator-= ( Real3 b)
inline

Subtracts b from the triplet.

Definition at line 251 of file Real3Proxy.h.

References Real3Proxy(), and sub().

◆ operator/()

Real3 Arcane::Real3Proxy::operator/ ( Real3 b) const
inline

Creates a triplet that equals this triplet whose each component has been divided by the corresponding component of b.

Definition at line 294 of file Real3Proxy.h.

References Arcane::Real3POD::x, x, Arcane::Real3POD::y, y, Arcane::Real3POD::z, and z.

◆ operator/=() [1/2]

void Arcane::Real3Proxy::operator/= ( Real b)
inline

Divides each component of the triplet by the real number b.

Definition at line 268 of file Real3Proxy.h.

References x, y, and z.

◆ operator/=() [2/2]

Real3Proxy & Arcane::Real3Proxy::operator/= ( Real3 b)
inline

Divides each component of the triplet by the corresponding component of b.

Definition at line 265 of file Real3Proxy.h.

References div(), and Real3Proxy().

◆ operator=() [1/3]

Real3 Arcane::Real3Proxy::operator= ( const Real3Proxy f)
inline

Definition at line 59 of file Real3Proxy.h.

◆ operator=() [2/3]

Real3 Arcane::Real3Proxy::operator= ( Real v)
inline

Assigns the triplet (v,v,v) to the instance.

Definition at line 75 of file Real3Proxy.h.

References x, y, and z.

◆ operator=() [3/3]

Real3 Arcane::Real3Proxy::operator= ( Real3 f)
inline

Definition at line 66 of file Real3Proxy.h.

◆ print()

std::ostream & Arcane::Real3Proxy::print ( std::ostream & o) const

Writes the triplet to the stream o readable by an assign().

Definition at line 71 of file Real3.cc.

References print().

Referenced by print().

◆ printXyz()

std::ostream & Arcane::Real3Proxy::printXyz ( std::ostream & o) const

Writes the triplet to the stream o in the form (x,y,z).

Definition at line 80 of file Real3.cc.

Referenced by Arcane::Real3::operator<<().

◆ reset()

Real3Proxy & Arcane::Real3Proxy::reset ( )
inline

Resets the triplet with default constructors.

Definition at line 107 of file Real3Proxy.h.

References Real3Proxy(), x, y, and z.

◆ sub()

Real3Proxy & Arcane::Real3Proxy::sub ( Real3 b)
inline

Subtracts b from the triplet.

Definition at line 185 of file Real3Proxy.h.

References Real3Proxy(), Arcane::Real3POD::x, x, Arcane::Real3POD::y, y, Arcane::Real3POD::z, and z.

Referenced by operator-=().

◆ subSame()

Real3Proxy & Arcane::Real3Proxy::subSame ( Real b)
inline

Subtracts b from each component of the triplet.

Definition at line 221 of file Real3Proxy.h.

References Real3Proxy(), x, y, and z.

◆ operator!=

bool operator!= ( Real3Proxy a,
Real3Proxy b )
friend

Compares two triplets. For the notion of equality, see operator==().

Return values
trueif the two triplets are different,
falseotherwise.

Definition at line 338 of file Real3Proxy.h.

References Real3Proxy().

◆ operator==

bool operator== ( Real3Proxy a,
Real3Proxy b )
friend

Compares the triplet to b.

In the case of an integral type #value_type, two triplets are equal if and only if each of their components are strictly equal.

For #value_type of the floating-point type (float, double or Real), two triplets are identical if and only if the absolute value of the difference between each of their corresponding components is less than a given epsilon. The value of the epsilon used is that of float_info<value_type>::nearlyEpsilon():

\[A=B \Leftrightarrow |A.x-B.x|<\epsilon,|A.y-B.y|<\epsilon,|A.z-B.z|<\epsilon \]

Return values
trueif the two triplets are equal,
falseotherwise.

Definition at line 327 of file Real3Proxy.h.

References Real3Proxy(), x, y, and z.

Member Data Documentation

◆ x

◆ y

◆ z


The documentation for this class was generated from the following files: