12#ifndef ARCCORE_BASE_MATHNUMERIC_H
13#define ARCCORE_BASE_MATHNUMERIC_H
17#include "arccore/base/NumVector.h"
18#include "arccore/base/NumMatrix.h"
20#include "arccore/base/MathReal2.h"
21#include "arccore/base/MathReal3.h"
22#include "arccore/base/MathReal2x2.h"
23#include "arccore/base/MathReal3x3.h"
41template <
typename DataType,
int Size>
constexpr ARCCORE_HOST_DEVICE
bool
44 bool is_nearly_zero =
true;
45 for (
int i = 0; i < Size; ++i)
46 is_nearly_zero = is_nearly_zero && math::isNearlyZero(v[i]);
47 return is_nearly_zero;
63template <
typename DataType,
int RowSize,
int ColumnSize>
constexpr ARCCORE_HOST_DEVICE
bool
66 bool is_nearly_zero =
true;
67 for (
int i = 0; i < RowSize; ++i)
68 is_nearly_zero = is_nearly_zero && math::isNearlyZero(v.row(i));
69 return is_nearly_zero;
76template <
typename DataType,
int Size>
constexpr ARCCORE_HOST_DEVICE DataType
80 for (
int i = 0; i < Size; ++i)
89template <
typename DataType,
int Size> ARCCORE_HOST_DEVICE
Real
Small fixed-size matrix containing RowSize rows and ColumnSize columns.
Small fixed-size vector of Size numerical data points.
Namespace for mathematical functions.
constexpr __host__ __device__ DataType squareNormL2(const NumVector< DataType, Size > &v)
Returns the square of the L2 norm of the vector.
apfloat sqrt(apfloat v)
Square root of v.
double Real
Type representing a real number.