Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::Real2Proxy Class Reference

Class managing a 2-dimensional real vector. More...

#include <arcane/utils/Real2Proxy.h>

Collaboration diagram for Arcane::Real2Proxy:

Public Member Functions

 Real2Proxy (Real2 &value, const MemoryAccessInfo &info)
 Constructs the pair (ax,ay).
 Real2Proxy (const Real2Proxy &f)
 Constructs a pair identical to f.
const Real2operator= (Real2Proxy f)
const Real2operator= (Real2 f)
const Real2operator= (Real v)
 Assigns the pair (v,v) to the instance.
 operator Real2 () const
Real2 copy () const
 Returns a copy of the pair.
Real2Proxyreset ()
 Resets the pair with default constructors.
Real2Proxyassign (Real ax, Real ay)
 Assigns the pair (ax,ay,az) to the instance.
Real2Proxyassign (Real2 f)
 Copies the pair f.
bool isNearlyZero () const
 Compares the pair with the zero pair.
Real abs2 () const
 Returns the squared norm of the pair \(x^2+y^2+z^2\).
Real abs () const
 Returns the norm of the pair \(\sqrt{x^2+y^2+z^2}\).
istream & assign (istream &i)
 Reads a pair from the stream i The pair is read in the form of three #value_type values.
ostream & print (ostream &o) const
 Writes the pair to the stream o readable by an assign().
ostream & printXy (ostream &o) const
 Writes the pair to the stream o in the form (x,y).
Real2Proxyadd (Real2 b)
 Adds b to the pair.
Real2Proxysub (Real2 b)
 Subtracts b from the pair.
Real2Proxymul (Real2 b)
 Multiplies each component of the pair by the corresponding component of b.
Real2Proxydiv (Real2 b)
 Divides each component of the pair by the corresponding component of b.
Real2ProxyaddSame (Real b)
 Adds b to each component of the pair.
Real2ProxysubSame (Real b)
 Subtracts b from each component of the pair.
Real2ProxymulSame (Real b)
 Multiplies each component of the pair by b.
Real2ProxydivSame (Real b)
 Divides each component of the pair by b.
Real2Proxyoperator+= (Real2 b)
 Adds b to the pair.
Real2Proxyoperator-= (Real2 b)
 Subtracts b from the pair.
Real2Proxyoperator*= (Real2 b)
 Multiplies each component of the pair by the corresponding component of b.
void operator*= (Real b)
 Multiplies each component of the pair by the real b.
Real2Proxyoperator/= (Real2 b)
 Divides each component of the pair by the corresponding component of b.
void operator/= (Real b)
 Divides each component of the pair by the real b.
Real2 operator+ (Real2 b) const
 Creates a pair that equals this pair added to b.
Real2 operator- (Real2 b) const
 Creates a pair that equals b subtracted from this pair.
Real2 operator- () const
 Creates a pair opposite to the current pair.
Real2 operator* (Real2 b) const
 Creates a pair that equals this pair where each component has been multiplied by the corresponding component of b.
Real2 operator/ (Real2 b) const
 Creates a pair that equals this pair where each component has been divided by the corresponding component of b.
Real2Proxynormalize ()
 Normalizes the pair.
bool operator== (Real2 b) const
 Compares the pair to b.
bool operator!= (Real2 b) const
 Compares two pairs. For the notion of equality, see operator==().
Real2 getValue () const
Real2getValueMutable ()

Public Attributes

RealProxy x
 first component of the pair
RealProxy y
 second component of the pair

Static Private Member Functions

static bool _eq (Real a, Real b)
 Compares the values of a and b with the TypeEqualT comparator.
static Real _sqrt (Real a)
 Returns the square root of a.

Private Attributes

Real2m_value
MemoryAccessInfo m_info

(Note that these are not member symbols.)

ostream & operator<< (ostream &o, Real2Proxy t)
 Writes the pair t to the stream o.
istream & operator>> (istream &i, Real2Proxy &t)
 Reads the pair t from the stream o.

Detailed Description

Class managing a 2-dimensional real vector.

The vector comprises two components x and y which are of type Real.

Real2Proxy value (1.0,2.3); // Created a pair (x=1.0, y=2.3)
cout << value.x; // Prints the x component
value.y += 3.2; // Adds 3.2 to the \b y component
Real2Proxy(Real2 &value, const MemoryAccessInfo &info)
Constructs the pair (ax,ay).
Definition Real2Proxy.h:45

Definition at line 40 of file Real2Proxy.h.

Constructor & Destructor Documentation

◆ Real2Proxy() [1/2]

Arcane::Real2Proxy::Real2Proxy ( Real2 & value,
const MemoryAccessInfo & info )
inline

Constructs the pair (ax,ay).

Definition at line 45 of file Real2Proxy.h.

References x, and y.

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

Here is the caller graph for this function:

◆ Real2Proxy() [2/2]

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

Constructs a pair identical to f.

Definition at line 53 of file Real2Proxy.h.

References Real2Proxy(), x, and y.

Here is the call graph for this function:

Member Function Documentation

◆ _eq()

bool Arcane::Real2Proxy::_eq ( Real a,
Real b )
inlinestaticprivate

Compares the values of a and b with the TypeEqualT comparator.

Return values
trueif a and b are equal,
falseotherwise.

Definition at line 346 of file Real2Proxy.h.

References Arcane::math::isEqual().

Referenced by operator==().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _sqrt()

Real Arcane::Real2Proxy::_sqrt ( Real a)
inlinestaticprivate

Returns the square root of a.

Definition at line 352 of file Real2Proxy.h.

References Arcane::math::sqrt().

Referenced by abs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ abs()

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

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

Definition at line 151 of file Real2Proxy.h.

References _sqrt(), and abs2().

Referenced by normalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ abs2()

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

Returns the squared norm of the pair \(x^2+y^2+z^2\).

Definition at line 145 of file Real2Proxy.h.

References x, and y.

Referenced by abs().

Here is the caller graph for this function:

◆ add()

Real2Proxy & Arcane::Real2Proxy::add ( Real2 b)
inline

Adds b to the pair.

Definition at line 169 of file Real2Proxy.h.

References Real2Proxy(), Arcane::Real2POD::x, x, Arcane::Real2POD::y, and y.

Referenced by operator+=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addSame()

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

Adds b to each component of the pair.

Definition at line 201 of file Real2Proxy.h.

References Real2Proxy(), x, and y.

Here is the call graph for this function:

◆ assign() [1/2]

Real2Proxy & Arcane::Real2Proxy::assign ( Real ax,
Real ay )
inline

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

Definition at line 109 of file Real2Proxy.h.

References Real2Proxy(), x, and y.

Referenced by operator>>().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ assign() [2/2]

Real2Proxy & Arcane::Real2Proxy::assign ( Real2 f)
inline

Copies the pair f.

Definition at line 117 of file Real2Proxy.h.

References Real2Proxy(), Arcane::Real2POD::x, x, Arcane::Real2POD::y, and y.

Here is the call graph for this function:

◆ copy()

Real2 Arcane::Real2Proxy::copy ( ) const
inline

Returns a copy of the pair.

Definition at line 99 of file Real2Proxy.h.

◆ div()

Real2Proxy & Arcane::Real2Proxy::div ( Real2 b)
inline

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

Definition at line 193 of file Real2Proxy.h.

References Real2Proxy(), Arcane::Real2POD::x, x, Arcane::Real2POD::y, and y.

Referenced by operator/=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ divSame()

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

Divides each component of the pair by b.

Definition at line 225 of file Real2Proxy.h.

References Real2Proxy(), x, and y.

Referenced by normalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getValue()

Real2 Arcane::Real2Proxy::getValue ( ) const
inline

Definition at line 328 of file Real2Proxy.h.

◆ getValueMutable()

Real2 & Arcane::Real2Proxy::getValueMutable ( )
inline

Definition at line 333 of file Real2Proxy.h.

◆ isNearlyZero()

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

Compares the pair with the zero pair.

In the case of an integral #value_type, the pair 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 pair 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 \]

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

Definition at line 139 of file Real2Proxy.h.

References x, and y.

◆ mul()

Real2Proxy & Arcane::Real2Proxy::mul ( Real2 b)
inline

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

Definition at line 185 of file Real2Proxy.h.

References Real2Proxy(), Arcane::Real2POD::x, x, Arcane::Real2POD::y, and y.

Referenced by operator*=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mulSame()

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

Multiplies each component of the pair by b.

Definition at line 217 of file Real2Proxy.h.

References Real2Proxy(), x, and y.

Here is the call graph for this function:

◆ normalize()

Real2Proxy & Arcane::Real2Proxy::normalize ( )
inline

Normalizes the pair.

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

Definition at line 286 of file Real2Proxy.h.

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

Here is the call graph for this function:

◆ operator Real2()

Arcane::Real2Proxy::operator Real2 ( ) const
inline

Definition at line 78 of file Real2Proxy.h.

◆ operator!=()

bool Arcane::Real2Proxy::operator!= ( Real2 b) const
inline

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

Return values
trueif the two pairs are different,
falseotherwise.

Definition at line 321 of file Real2Proxy.h.

References operator==().

Here is the call graph for this function:

◆ operator*()

Real2 Arcane::Real2Proxy::operator* ( Real2 b) const
inline

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

Definition at line 271 of file Real2Proxy.h.

References Arcane::Real2POD::x, x, Arcane::Real2POD::y, and y.

◆ operator*=() [1/2]

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

Multiplies each component of the pair by the real b.

Definition at line 242 of file Real2Proxy.h.

References x, and y.

◆ operator*=() [2/2]

Real2Proxy & Arcane::Real2Proxy::operator*= ( Real2 b)
inline

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

Definition at line 239 of file Real2Proxy.h.

References mul(), and Real2Proxy().

Here is the call graph for this function:

◆ operator+()

Real2 Arcane::Real2Proxy::operator+ ( Real2 b) const
inline

Creates a pair that equals this pair added to b.

Definition at line 259 of file Real2Proxy.h.

References Arcane::Real2POD::x, x, Arcane::Real2POD::y, and y.

◆ operator+=()

Real2Proxy & Arcane::Real2Proxy::operator+= ( Real2 b)
inline

Adds b to the pair.

Definition at line 233 of file Real2Proxy.h.

References add(), and Real2Proxy().

Here is the call graph for this function:

◆ operator-() [1/2]

Real2 Arcane::Real2Proxy::operator- ( ) const
inline

Creates a pair opposite to the current pair.

Definition at line 265 of file Real2Proxy.h.

References x, and y.

◆ operator-() [2/2]

Real2 Arcane::Real2Proxy::operator- ( Real2 b) const
inline

Creates a pair that equals b subtracted from this pair.

Definition at line 262 of file Real2Proxy.h.

References Arcane::Real2POD::x, x, Arcane::Real2POD::y, and y.

◆ operator-=()

Real2Proxy & Arcane::Real2Proxy::operator-= ( Real2 b)
inline

Subtracts b from the pair.

Definition at line 236 of file Real2Proxy.h.

References Real2Proxy(), and sub().

Here is the call graph for this function:

◆ operator/()

Real2 Arcane::Real2Proxy::operator/ ( Real2 b) const
inline

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

Definition at line 277 of file Real2Proxy.h.

References Arcane::Real2POD::x, x, Arcane::Real2POD::y, and y.

◆ operator/=() [1/2]

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

Divides each component of the pair by the real b.

Definition at line 252 of file Real2Proxy.h.

References x, and y.

◆ operator/=() [2/2]

Real2Proxy & Arcane::Real2Proxy::operator/= ( Real2 b)
inline

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

Definition at line 249 of file Real2Proxy.h.

References div(), and Real2Proxy().

Here is the call graph for this function:

◆ operator=() [1/3]

const Real2 & Arcane::Real2Proxy::operator= ( Real v)
inline

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

Definition at line 73 of file Real2Proxy.h.

References x, and y.

◆ operator=() [2/3]

const Real2 & Arcane::Real2Proxy::operator= ( Real2 f)
inline

Definition at line 65 of file Real2Proxy.h.

◆ operator=() [3/3]

const Real2 & Arcane::Real2Proxy::operator= ( Real2Proxy f)
inline

Definition at line 59 of file Real2Proxy.h.

◆ operator==()

bool Arcane::Real2Proxy::operator== ( Real2 b) const
inline

Compares the pair to b.

In the case of an integral #value_type, two pairs 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 pairs 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 pairs are equal,
falseotherwise.

Definition at line 310 of file Real2Proxy.h.

References _eq(), Arcane::Real2POD::x, x, Arcane::Real2POD::y, and y.

Referenced by operator!=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

Real2Proxy & Arcane::Real2Proxy::reset ( )
inline

Resets the pair with default constructors.

Definition at line 102 of file Real2Proxy.h.

References Real2Proxy(), x, and y.

Here is the call graph for this function:

◆ sub()

Real2Proxy & Arcane::Real2Proxy::sub ( Real2 b)
inline

Subtracts b from the pair.

Definition at line 177 of file Real2Proxy.h.

References Real2Proxy(), Arcane::Real2POD::x, x, Arcane::Real2POD::y, and y.

Referenced by operator-=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subSame()

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

Subtracts b from each component of the pair.

Definition at line 209 of file Real2Proxy.h.

References Real2Proxy(), x, and y.

Here is the call graph for this function:

◆ operator<<()

ostream & operator<< ( ostream & o,
Real2Proxy t )
related

Writes the pair t to the stream o.

Definition at line 415 of file Real2Proxy.h.

References operator<<(), printXy(), and Real2Proxy().

Referenced by operator<<().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator>>()

istream & operator>> ( istream & i,
Real2Proxy & t )
related

Reads the pair t from the stream o.

Definition at line 426 of file Real2Proxy.h.

References assign(), and Real2Proxy().

Here is the call graph for this function:

Member Data Documentation

◆ m_info

MemoryAccessInfo Arcane::Real2Proxy::m_info
private

Definition at line 94 of file Real2Proxy.h.

◆ m_value

Real2& Arcane::Real2Proxy::m_value
private

Definition at line 93 of file Real2Proxy.h.

◆ x

◆ y


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