Class managing a 3-dimensional real vector. More...
#include <arcane/utils/Real3.h>
Public Member Functions | |
| constexpr __host__ __device__ | Real3 () |
| Constructs the zero vector. | |
| constexpr __host__ __device__ | Real3 (Real ax, Real ay, Real az) |
| Constructs the triplet (ax,ay,az). | |
| Real3 (const Real3 &f)=default | |
| Constructs a triplet identical to f. | |
| constexpr __host__ __device__ | Real3 (const Real3POD &f) |
| Constructs a triplet identical to f. | |
| constexpr __host__ __device__ | Real3 (Real v) |
| Constructs the instance with the triplet (v,v,v). | |
| constexpr __host__ __device__ | Real3 (const Real2 &f) |
| Constructs a triplet identical to f. | |
| constexpr __host__ __device__ | Real3 (ConstArrayView< Real > av) |
| Constructs the triplet (av[0], av[1], av[2]). | |
| Real3 & | operator= (const Real3 &f)=default |
| Copy assignment operator. | |
| constexpr __host__ __device__ Real3 & | operator= (Real v) |
| Assigns the triplet (v,v,v) to the instance. | |
| constexpr __host__ __device__ Real3 | copy () const |
| Returns a copy of the triplet. | |
| constexpr __host__ __device__ Real3 & | reset () |
| Resets the triplet using default constructors. | |
| constexpr __host__ __device__ Real3 & | assign (Real ax, Real ay, Real az) |
| Assigns the triplet (ax,ay,az) to the instance. | |
| constexpr __host__ __device__ Real3 & | assign (Real3 f) |
| Copies the triplet f. | |
| constexpr __host__ __device__ ArrayView< Real > | view () |
| Returns a view of the three elements of the vector. | |
| constexpr __host__ __device__ ConstArrayView< Real > | constView () const |
| Returns a constant view of the three elements of the vector. | |
| __host__ __device__ Real3 | absolute () const |
| Absolute value component by component. | |
| 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). | |
| constexpr __host__ __device__ Real3 & | add (Real3 b) |
| Adds b to the triplet. | |
| constexpr __host__ __device__ Real3 & | sub (Real3 b) |
| Subtracts b from the triplet. | |
| constexpr __host__ __device__ Real3 & | mul (Real3 b) |
| Multiplies each component of the triplet by the corresponding component of b. | |
| constexpr __host__ __device__ Real3 & | div (Real3 b) |
| Divides each component of the triplet by the corresponding component of b. | |
| constexpr __host__ __device__ Real3 & | addSame (Real b) |
| Adds b to each component of the triplet. | |
| constexpr __host__ __device__ Real3 & | subSame (Real b) |
| Subtracts b from each component of the triplet. | |
| constexpr __host__ __device__ Real3 & | mulSame (Real b) |
| Multiplies each component of the triplet by b. | |
| constexpr __host__ __device__ Real3 & | divSame (Real b) |
| Divides each component of the triplet by b. | |
| constexpr __host__ __device__ Real3 & | operator+= (Real3 b) |
| Adds b to the triplet. | |
| constexpr __host__ __device__ Real3 & | operator-= (Real3 b) |
| Subtracts b from the triplet. | |
| constexpr __host__ __device__ Real3 & | operator*= (Real3 b) |
| Multiplies each component of the triplet by the corresponding component of b. | |
| constexpr __host__ __device__ void | operator*= (Real b) |
| Multiplies each component of the triplet by the real number b. | |
| constexpr __host__ __device__ Real3 & | operator/= (Real3 b) |
| Divides each component of the triplet by the corresponding component of b. | |
| constexpr __host__ __device__ void | operator/= (Real b) |
| Divides each component of the triplet by the real number b. | |
| constexpr __host__ __device__ Real3 | operator+ (Real3 b) const |
| Creates a triplet that equals this triplet added to b. | |
| constexpr __host__ __device__ Real3 | operator- (Real3 b) const |
| Creates a triplet that equals b subtracted from this triplet. | |
| constexpr __host__ __device__ Real3 | operator- () const |
| Creates a triplet opposite to the current triplet. | |
| constexpr __host__ __device__ Real3 | operator* (Real3 b) const |
| Creates a triplet that equals this triplet whose each component has been multiplied by the corresponding component of b. | |
| constexpr __host__ __device__ Real3 | operator/ (Real3 b) const |
| Creates a triplet that equals this triplet whose each component has been divided by the corresponding component of b. | |
| constexpr __host__ __device__ bool | operator== (Real3 b) const |
| Compares the current instance component by component to b. | |
| constexpr __host__ __device__ bool | operator!= (Real3 b) const |
| Compares two triplets. For the notion of equality, see operator==(). | |
| constexpr __host__ __device__ Real | squareNormL2 () const |
| Returns the square of the L2 norm of the triplet $ \(x^2+y^2+z^2$\). | |
| __host__ __device__ Real | normL2 () const |
| Returns the L2 norm of the triplet $ \(\sqrt{x^2+y^2+z^2}\). | |
| constexpr __host__ __device__ Real | abs2 () const |
| Returns the square of the norm of the triplet $ \(x^2+y^2+z^2\). | |
| __host__ __device__ Real | abs () const |
| Returns the norm of the triplet $ \(\sqrt{x^2+y^2+z^2}\). | |
| constexpr __host__ __device__ bool | isNearlyZero () const |
| Real3 & | normalize () |
| Public Member Functions inherited from Arcane::Real3POD | |
| __host__ __device__ Real | operator[] (Integer i) const |
| __host__ __device__ Real | operator() (Integer i) const |
| __host__ __device__ Real & | operator[] (Integer i) |
| __host__ __device__ Real & | operator() (Integer i) |
| __host__ __device__ void | setComponent (Integer i, Real value) |
| Sets the i-th component to value. | |
Static Public Member Functions | |
| constexpr __host__ static __device__ Real3 | null () |
| constexpr __host__ static __device__ Real3 | zero () |
Friends | |
| constexpr __host__ __device__ Real3 | operator* (Real sca, Real3 vec) |
| Multiplication by a scalar. | |
| constexpr __host__ __device__ Real3 | operator* (Real3 vec, Real sca) |
| Multiplication by a scalar. | |
| constexpr __host__ __device__ Real3 | operator/ (Real3 vec, Real sca) |
| Division by a scalar. | |
| constexpr __host__ __device__ bool | operator< (Real3 v1, Real3 v2) |
| Comparison operator. | |
| std::ostream & | operator<< (std::ostream &o, Real3 t) |
| Writes the triplet t to the stream o. | |
| std::istream & | operator>> (std::istream &i, Real3 &t) |
| Reads the triplet t from the stream o. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<typename Type> | |
| std::istream & | operator>> (std::istream &i, BuiltInProxy< Type > &t) |
| Reads the triplet t from the stream o. | |
| std::ostream & | operator<< (std::ostream &o, Real3Proxy t) |
| Writes the triplet t to the stream o. | |
| std::istream & | operator>> (std::istream &i, Real3Proxy &t) |
| Reads the triplet t from the stream o. | |
| std::ostream & | operator<< (std::ostream &o, Real3x3Proxy t) |
| Writes the triplet t to the stream o. | |
| std::istream & | operator>> (std::istream &i, Real3x3Proxy &t) |
| Reads the triplet t from the stream o. | |
Additional Inherited Members | |
| 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 | |
Class managing a 3-dimensional real vector.
Le vector includes three components x, y, and z, which are of type Real.
or equivalently
|
inlineconstexpr |
Constructs the zero vector.
Definition at line 136 of file Real3.h.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Referenced by absolute(), add(), addSame(), assign(), assign(), copy(), div(), divSame(), mul(), mulSame(), operator!=(), operator*, operator*(), operator*, operator*=(), operator+(), operator+=(), operator-(), operator-(), operator-=(), operator/(), operator/, operator/=(), operator<, operator<<, operator=(), operator=(), operator==(), operator>>, Real3(), reset(), sub(), and subSame().
Constructs the triplet (ax,ay,az).
Definition at line 145 of file Real3.h.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inlineexplicitconstexpr |
Constructs a triplet identical to f.
Definition at line 157 of file Real3.h.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inlineexplicitconstexpr |
Constructs the instance with the triplet (v,v,v).
Definition at line 166 of file Real3.h.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inlineexplicitconstexpr |
Constructs a triplet identical to f.
Definition at line 173 of file Real3.h.
References Arcane::Real2POD::x, Arcane::Real3POD::x, Arcane::Real2POD::y, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inlineconstexpr |
Constructs the triplet (av[0], av[1], av[2]).
Definition at line 182 of file Real3.h.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inline |
Returns the norm of the triplet $ \(\sqrt{x^2+y^2+z^2}\).
Definition at line 590 of file Real3.h.
Referenced by MicroHydroModule::computeGeometricValues().
|
inlineconstexpr |
Returns the square of the norm of the triplet $ \(x^2+y^2+z^2\).
Definition at line 463 of file Real3.h.
References abs2(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Referenced by abs2().
|
inline |
Absolute value component by component.
Definition at line 248 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Adds b to the triplet.
Definition at line 263 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Referenced by operator+=().
Adds b to each component of the triplet.
Definition at line 299 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Assigns the triplet (ax,ay,az) to the instance.
Definition at line 218 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Referenced by operator>>.
Copies the triplet f.
Definition at line 227 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
| std::istream & Arcane::Real3::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 28 of file Real3.cc.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inlineconstexpr |
Returns a constant view of the three elements of the vector.
Definition at line 242 of file Real3.h.
References Arcane::Real3POD::x.
|
inlineconstexpr |
Divides each component of the triplet by the corresponding component of b.
Definition at line 290 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Referenced by operator/=().
Divides each component of the triplet by b.
Definition at line 326 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Referenced by Arcane::math::mutableNormalize().
|
inlineconstexpr |
Multiplies each component of the triplet by the corresponding component of b.
Definition at line 281 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Referenced by operator*=().
Multiplies each component of the triplet by b.
Definition at line 317 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inline |
Returns the L2 norm of the triplet $ \(\sqrt{x^2+y^2+z^2}\).
Definition at line 584 of file Real3.h.
Referenced by Arcane::math::axisSymmetric(), and Arcane::math::planarSymmetric().
|
inlinestaticconstexpr |
|
inlineconstexpr |
Compares two triplets. For the notion of equality, see operator==().
| true | if the two triplets are different, |
| false | otherwise. |
Definition at line 449 of file Real3.h.
References operator==(), and Real3().
Creates a triplet that equals this triplet whose each component has been multiplied by the corresponding component of b.
Definition at line 375 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inlineconstexpr |
Multiplies each component of the triplet by the real number b.
Definition at line 344 of file Real3.h.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Creates a triplet that equals this triplet added to b.
Definition at line 363 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inlineconstexpr |
Creates a triplet opposite to the current triplet.
Definition at line 369 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Creates a triplet that equals b subtracted from this triplet.
Definition at line 366 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Creates a triplet that equals this triplet whose each component has been divided by the corresponding component of b.
Definition at line 381 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inlineconstexpr |
Divides each component of the triplet by the real number b.
Definition at line 355 of file Real3.h.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Assigns the triplet (v,v,v) to the instance.
Definition at line 194 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inlineconstexpr |
Compares the current instance component by component to b.
| true | if this.x==b.x and this.y==b.y and this.z==b.z. |
| false | otherwise. |
Definition at line 438 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Referenced by operator!=().
| std::ostream & Arcane::Real3::print | ( | std::ostream & | o | ) | const |
Writes the triplet to the stream o readable by an assign().
Definition at line 38 of file Real3.cc.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
| std::ostream & Arcane::Real3::printXyz | ( | std::ostream & | o | ) | const |
Writes the triplet to the stream o in the form (x,y,z).
Definition at line 48 of file Real3.cc.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Referenced by operator<<.
|
inlineconstexpr |
Resets the triplet using default constructors.
Definition at line 211 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inlineconstexpr |
Returns the square of the L2 norm of the triplet $ \(x^2+y^2+z^2$\).
Definition at line 455 of file Real3.h.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Referenced by Arcane::GeometricUtilities::ProjectionInfo::isInside(), Arcane::GeometricUtilities::ProjectionInfo::isInside(), Arcane::GeometricUtilities::ProjectionInfo::projection(), and Arcane::GeometricUtilities::ProjectionInfo::projection().
Subtracts b from the triplet.
Definition at line 272 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Referenced by operator-=().
Subtracts b from each component of the triplet.
Definition at line 308 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Returns a view of the three elements of the vector.
Definition at line 236 of file Real3.h.
References Arcane::Real3POD::x.
|
inlinestaticconstexpr |
Multiplication by a scalar.
Definition at line 384 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Multiplication by a scalar.
Definition at line 390 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Division by a scalar.
Definition at line 396 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Comparison operator.
This operator allows sorting Real3 for example in std::set
Definition at line 409 of file Real3.h.
References Real3(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
friend |
Writes the triplet t to the stream o.
Definition at line 421 of file Real3.h.
References printXyz(), and Real3().
|
Writes the triplet t to the stream o.
Definition at line 432 of file Real3Proxy.h.
References Arcane::Real3Proxy::printXyz().
|
Writes the triplet t to the stream o.
Definition at line 272 of file Real3x3Proxy.h.
References Arcane::Real3x3Proxy::printXyz().
|
Reads the triplet t from the stream o.
Definition at line 166 of file BuiltInProxy.h.
|
friend |
|
Reads the triplet t from the stream o.
Definition at line 443 of file Real3Proxy.h.
References Arcane::Real3Proxy::assign().
|
Reads the triplet t from the stream o.
Definition at line 283 of file Real3x3Proxy.h.
References Arcane::Real3x3Proxy::assign().