Class managing a 2-dimensional real vector. More...
#include <arcane/utils/Real2Proxy.h>
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 Real2 & | operator= (Real2Proxy f) |
| const Real2 & | operator= (Real2 f) |
| const Real2 & | operator= (Real v) |
| Assigns the pair (v,v) to the instance. | |
| operator Real2 () const | |
| Real2 | copy () const |
| Returns a copy of the pair. | |
| Real2Proxy & | reset () |
| Resets the pair with default constructors. | |
| Real2Proxy & | assign (Real ax, Real ay) |
| Assigns the pair (ax,ay,az) to the instance. | |
| Real2Proxy & | assign (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). | |
| Real2Proxy & | add (Real2 b) |
| Adds b to the pair. | |
| Real2Proxy & | sub (Real2 b) |
| Subtracts b from the pair. | |
| Real2Proxy & | mul (Real2 b) |
| Multiplies each component of the pair by the corresponding component of b. | |
| Real2Proxy & | div (Real2 b) |
| Divides each component of the pair by the corresponding component of b. | |
| Real2Proxy & | addSame (Real b) |
| Adds b to each component of the pair. | |
| Real2Proxy & | subSame (Real b) |
| Subtracts b from each component of the pair. | |
| Real2Proxy & | mulSame (Real b) |
| Multiplies each component of the pair by b. | |
| Real2Proxy & | divSame (Real b) |
| Divides each component of the pair by b. | |
| Real2Proxy & | operator+= (Real2 b) |
| Adds b to the pair. | |
| Real2Proxy & | operator-= (Real2 b) |
| Subtracts b from the pair. | |
| Real2Proxy & | operator*= (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. | |
| Real2Proxy & | operator/= (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. | |
| Real2Proxy & | normalize () |
| 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 |
| Real2 & | getValueMutable () |
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 | |
| Real2 & | m_value |
| MemoryAccessInfo | m_info |
Related Symbols | |
(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. | |
Class managing a 2-dimensional real vector.
The vector comprises two components x and y which are of type Real.
Definition at line 40 of file Real2Proxy.h.
|
inline |
Constructs the pair (ax,ay).
Definition at line 45 of file Real2Proxy.h.
Referenced by add(), addSame(), assign(), assign(), div(), divSame(), mul(), mulSame(), normalize(), operator*=(), operator+=(), operator-=(), operator/=(), operator<<(), operator>>(), Real2Proxy(), reset(), sub(), and subSame().
|
inline |
Constructs a pair identical to f.
Definition at line 53 of file Real2Proxy.h.
References Real2Proxy(), x, and y.
Compares the values of a and b with the TypeEqualT comparator.
| true | if a and b are equal, |
| false | otherwise. |
Definition at line 346 of file Real2Proxy.h.
References Arcane::math::isEqual().
Referenced by operator==().
Returns the square root of a.
Definition at line 352 of file Real2Proxy.h.
References Arcane::math::sqrt().
Referenced by abs().
|
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().
|
inline |
Returns the squared norm of the pair \(x^2+y^2+z^2\).
Definition at line 145 of file Real2Proxy.h.
Referenced by abs().
|
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+=().
|
inline |
Adds b to each component of the pair.
Definition at line 201 of file Real2Proxy.h.
References Real2Proxy(), x, and y.
|
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>>().
|
inline |
Copies the pair f.
Definition at line 117 of file Real2Proxy.h.
References Real2Proxy(), Arcane::Real2POD::x, x, Arcane::Real2POD::y, and y.
|
inline |
Returns a copy of the pair.
Definition at line 99 of file Real2Proxy.h.
|
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/=().
|
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().
|
inline |
Definition at line 328 of file Real2Proxy.h.
|
inline |
Definition at line 333 of file Real2Proxy.h.
|
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 \]
| true | if the pair is equal to the zero pair, |
| false | otherwise. |
Definition at line 139 of file Real2Proxy.h.
|
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*=().
|
inline |
Multiplies each component of the pair by b.
Definition at line 217 of file Real2Proxy.h.
References Real2Proxy(), x, and y.
|
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().
|
inline |
Definition at line 78 of file Real2Proxy.h.
|
inline |
Compares two pairs. For the notion of equality, see operator==().
| true | if the two pairs are different, |
| false | otherwise. |
Definition at line 321 of file Real2Proxy.h.
References operator==().
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.
|
inline |
Multiplies each component of the pair by the real b.
Definition at line 242 of file Real2Proxy.h.
|
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().
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.
|
inline |
Adds b to the pair.
Definition at line 233 of file Real2Proxy.h.
References add(), and Real2Proxy().
|
inline |
Creates a pair opposite to the current pair.
Definition at line 265 of file Real2Proxy.h.
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.
|
inline |
Subtracts b from the pair.
Definition at line 236 of file Real2Proxy.h.
References Real2Proxy(), and sub().
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.
|
inline |
Divides each component of the pair by the real b.
Definition at line 252 of file Real2Proxy.h.
|
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().
Assigns the pair (v,v) to the instance.
Definition at line 73 of file Real2Proxy.h.
Definition at line 65 of file Real2Proxy.h.
|
inline |
Definition at line 59 of file Real2Proxy.h.
|
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 \]
| true | if the two pairs are equal, |
| false | otherwise. |
Definition at line 310 of file Real2Proxy.h.
References _eq(), Arcane::Real2POD::x, x, Arcane::Real2POD::y, and y.
Referenced by operator!=().
|
inline |
Resets the pair with default constructors.
Definition at line 102 of file Real2Proxy.h.
References Real2Proxy(), x, and y.
|
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-=().
|
inline |
Subtracts b from each component of the pair.
Definition at line 209 of file Real2Proxy.h.
References Real2Proxy(), x, and y.
|
Writes the pair t to the stream o.
Definition at line 415 of file Real2Proxy.h.
References operator<<(), printXy(), and Real2Proxy().
Referenced by operator<<().
|
Reads the pair t from the stream o.
Definition at line 426 of file Real2Proxy.h.
References assign(), and Real2Proxy().
|
private |
Definition at line 94 of file Real2Proxy.h.
|
private |
Definition at line 93 of file Real2Proxy.h.
| RealProxy Arcane::Real2Proxy::x |
first component of the pair
Definition at line 88 of file Real2Proxy.h.
Referenced by abs2(), add(), addSame(), assign(), assign(), div(), divSame(), isNearlyZero(), mul(), mulSame(), Arcane::operator*(), Arcane::operator*(), operator*(), operator*=(), operator+(), operator-(), operator-(), Arcane::operator/(), operator/(), operator/=(), operator=(), operator==(), Real2Proxy(), Real2Proxy(), reset(), sub(), and subSame().
| RealProxy Arcane::Real2Proxy::y |
second component of the pair
Definition at line 89 of file Real2Proxy.h.
Referenced by abs2(), add(), addSame(), assign(), assign(), div(), divSame(), isNearlyZero(), mul(), mulSame(), Arcane::operator*(), Arcane::operator*(), operator*(), operator*=(), operator+(), operator-(), operator-(), Arcane::operator/(), operator/(), operator/=(), operator=(), operator==(), Real2Proxy(), Real2Proxy(), reset(), sub(), and subSame().