Arcane  4.2.1.0
User documentation
Loading...
Searching...
No Matches
MathReal3x3.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* MathReal3x3.h (C) 2000-2026 */
9/* */
10/* 3x3 Matrix of 'Real'. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_BASE_MATHREAL3X3_H
13#define ARCCORE_BASE_MATHREAL3X3_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/base/Real3x3.h"
18#include "arccore/base/MathReal3.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane::math
24{
25/*!
26 * \brief Compares the matrix with the zero matrix.
27 *
28 * The matrix is zero if and only if each of its components
29 * is less than a given epsilon. The epsilon value used is that
30 * of float_info<value_type>::nearlyEpsilon():
31 * \f[A=0 \Leftrightarrow |A.x|<\epsilon,|A.y|<\epsilon,|A.z|<\epsilon \f]
32 *
33 * \retval true if the matrix is equal to the zero matrix,
34 * \retval false otherwise.
35 */
36inline constexpr ARCCORE_HOST_DEVICE bool isNearlyZero(const Real3x3& v)
37{
38 return isNearlyZero(v.x) && isNearlyZero(v.y) && isNearlyZero(v.z);
39}
40
41/*---------------------------------------------------------------------------*/
42/*---------------------------------------------------------------------------*/
43
44} // namespace Arcane::math
45
46/*---------------------------------------------------------------------------*/
47/*---------------------------------------------------------------------------*/
48
49namespace Arcane
50{
51
52inline constexpr ARCCORE_HOST_DEVICE bool Real3x3::
53isNearlyZero() const
54{
55 return math::isNearlyZero(*this);
56}
57
58/*---------------------------------------------------------------------------*/
59/*---------------------------------------------------------------------------*/
60
61} // End namespace Arcane
62
63/*---------------------------------------------------------------------------*/
64/*---------------------------------------------------------------------------*/
65
66#endif
Class managing a 3x3 real matrix.
Real3 z
first element of the triplet
Real3 y
first element of the triplet
Real3 x
first element of the triplet
Namespace for mathematical functions.
Definition MathUtils.h:36
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --