12#ifndef ARCANE_UTILS_REAL3PROXY_H
13#define ARCANE_UTILS_REAL3PROXY_H
17#include "arcane/utils/Real3.h"
18#include "arcane/utils/BuiltInProxy.h"
66 Real3 operator=(Real3 f)
82 operator Real3()
const
148 return math::isNearlyZero(
x.getValue()) && math::isNearlyZero(
y.getValue()) && math::isNearlyZero(
z.getValue());
154 return x *
x +
y *
y +
z *
z;
160 return _sqrt(
abs2());
167 std::istream& assign(std::istream& i);
170 std::ostream& print(std::ostream& o)
const;
173 std::ostream& printXyz(std::ostream& o)
const;
329 return _eq(a.
x, b.
x) && _eq(a.
y, b.
y) && _eq(a.
z, b.
z);
345 Real3 getValue()
const
350 Real3& getValueMutable()
352 m_info.setReadOrWrite();
363 static bool _eq(Real a, Real b)
365 return math::isEqual(a, b);
369 static Real _sqrt(Real a)
371 return math::sqrt(a);
383 return Real3(vec.
x * sca, vec.
y * sca, vec.
z * sca);
395 return Real3(vec.
x * sca, vec.
y * sca, vec.
z * sca);
407 return Real3(vec.
x / sca, vec.
y / sca, vec.
z / sca);
422 return v1.getValue() < v2.getValue();
Proxy of a language type.
Real3Proxy & assign(Real3 f)
Copies the triplet f.
Real3 operator-(Real3 b) const
Creates a triplet that equals b subtracted from this triplet.
RealProxy x
first component of the triplet
void operator*=(Real b)
Multiplies each component of the triplet by the real number b.
Real3Proxy & reset()
Resets the triplet with default constructors.
void operator/=(Real b)
Divides each component of the triplet by the real number b.
Real3Proxy & operator*=(Real3 b)
Multiplies each component of the triplet by the corresponding component of b.
Real abs2() const
Returns the square of the norm of the triplet .
friend bool operator!=(Real3Proxy a, Real3Proxy b)
Compares two triplets. For the notion of equality, see operator==().
RealProxy z
third component of the triplet
Real3 operator=(Real v)
Assigns the triplet (v,v,v) to the instance.
Real3 operator+(Real3 b) const
Creates a triplet that equals this triplet added to b.
Real3Proxy & operator/=(Real3 b)
Divides each component of the triplet 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...
bool isNearlyZero() const
Compares the triplet with the zero triplet.
Real3 copy() const
Returns a copy of the triplet.
Real3Proxy(Real3 &value, const MemoryAccessInfo &info)
Constructs the triplet (ax,ay,az).
RealProxy y
second component of the triplet
Real3Proxy & addSame(Real b)
Adds b to each component of the triplet.
Real3 operator-() const
Creates a triplet opposite to the current triplet.
Real3Proxy & assign(Real ax, Real ay, Real az)
Assigns the triplet (ax,ay,az) to the instance.
Real abs() const
Returns the norm of the triplet .
Real3Proxy & add(Real3 b)
Adds b to the triplet.
Real3Proxy & divSame(Real b)
Divides each component of the triplet by b.
Real3Proxy & sub(Real3 b)
Subtracts b from the triplet.
std::ostream & printXyz(std::ostream &o) const
Writes the triplet to the stream o in the form (x,y,z).
Real3Proxy(const Real3Proxy &f)
Constructs a triplet identical to f.
friend bool operator==(Real3Proxy a, Real3Proxy b)
Compares the triplet to b.
Real3Proxy & mul(Real3 b)
Multiplies each component of the triplet by the corresponding component of b.
Real3Proxy & operator+=(Real3 b)
Adds b to the triplet.
Real3Proxy & div(Real3 b)
Divides each component of the triplet by the corresponding component of b.
Real3Proxy & mulSame(Real b)
Multiplies each component of the triplet by b.
Real3Proxy & operator-=(Real3 b)
Subtracts b from the triplet.
Real3 operator*(Real3 b) const
Creates a triplet that equals this triplet whose each component has been multiplied by the correspond...
Real3Proxy & normalize()
Normalizes the triplet.
Real3Proxy & subSame(Real b)
Subtracts b from each component of the triplet.
Class managing a 3-dimensional real vector.
std::istream & operator>>(std::istream &i, Real3Proxy &t)
Reads the triplet t from the stream o.
bool isZero(const BuiltInProxy< _Type > &a)
Tests if a value is exactly equal to zero.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Real2 operator*(Real sca, const Real2Proxy &vec)
Multiplication by a scalar.
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.
std::ostream & operator<<(std::ostream &ostr, eItemKind item_kind)
Output operator for a stream.
Real y
second component of the triplet
Real z
third component of the triplet
Real x
first component of the triplet