Namespace for mathematical functions. More...
Functions | |
| __host__ __device__ Real3 | vecMul (Real3 u, Real3 v) |
| Vector cross product of u by v in \(R^3\). | |
| __host__ __device__ Real | vecMul2D (Real3 u, Real3 v) |
| Vector cross product of u by v in \(R^2\). | |
| __host__ __device__ Real | cross2D (Real3 u, Real3 v) |
| Vector cross product of u by v in \(R^2\). | |
| __host__ __device__ Real | dot (Real2 u, Real2 v) |
| Dot product of u by v in \(R^2\). | |
| __host__ __device__ Real | scaMul (Real2 u, Real2 v) |
| Dot product of u by v in \(R^2\). | |
| __host__ __device__ Real | dot (Real3 u, Real3 v) |
| Dot product of u by v. | |
| __host__ __device__ Real | scaMul (Real3 u, Real3 v) |
| Dot product of u by v. | |
| __host__ __device__ Real | mixteMul (Real3 u, Real3 v, Real3 w) |
| Mixed product of u, v and w. | |
| __host__ __device__ Real | matDet (Real3 u, Real3 v, Real3 w) |
| Determinant of the matrix u,v,w. | |
| Real3x3 | prodTens (Real3 u, Real3 v) |
| Tensor product of two Real3 vectors. | |
| __host__ __device__ Real3 | prodTensVec (Real3x3 t, Real3 v) |
| Matrix-vector product between a tensor and a vector. | |
| __host__ __device__ Real2 | prodTensVec (Real2x2 t, Real2 v) |
| __host__ __device__ Real3 | prodVecTens (Real3 v, Real3x3 t) |
| Transposed(vector) matrix product between the transpose of a vector and a matrix. | |
| __host__ __device__ Real3x3 | matrixProduct (const Real3x3 &t, const Real3x3 &v) |
| Matrix-matrix product between two tensors. | |
| __host__ __device__ Real3x3 | transpose (const Real3x3 &t) |
| Transpose the matrix. | |
| __host__ __device__ Real3x3 | matrixTranspose (const Real3x3 &t) |
| Transpose the matrix. | |
| __host__ __device__ Real | doubleContraction (const Real3x3 &u, const Real3x3 &v) |
| __host__ __device__ Real | doubleContraction (const Real2x2 &u, const Real2x2 &v) |
| __host__ __device__ Real2 | min (Real2 a, Real2 b) |
| Returns the minimum of two Real2. | |
| __host__ __device__ Real3 | min (Real3 a, Real3 b) |
| Returns the minimum of two Real3s. | |
| __host__ __device__ Real2x2 | min (const Real2x2 &a, const Real2x2 &b) |
| Returns the minimum of two Real2x2s. | |
| __host__ __device__ Real3x3 | min (const Real3x3 &a, const Real3x3 &b) |
| Returns the minimum of two Real3x3s. | |
| template<class T> | |
| T | min (const T &a, const T &b, const T &c) |
| Returns the minimum of three elements. | |
| template<class T> | |
| T | max (const T &a, const T &b, const T &c) |
| Returns the maximum of three elements. | |
| __host__ __device__ Real2 | max (Real2 a, Real2 b) |
| Returns the maximum of two Real2s. | |
| __host__ __device__ Real3 | max (Real3 a, Real3 b) |
| Returns the maximum of two Real3s. | |
| __host__ __device__ Real2x2 | max (const Real2x2 &a, const Real2x2 &b) |
| Returns the maximum of two Real2x2s. | |
| __host__ __device__ Real3x3 | max (const Real3x3 &a, const Real3x3 &b) |
| Returns the maximum of two Real3x3s. | |
| __host__ __device__ Real | min4Real (Real a, Real b, Real c, Real d) |
| Returns the minimum of four Reals. | |
| __host__ __device__ Real | max4Real (Real a, Real b, Real c, Real d) |
| Returns the maximum of four Reals. | |
| __host__ __device__ Real | min8Real (const Real a[8]) |
| Returns the minimum of eight Reals. | |
| Real | max8Real (const Real a[8]) |
| Returns the maximum of eight Reals. | |
| __host__ __device__ Real | minMod (Real a, Real b, Real c, Real d) |
| Returns the Min mod of four Reals. | |
| __host__ __device__ Real | minMod2 (Real a, Real b) |
| Returns the Min mod of two Reals. | |
| __host__ __device__ Real | maxMod2 (Real a, Real b) |
| Returns the Max mod of two Reals. | |
| Real | relativeError (Real a, Real b) |
| Returns the relative error between two scalars a and b. | |
| Real | relativeError (const Real3x3 &T1, const Real3x3 &T2) |
| Returns the relative error between two tensors T1 and T2. | |
| Real | relativeError2 (Real a, Real b) |
| Returns the relative error between two scalars a and b relative to b. | |
| Real | relativeError1 (Real a, Real b) |
| Returns the relative error between two scalars a and b relative to a. | |
| bool | searchExtrema (ConstArrayView< Real2 > array, Real &xmin, Real &xmax, Real &ymin, Real &ymax, bool need_init) |
| Searches for the extreme values of an array of pairs (x,y). | |
| __host__ __device__ Real | matrixDeterminant (Real3x3 m) |
| Calculates the determinant of a 3x3 matrix. | |
| Real | normeR3 (Real3 v1) |
| Norm of a vector. | |
| __host__ __device__ Real3x3 | matrix3x3Id () |
| Identity matrix. | |
| __host__ __device__ Real3x3 | inverseMatrix (const Real3x3 &m, Real d) |
| Calculates the inverse of a matrix m assuming its determinant d is known. | |
| __host__ __device__ Real3x3 | inverseMatrix (const Real3x3 &m) |
| Calculates the inverse of a matrix m. | |
| Real3 | crossProduct3 (Real3 v1, Real3 v2) |
| Cross product of two 3-component vectors. | |
| __host__ __device__ Real3 | cross (Real3 v1, Real3 v2) |
| Cross product of two 3-component vectors. | |
| __host__ __device__ Real3 | normalizeReal3 (Real3 v) |
| Normalization of a Real3. | |
| Real3 | normalizedCrossProduct3 (Real3 v1, Real3 v2) |
| Normalized cross product. | |
| Real3x3 | matrix3x3Transp (Real3x3 m) |
| Real3x3 | matrix3x3Prod (Real3x3 m1, Real3x3 m2) |
| Multiplication of 2 3x3 matrices. | |
| __host__ __device__ Real3 | multiply (const Real3x3 &m, Real3 v) |
| 3x3 matrix multiplied by a vector. | |
| bool | isNearlyId (Real3x3 m, Real epsilon=1.e-10) |
| Checks if a matrix is the identity matrix. | |
| Real3 | planarSymmetric (Real3 u, Real3 n) |
| Symmetry of a vector u with respect to a normal plane n. | |
| Real3 | axisSymmetric (Real3 u, Real3 a) |
| Symmetry of a vector u with respect to an axis defined by direction vector a. | |
| template<typename T> | |
| void | add (ArrayView< T > lhs, ConstArrayView< T > copy_array) |
| Adds the array copy_array to the instance. | |
| template<typename T> | |
| void | add (ArrayView< T > lhs, ArrayView< T > copy_array) |
| Adds the array copy_array to the instance. | |
| template<typename T> | |
| void | sub (ArrayView< T > lhs, ConstArrayView< T > copy_array) |
| Subtracts the array copy_array from the instance. | |
| template<typename T> | |
| void | sub (ArrayView< T > lhs, ArrayView< T > copy_array) |
| Subtracts the array copy_array from the instance. | |
| template<typename T> | |
| void | mult (ArrayView< T > lhs, ConstArrayView< T > copy_array) |
| Multiplies the elements of the instance term-by-term by the elements of the array copy_array. | |
| template<typename T> | |
| void | mult (ArrayView< T > lhs, ArrayView< T > copy_array) |
| Multiplies the elements of the instance term-by-term by the elements of the array copy_array. | |
| template<typename T> | |
| void | mult (ArrayView< T > lhs, T o) |
| Multiplies all elements of the array by the real number o. | |
| template<typename T> | |
| void | power (ArrayView< T > lhs, T o) |
| Raises all elements of the array to the power o. | |
| Real | divide (Real a, Real b) |
| SimdReal3 | cross (const SimdReal3 &u, const SimdReal3 &v) |
| Vector product of u by v in R^3. | |
| SimdReal | cross2D (const SimdReal3 &u, const SimdReal3 &v) |
| Vector product of u by v in R^2. | |
| SimdReal | dot (const SimdReal3 &u, const SimdReal3 &v) |
| SimdReal | dot (const SimdReal2 &u, const SimdReal2 &v) |
| SimdReal | abs (const SimdReal3 &sr) |
| SimdReal | abs (const SimdReal2 &sr) |
| SimdReal | normL2 (const SimdReal3 &sr) |
| SimdReal | normL2 (const SimdReal2 &sr) |
| SimdReal | mixteMul (const SimdReal3 &u, const SimdReal3 &v, const SimdReal3 &w) |
| Mixed product of u, v and w. | |
| SimdReal3x3 | prodTens (const SimdReal3 &u, const SimdReal3 &v) |
| SimdReal3x3 | matrixProduct (const SimdReal3x3 &t, const SimdReal3x3 &v) |
| Matrix-matrix product between two tensors. | |
| SimdReal3x3 | matrixTranspose (const SimdReal3x3 &t) |
| Transpose the matrix. | |
| __host__ __device__ SimdReal2 | min (const SimdReal2 &a, const SimdReal2 &b) |
| Returns the minimum of two SimdReal2. | |
| __host__ __device__ SimdReal3 | min (const SimdReal3 &a, const SimdReal3 &b) |
| Returns the minimum of two SimdReal3. | |
| SimdReal2x2 | min (const SimdReal2x2 &a, const SimdReal2x2 &b) |
| Returns the minimum of two SimdReal2x2. | |
| SimdReal3x3 | min (const SimdReal3x3 &a, const SimdReal3x3 &b) |
| Returns the minimum of two SimdReal3x3. | |
| __host__ __device__ SimdReal2 | max (const SimdReal2 &a, const SimdReal2 &b) |
| Returns the maximum of two SimdReal2. | |
| __host__ __device__ SimdReal3 | max (const SimdReal3 &a, const SimdReal3 &b) |
| Returns the maximum of two SimdReal3. | |
| SimdReal2x2 | max (const SimdReal2x2 &a, const SimdReal2x2 &b) |
| Returns the maximum of two SimdReal2x2. | |
| SimdReal3x3 | max (const SimdReal3x3 &a, const SimdReal3x3 &b) |
| Returns the maximum of two SimdReal3x3. | |
| template<class _Type> | |
| bool | isNearlyZero (const BuiltInProxy< _Type > &a) |
| template<class _Type> | |
| bool | isZero (const BuiltInProxy< _Type > &a) |
| Tests if a value is exactly equal to zero. | |
| double | truncateDouble (double v, Integer nb_digit) |
| Truncates the precision of the real number v to nb_digit significant figures. | |
| void | truncateDouble (ArrayView< double > values, Integer nb_digit) |
| Truncates the precision of the array of real numbers values to nb_digit significant figures. | |
| apfloat | log (apfloat v) |
| Natural logarithm of v. | |
| apfloat | floor (apfloat v) |
| Round v down to the immediately lower integer. | |
| apfloat | exp (apfloat v) |
| Exponential of v. | |
| apfloat | sqrt (apfloat v) |
| Square root of v. | |
| apfloat | pow (apfloat x, apfloat y) |
| Power function. | |
| apfloat | min (apfloat a, apfloat b) |
| Returns the minimum of two real numbers. | |
| apfloat | max (apfloat a, apfloat b) |
| Returns the maximum of two real numbers. | |
| apfloat | abs (apfloat a) |
| Returns the absolute value of a real number. | |
| EMULSimdReal | min (EMULSimdReal a, EMULSimdReal b) |
| EMULSimdReal | min (EMULSimdReal a, Real b) |
| EMULSimdReal | min (Real a, EMULSimdReal b) |
| EMULSimdReal | max (EMULSimdReal a, EMULSimdReal b) |
| EMULSimdReal | max (EMULSimdReal a, Real b) |
| EMULSimdReal | max (Real a, EMULSimdReal b) |
| EMULSimdReal | sqrt (EMULSimdReal a) |
| EMULSimdReal | exp (EMULSimdReal a) |
| EMULSimdReal | log10 (EMULSimdReal a) |
| __host__ __device__ double | log (double v) |
| Natural logarithm of v. | |
| __host__ __device__ long double | log (long double v) |
| Natural logarithm of v. | |
| __host__ __device__ double | log10 (double v) |
| Decimal logarithm of v. | |
| __host__ __device__ long double | log10 (long double v) |
| Decimal logarithm of v. | |
| __host__ __device__ double | floor (double v) |
| Round v down to the immediately lower integer. | |
| __host__ __device__ long double | floor (long double v) |
| Round v down to the immediately lower integer. | |
| __host__ __device__ double | exp (double v) |
| Exponential of v. | |
| __host__ __device__ long double | exp (long double v) |
| Exponential of v. | |
| __host__ __device__ double | sqrt (double v) |
| Square root of v. | |
| __host__ __device__ long double | sqrt (long double v) |
| Square root of v. | |
| __host__ __device__ double | pow (double x, double y) |
| Power function. | |
| __host__ __device__ long double | pow (long double x, long double y) |
| Power function. | |
| __host__ __device__ long double | pow (double x, long double y) |
| Power function. | |
| __host__ __device__ long double | pow (long double x, double y) |
| Power function. | |
| template<class T> | |
| __host__ __device__ T | min (const T &a, const T &b) |
| Returns the minimum of two elements. | |
| __host__ __device__ long double | min (long double a, long double b) |
| Returns the minimum of two real numbers. | |
| __host__ __device__ long double | min (double a, long double b) |
| Returns the minimum of two real numbers. | |
| __host__ __device__ long double | min (long double a, double b) |
| Returns the minimum of two real numbers. | |
| __host__ __device__ double | min (double a, double b) |
| Returns the minimum of two real numbers. | |
| __host__ __device__ float | min (float a, float b) |
| Returns the minimum of two real numbers. | |
| __host__ __device__ int | min (int a, int b) |
| Returns the minimum of two integers. | |
| template<class T> | |
| __host__ __device__ T | max (const T &a, const T &b) |
| Returns the maximum of two elements. | |
| __host__ __device__ long double | max (long double a, long double b) |
| Returns the maximum of two real numbers. | |
| __host__ __device__ long double | max (double a, long double b) |
| Returns the maximum of two real numbers. | |
| __host__ __device__ long double | max (long double a, double b) |
| Returns the maximum of two real numbers. | |
| __host__ __device__ unsigned long | max (unsigned long a, unsigned long b) |
| Returns the maximum of two integers. | |
| __host__ __device__ double | max (double a, double b) |
| Returns the maximum of two real numbers. | |
| __host__ __device__ float | max (float a, float b) |
| Returns the maximum of two real numbers. | |
| __host__ __device__ Int16 | max (Int16 a, Int16 b) |
| Returns the maximum of two Int16. | |
| __host__ __device__ Int32 | max (Int32 a, Int32 b) |
| Returns the maximum of two Int32. | |
| __host__ __device__ Int64 | max (Int32 a, Int64 b) |
| Returns the maximum of two Int32. | |
| __host__ __device__ Int64 | max (Int64 a, Int32 b) |
| Returns the maximum of two Int64. | |
| __host__ __device__ Int64 | max (Int64 a, Int64 b) |
| Returns the maximum of two Int64. | |
| __host__ __device__ long double | abs (long double a) |
| Returns the absolute value of a real number. | |
| __host__ __device__ double | abs (double a) |
| Returns the absolute value of a real number. | |
| __host__ __device__ float | abs (float a) |
| Returns the absolute value of a real number. | |
| __host__ __device__ short | abs (short a) |
| Returns the absolute value of an 'int'. | |
| __host__ __device__ int | abs (int a) |
| Returns the absolute value of an 'int'. | |
| __host__ __device__ long | abs (long a) |
| Returns the absolute value of a 'long'. | |
| __host__ __device__ long long | abs (long long a) |
| Returns the absolute value of a 'long'. | |
| template<typename DataType, int Size> | |
| constexpr __host__ __device__ bool | isNearlyZero (const NumVector< DataType, Size > &v) |
| Compares the vector with the vector zero. | |
| template<typename DataType, int RowSize, int ColumnSize> | |
| constexpr __host__ __device__ bool | isNearlyZero (const NumMatrix< DataType, RowSize, ColumnSize > &v) |
| Compares the matrix with the zero matrix. | |
| template<typename DataType, int Size> | |
| constexpr __host__ __device__ DataType | squareNormL2 (const NumVector< DataType, Size > &v) |
| Returns the square of the L2 norm of the vector. | |
| template<typename DataType, int Size> | |
| __host__ __device__ Real | normL2 (const NumVector< DataType, Size > &v) |
| Returns the L2 norm of the vector. | |
| constexpr __host__ __device__ bool | isNearlyZero (const Real2 &v) |
| Indicates if the instance is close to the zero instance. | |
| constexpr __host__ __device__ Real | squareNormL2 (const Real2 &v) |
| Returns the squared norm of the pair $ \(x^2+y^2+z^2$\). | |
| __host__ __device__ Real | normL2 (const Real2 &v) |
| Returns the norm of the pair $ \(\sqrt{x^2+y^2+z^2}$\). | |
| Real2 & | mutableNormalize (Real2 &v) |
| Normalizes the pair. | |
| Real2 | normalizeL2 (const Real2 &v) |
| Returns the pair v normalized by the L2 norm. | |
| constexpr __host__ __device__ bool | isNearlyZero (const Real2x2 &v) |
| Compares the matrix with the zero matrix. | |
| constexpr __host__ __device__ Real | squareNormL2 (const Real3 &v) |
| Returns the square of the L2 norm of the triplet $ \(x^2+y^2+z^2\). | |
| constexpr __host__ __device__ bool | isNearlyZero (const Real3 &v) |
| Indicates if the instance is close to the zero instance. | |
| __host__ __device__ Real | normL2 (const Real3 &v) |
| Returns the L2 norm of the triplet $ \(\sqrt{v.x^2+v.y^2+v.z^2}\). | |
| Real3 & | mutableNormalize (Real3 &v) |
| Normalizes the triplet v. | |
| Real3 | normalizeL2 (const Real3 &v) |
| Returns the triplet v normalized with the L2 norm. | |
| constexpr __host__ __device__ bool | isNearlyZero (const Real3x3 &v) |
| Compares the matrix with the zero matrix. | |
| template<class Type> | |
| constexpr __host__ __device__ bool | isNearlyEqual (const Type &a, const Type &b) |
| Tests if two values are approximately equal. For integer types, this function is equivalent to IsEqual(). In the case of real types, the two numbers are considered equal if and only if the absolute value of their relative difference is less than a given epsilon. This epsilon is equal to float_info<Type>::nearlyEpsilon(). | |
| constexpr __host__ __device__ bool | isNearlyEqual (Real a, Real b) |
| Overload for reals. | |
| template<class Type> | |
| constexpr __host__ __device__ bool | isNearlyEqualWithEpsilon (const Type &a, const Type &b, const Type &epsilon) |
| Tests if two values are approximately equal. For integer types, this function is equivalent to IsEqual(). In the case of real types, the two numbers are considered equal if and only if the absolute value of their relative difference is less than epsilon. | |
| __host__ __device__ constexpr bool | isNearlyEqualWithEpsilon (Real a, Real b, Real epsilon) |
| Overload for reals. | |
| template<class Type> | |
| constexpr __host__ __device__ bool | isEqual (const Type &a, const Type &b) |
| Tests the bit-by-bit equality between two values. | |
| __host__ __device__ constexpr bool | isEqual (Real a, Real b) |
| Overload for reals. | |
| template<class Type> | |
| constexpr __host__ __device__ bool | isNearlyZeroWithEpsilon (const Type &a, const Type &epsilon) |
| Tests if a value is approximately equal to zero within an epsilon. | |
| template<class Type> | |
| constexpr __host__ __device__ bool | isNearlyZero (const Type &a) |
| Tests if a value is approximately equal to zero using the standard epsilon. | |
| template<class Type> | |
| constexpr __host__ __device__ bool | isZero (const Type &a) |
| Tests if a value is exactly equal to zero. | |
Namespace for mathematical functions.
This namespace contains all the mathematical functions used by the code.
This namespace contains all mathematical functions used by the code.
Definition at line 76 of file SimdMathUtils.h.
Definition at line 63 of file SimdMathUtils.h.
|
inline |
Adds the array copy_array to the instance.
Since no memory allocation is performed, the number of elements in copy_array must be less than or equal to the current number of elements. If it is smaller, the elements of the current array located at the end of the array remain unchanged
Definition at line 946 of file MathUtils.h.
References Arcane::ArrayView< T >::data(), and Arcane::ArrayView< T >::size().
|
inline |
Adds the array copy_array to the instance.
Since no memory allocation is performed, the number of elements in copy_array must be less than or equal to the current number of elements. If it is smaller, the elements of the current array located at the end of the array remain unchanged
Definition at line 927 of file MathUtils.h.
References Arcane::ArrayView< T >::data(), Arcane::ConstArrayView< T >::data(), Arcane::ArrayView< T >::size(), and Arcane::ConstArrayView< T >::size().
Vector product of u by v in R^3.
Definition at line 32 of file SimdMathUtils.h.
Vector product of u by v in R^2.
Definition at line 44 of file SimdMathUtils.h.
Cross product of two 3-component vectors.
Definition at line 741 of file MathUtils.h.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Definition at line 56 of file SimdMathUtils.h.
Definition at line 50 of file SimdMathUtils.h.
|
inline |
} U_{i,j}V_{i,j}
Definition at line 324 of file MathUtils.h.
References Arcane::Real2POD::x, Arcane::Real2x2::x, Arcane::Real2POD::y, and Arcane::Real2x2::y.
|
inline |
} U_{i,j}V_{i,j}
Definition at line 297 of file MathUtils.h.
References Arcane::Real3POD::x, Arcane::Real3x3::x, Arcane::Real3POD::y, Arcane::Real3x3::y, Arcane::Real3POD::z, and Arcane::Real3x3::z.
|
inline |
Exponential of v.
Definition at line 57 of file MathApfloat.h.
|
inline |
Exponential of v.
Definition at line 121 of file MathBase.h.
|
inline |
Definition at line 118 of file SimdOperation.h.
|
inline |
Exponential of v.
Definition at line 130 of file MathBase.h.
|
inline |
Round v down to the immediately lower integer.
Definition at line 45 of file MathApfloat.h.
Referenced by Arcane::OutputChecker::check(), pow(), pow(), and pow().
|
inline |
Round v down to the immediately lower integer.
Definition at line 100 of file MathBase.h.
|
inline |
Round v down to the immediately lower integer.
Definition at line 109 of file MathBase.h.
Calculates the inverse of a matrix m.
Definition at line 726 of file MathUtils.h.
References Arcane::Real3x3::determinant(), and inverseMatrix().
Calculates the inverse of a matrix m assuming its determinant d is known.
Definition at line 710 of file MathUtils.h.
References Arcane::Real3POD::x, Arcane::Real3x3::x, Arcane::Real3POD::y, Arcane::Real3x3::y, Arcane::Real3POD::z, and Arcane::Real3x3::z.
Referenced by inverseMatrix().
|
inlineconstexpr |
Tests the bit-by-bit equality between two values.
| true | if the two values are equal, |
| false | otherwise. |
Definition at line 269 of file TypeEqual.h.
References Arcane::TypeEqualT< T >::isEqual().
Referenced by Arcane::Real2Proxy::_eq(), Arcane::Real3Proxy::_eq(), Arcane::CaseTable::_findValue(), Arcane::OutputChecker::check(), and Arcane::VariableRefScalarT< Byte >::isEqual().
Overload for reals.
Definition at line 276 of file TypeEqual.h.
References Arcane::TypeEqualT< T >::isEqual().
|
inlineconstexpr |
Tests if two values are approximately equal. For integer types, this function is equivalent to IsEqual(). In the case of real types, the two numbers are considered equal if and only if the absolute value of their relative difference is less than a given epsilon. This epsilon is equal to float_info<Type>::nearlyEpsilon().
| true | if the two values are equal, |
| false | otherwise. |
Definition at line 228 of file TypeEqual.h.
References Arcane::TypeEqualT< T >::isNearlyEqual().
Referenced by Arcane::MshParallelMeshReader::_computeNodesPartition(), Arcane::SimpleGridMeshPartitioner::_findPart(), Arcane::SimpleTableInternalComparator::compare(), Arcane::SimpleTableInternalComparator::compareElem(), Arcane::UnstructuredMeshUtilities::computeNormal(), Arcane::SodStandardGroupsBuilder::generateGroups(), and Arcane::VariableRefScalarT< Byte >::isNearlyEqual().
Overload for reals.
Definition at line 235 of file TypeEqual.h.
References Arcane::TypeEqualT< T >::isNearlyEqual().
|
inlineconstexpr |
Tests if two values are approximately equal. For integer types, this function is equivalent to IsEqual(). In the case of real types, the two numbers are considered equal if and only if the absolute value of their relative difference is less than epsilon.
| true | if the two values are equal, |
| false | otherwise. |
Definition at line 251 of file TypeEqual.h.
References Arcane::TypeEqualT< T >::isNearlyEqualWithEpsilon().
Referenced by Arcane::SimpleTableInternalComparator::compare(), and Arcane::SimpleTableInternalComparator::compareElem().
|
inlineconstexpr |
Overload for reals.
Definition at line 258 of file TypeEqual.h.
References Arcane::TypeEqualT< T >::isNearlyEqualWithEpsilon().
Checks if a matrix is the identity matrix.
Definition at line 861 of file MathUtils.h.
References Arcane::Real3POD::x, Arcane::Real3x3::x, Arcane::Real3POD::y, Arcane::Real3x3::y, Arcane::Real3POD::z, and Arcane::Real3x3::z.
|
inline |
Definition at line 180 of file BuiltInProxy.h.
|
constexpr |
Compares the matrix with the zero matrix.
The matrix is zero if and only if each of its components is less than a given epsilon. The epsilon value used is that of float_info<value_type>::nearlyEpsilon():
\[A=0 \Leftrightarrow |A.x|<\epsilon,|A.y|<\epsilon,|A.z|<\epsilon \]
| true | if the matrix is equal to the zero matrix, |
| false | otherwise. |
Definition at line 64 of file MathNumeric.h.
|
constexpr |
Compares the vector with the vector zero.
The matrix is nearly zero if and only if each of its components is less than a given epsilon. The epsilon value used is that of FloatInfo<DataType>::nearlyEpsilon():
\[A=0 \Leftrightarrow |A.x|<\epsilon,|A.y|<\epsilon,|A.z|<\epsilon \]
Definition at line 42 of file MathNumeric.h.
|
inlineconstexpr |
Indicates if the instance is close to the zero instance.
| true | if math::isNearlyZero() is true for every component. |
| false | otherwise. |
Definition at line 31 of file MathReal2.h.
References Arcane::Real2POD::x, and Arcane::Real2POD::y.
|
constexpr |
Compares the matrix with the zero matrix.
The matrix is zero if and only if each of its components is less than a given epsilon. The epsilon value used is that of float_info<value_type>::nearlyEpsilon():
\[A=0 \Leftrightarrow |A.x|<\epsilon,|A.y|<\epsilon\]
| true | if the matrix is equal to the zero matrix, |
| false | otherwise. |
Definition at line 36 of file MathReal2x2.h.
References Arcane::Real2x2::x, and Arcane::Real2x2::y.
|
inlineconstexpr |
Indicates if the instance is close to the zero instance.
| true | if math::isNearlyZero() is true for every component. |
| false | otherwise. |
Definition at line 43 of file MathReal3.h.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inlineconstexpr |
Compares the matrix with the zero matrix.
The matrix is zero if and only if each of its components is less than a given epsilon. The epsilon value used is that of float_info<value_type>::nearlyEpsilon():
\[A=0 \Leftrightarrow |A.x|<\epsilon,|A.y|<\epsilon,|A.z|<\epsilon \]
| true | if the matrix is equal to the zero matrix, |
| false | otherwise. |
Definition at line 36 of file MathReal3x3.h.
References Arcane::Real3x3::x, Arcane::Real3x3::y, and Arcane::Real3x3::z.
|
inlineconstexpr |
Tests if a value is approximately equal to zero using the standard epsilon.
The standard epsilon is the one returned by FloatInfo<Type>::nearlyEpsilon().
Definition at line 305 of file TypeEqual.h.
References Arcane::TypeEqualT< T >::isNearlyZero().
|
inlineconstexpr |
Tests if a value is approximately equal to zero within an epsilon.
For integer types, this function is equivalent to IsZero(). In the case of real types, the value is considered equal to zero if and only if its absolute value is less than an epsilon given by the function float_info<Type>::nearlyEpsilon().
| true | if the two values are equal, |
| false | otherwise. |
Definition at line 292 of file TypeEqual.h.
|
inline |
Tests if a value is exactly equal to zero.
| true | if is zero, |
| false | otherwise. |
Definition at line 190 of file BuiltInProxy.h.
References Arcane::TypeEqualT< T >::isZero().
Referenced by Arcane::ArcaneLoadBalanceModule::_computeWeights(), Arcane::CaseTable::_findValue(), Arcane::OutputChecker::check(), Arcane::UnstructuredMeshUtilities::computeDirection(), Arcane::UnstructuredMeshUtilities::computeNormal(), Arcane::VariableRefScalarT< Byte >::isZero(), Arcane::mesh::ParallelAMRConsistency::makeNewItemsConsistent(), mutableNormalize(), mutableNormalize(), Arcane::Real2Proxy::normalize(), Arcane::Real3Proxy::normalize(), normalizeL2(), normalizeL2(), Arcane::MatVec::Matrix::read(), relativeError(), relativeError1(), relativeError2(), and Arcane::CaseMng::updateOptions().
|
inlineconstexpr |
Tests if a value is exactly equal to zero.
| true | if is zero, |
| false | otherwise. |
Definition at line 316 of file TypeEqual.h.
References Arcane::TypeEqualT< T >::isZero().
|
inline |
Natural logarithm of v.
Definition at line 32 of file MathApfloat.h.
References Arcane::arcaneMathError(), and Arcane::Convert::toDouble().
|
inline |
Natural logarithm of v.
Definition at line 42 of file MathBase.h.
References Arcane::arcaneMathError().
|
inline |
Natural logarithm of v.
Definition at line 55 of file MathBase.h.
References Arcane::arcaneMathError().
|
inline |
Decimal logarithm of v.
Definition at line 71 of file MathBase.h.
References Arcane::arcaneMathError().
|
inline |
Definition at line 127 of file SimdOperation.h.
|
inline |
Decimal logarithm of v.
Definition at line 84 of file MathBase.h.
References Arcane::arcaneMathError().
Determinant of the matrix u,v,w.
Definition at line 173 of file MathUtils.h.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inline |
Identity matrix.
Definition at line 696 of file MathUtils.h.
Multiplication of 2 3x3 matrices.
Definition at line 827 of file MathUtils.h.
References Arcane::Real3x3::fromColumns(), Arcane::Real3POD::x, Arcane::Real3x3::x, Arcane::Real3POD::y, Arcane::Real3x3::y, Arcane::Real3POD::z, and Arcane::Real3x3::z.
Calculates the determinant of a 3x3 matrix.
Definition at line 670 of file MathUtils.h.
References Arcane::Real3x3::determinant().
|
inline |
Definition at line 87 of file SimdOperation.h.
|
inline |
Definition at line 92 of file SimdOperation.h.
|
inline |
Definition at line 97 of file SimdOperation.h.
Returns the maximum of four Reals.
Definition at line 477 of file MathUtils.h.
References max().
Referenced by max8Real(), and minMod().
Returns the maximum of eight Reals.
Definition at line 500 of file MathUtils.h.
References max(), and max4Real().
|
inline |
Definition at line 70 of file SimdOperation.h.
|
inline |
Definition at line 75 of file SimdOperation.h.
|
inline |
Definition at line 80 of file SimdOperation.h.
Returns the minimum of four Reals.
Definition at line 465 of file MathUtils.h.
References min().
Referenced by min8Real(), and minMod().
Returns the minimum of eight Reals.
Definition at line 489 of file MathUtils.h.
References min(), and min4Real().
|
inline |
Mixed product of u, v and w.
Definition at line 115 of file SimdMathUtils.h.
References cross(), and dot().
|
inline |
Multiplies the elements of the instance term-by-term by the elements of the array copy_array.
Since no memory allocation is performed, the number of elements in copy_array must be less than or equal to the current number of elements. If it is smaller, the elements of the current array located at the end of the array remain unchanged
Definition at line 1026 of file MathUtils.h.
References Arcane::ArrayView< T >::constView(), and mult().
|
inline |
Multiplies the elements of the instance term-by-term by the elements of the array copy_array.
Since no memory allocation is performed, the number of elements in copy_array must be less than or equal to the current number of elements. If it is smaller, the elements of the current array located at the end of the array remain unchanged
Definition at line 1005 of file MathUtils.h.
References Arcane::ArrayView< T >::data(), Arcane::ConstArrayView< T >::data(), Arcane::ArrayView< T >::size(), and Arcane::ConstArrayView< T >::size().
Referenced by mult().
|
inline |
Multiplies all elements of the array by the real number o.
Definition at line 1035 of file MathUtils.h.
References Arcane::ArrayView< T >::data(), and Arcane::ArrayView< T >::size().
3x3 matrix multiplied by a vector.
Definition at line 848 of file MathUtils.h.
References Arcane::Real3POD::x, Arcane::Real3x3::x, Arcane::Real3POD::y, Arcane::Real3x3::y, Arcane::Real3POD::z, and Arcane::Real3x3::z.
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 55 of file MathReal2.h.
References Arcane::Real2::divSame(), and isZero().
Referenced by Arcane::Real2::normalize().
Normalizes the triplet v.
If the triplet is non-zero, divides each component by the norm of the triplet (abs()), so that after calling this method, math::normL2() equals 1. If the triplet is zero, does nothing.
Definition at line 61 of file MathReal3.h.
References Arcane::Real3::divSame(), and isZero().
Returns the pair v normalized by the L2 norm.
If math::normL2(v) is non-zero, returns the pair v divided by math::normL2(v). Otherwise, returns v.
Definition at line 69 of file MathReal2.h.
References isZero().
Returns the triplet v normalized with the L2 norm.
If math::normL2(v) is non-zero, returns the triplet v divided by math::normL2(v). Otherwise, returns v.
Definition at line 75 of file MathReal3.h.
References isZero().
Norm of a vector.
Definition at line 684 of file MathUtils.h.
References sqrt(), Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
Referenced by Arcane::Numerics::Euclidian3Geometry::computeArea(), Arcane::Numerics::Euclidian3Geometry::computeMeasure(), Arcane::Numerics::Euclidian3Geometry::computeSurfaceCenter(), Arcane::Numerics::GeometryKernelSurfaceToolsService::computeSurfaceContact(), and Arcane::Numerics::ParallelCorefinementService::update().
| __host__ __device__ Real Arcane::math::normL2 | ( | const NumVector< DataType, Size > & | v | ) |
Returns the L2 norm of the vector.
Definition at line 90 of file MathNumeric.h.
References sqrt(), and squareNormL2().
Returns the norm of the pair $ \(\sqrt{x^2+y^2+z^2}$\).
Definition at line 43 of file MathReal2.h.
References sqrt(), and squareNormL2().
Returns the L2 norm of the triplet $ \(\sqrt{v.x^2+v.y^2+v.z^2}\).
Definition at line 49 of file MathReal3.h.
References sqrt(), and squareNormL2().
Definition at line 100 of file SimdMathUtils.h.
Definition at line 88 of file SimdMathUtils.h.
|
inline |
Power function.
Calculates x raised to the power of y.
Definition at line 89 of file MathApfloat.h.
References Arcane::arcaneMathError(), floor(), and Arcane::Convert::toDouble().
Referenced by power().
|
inline |
Power function.
Calculates x to the power of y.
Definition at line 175 of file MathBase.h.
References Arcane::arcaneMathError(), and floor().
|
inline |
Power function.
Calculates x to the power of y.
Definition at line 213 of file MathBase.h.
References Arcane::arcaneMathError().
|
inline |
Power function.
Calculates x to the power of y.
Definition at line 231 of file MathBase.h.
References Arcane::arcaneMathError(), and floor().
|
inline |
Power function.
Calculates x to the power of y.
Definition at line 195 of file MathBase.h.
References Arcane::arcaneMathError().
|
inline |
Raises all elements of the array to the power o.
Definition at line 1046 of file MathUtils.h.
References Arcane::ArrayView< T >::data(), pow(), and Arcane::ArrayView< T >::size().
|
inline |
Definition at line 124 of file SimdMathUtils.h.
Definition at line 216 of file MathUtils.h.
Returns the relative error between two tensors T1 and T2.
The relative error is calculated as the maximum of the relative errors on each of the tensor components.
Definition at line 575 of file MathUtils.h.
References max(), relativeError(), Arcane::Real3POD::x, Arcane::Real3x3::x, Arcane::Real3POD::y, Arcane::Real3x3::y, Arcane::Real3POD::z, and Arcane::Real3x3::z.
Returns the relative error between two scalars a and b.
The relative error is calculated by:
\(\frac{a-b}{|a|+|b|}\)
Definition at line 558 of file MathUtils.h.
References isZero().
Referenced by relativeError().
Returns the relative error between two scalars a and b relative to a.
The relative error is calculated by:
\(\frac{a-b}{(|b|)}\)
Definition at line 619 of file MathUtils.h.
References isZero().
Returns the relative error between two scalars a and b relative to b.
The relative error is calculated by:
\(\frac{a-b}{(|b|)}\)
Definition at line 602 of file MathUtils.h.
References isZero().
|
inline |
Searches for the extreme values of an array of pairs (x,y).
Definition at line 632 of file MathUtils.h.
References Arcane::ConstArrayView< T >::size().
|
inline |
Square root of v.
Definition at line 69 of file MathApfloat.h.
References Arcane::arcaneMathError(), and Arcane::Convert::toDouble().
Referenced by Arcane::Real2Proxy::_sqrt(), Arcane::Real3Proxy::_sqrt(), Arcane::Numerics::Euclidian3Geometry::computeLength(), normalizeReal3(), normeR3(), normL2(), normL2(), and normL2().
|
inline |
Square root of v.
Definition at line 142 of file MathBase.h.
References Arcane::arcaneMathError().
|
inline |
Definition at line 109 of file SimdOperation.h.
|
inline |
Square root of v.
Definition at line 155 of file MathBase.h.
References Arcane::arcaneMathError().
|
constexpr |
Returns the square of the L2 norm of the vector.
Definition at line 77 of file MathNumeric.h.
Referenced by normL2(), normL2(), and normL2().
Returns the squared norm of the pair $ \(x^2+y^2+z^2$\).
Definition at line 37 of file MathReal2.h.
References Arcane::Real2POD::x, and Arcane::Real2POD::y.
Returns the square of the L2 norm of the triplet $ \(x^2+y^2+z^2\).
Definition at line 32 of file MathReal3.h.
References Arcane::Real3POD::x, Arcane::Real3POD::y, and Arcane::Real3POD::z.
|
inline |
Subtracts the array copy_array from the instance.
Since no memory allocation is performed, the number of elements in copy_array must be less than or equal to the current number of elements. If it is smaller, the elements of the current array located at the end of the array remain unchanged
Definition at line 984 of file MathUtils.h.
References Arcane::ArrayView< T >::data(), and Arcane::ArrayView< T >::size().
|
inline |
Subtracts the array copy_array from the instance.
Since no memory allocation is performed, the number of elements in copy_array must be less than or equal to the current number of elements. If it is smaller, the elements of the current array located at the end of the array remain unchanged
Definition at line 965 of file MathUtils.h.
References Arcane::ArrayView< T >::data(), Arcane::ConstArrayView< T >::data(), Arcane::ArrayView< T >::size(), and Arcane::ConstArrayView< T >::size().
Transpose the matrix.
Definition at line 265 of file MathUtils.h.
References Arcane::Real3POD::x, Arcane::Real3x3::x, Arcane::Real3POD::y, Arcane::Real3x3::y, Arcane::Real3POD::z, and Arcane::Real3x3::z.
Truncates the precision of the array of real numbers values to nb_digit significant figures.
On exit, each element of values is modified as if after calling truncateDouble(double v,Integer nb_digit).
Definition at line 89 of file Math.cc.
References Arcane::ArrayView< T >::size().
|
extern |
Truncates the precision of the real number v to nb_digit significant figures.
For a double-precision real number in IEEE 754, the number of significant bits is 15 or 16 depending on the value. It should be noted that it is not possible to simply and quickly truncate the precision to a given value. This is why nb_digit represents an approximate number of digits. Notably, it is not possible to go below 8 significant figures.
If nb_digit is less than or equal to zero or greater than 15, the value v is returned.