12#ifndef ARCCORE_BASE_MATHREAL3_H
13#define ARCCORE_BASE_MATHREAL3_H
17#include "arccore/base/Real3.h"
18#include "arccore/base/MathBase.h"
34 return v.
x * v.
x + v.
y * v.
y + v.
z * v.
z;
43 inline constexpr ARCCORE_HOST_DEVICE
bool isNearlyZero(
const Real3& v)
45 return math::isNearlyZero(v.
x) && math::isNearlyZero(v.
y) && math::isNearlyZero(v.
z);
49 inline ARCCORE_HOST_DEVICE
Real normL2(
const Real3& v)
63 Real d = math::normL2(v);
77 Real d = math::normL2(v);
93inline constexpr ARCCORE_HOST_DEVICE
bool Real3::
96 return math::isNearlyZero(*
this);
102 return math::normL2(*
this);
108 return math::normL2(*
this);
Class managing a 3-dimensional real vector.
__host__ __device__ Real normL2() const
Returns the L2 norm of the triplet $ .
constexpr __host__ __device__ Real3 & divSame(Real b)
Divides each component of the triplet by b.
__host__ __device__ Real abs() const
Returns the norm of the triplet $ .
Namespace for mathematical functions.
Real2 normalizeL2(const Real2 &v)
Returns the pair v normalized by the L2 norm.
constexpr __host__ __device__ DataType squareNormL2(const NumVector< DataType, Size > &v)
Returns the square of the L2 norm of the vector.
bool isZero(const BuiltInProxy< _Type > &a)
Tests if a value is exactly equal to zero.
Real2 & mutableNormalize(Real2 &v)
Normalizes the pair.
apfloat sqrt(apfloat v)
Square root of v.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
double Real
Type representing a real number.
Real y
second component of the triplet
Real z
third component of the triplet
Real x
first component of the triplet