Debian Codegraph @

dune/uggrid/low/architecture.h

raw
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 // SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4 // SPDX-License-Identifier: LGPL-2.1-or-later
5
6 /*
7
8 provides, based on config.h, a consistent interface for system
9 dependent stuff
10
11 */
12
13 #ifndef UG_ARCHITECTURE_H
14 #define UG_ARCHITECTURE_H
15
16 /* SMALL..: least number s.t. 1 + SMALL../SMALL_FAC != 1 */
17 #define SMALL_FAC 10
18
19 #include <limits>
20 constexpr float MAX_F = std::numeric_limits<float>::max();
21 constexpr float SMALL_F = std::numeric_limits<float>::epsilon() * SMALL_FAC;
22 constexpr float MAX_C = std::numeric_limits<float>::max();
23 constexpr float SMALL_C = std::numeric_limits<float>::epsilon() * SMALL_FAC;
24 constexpr double MAX_D = std::numeric_limits<double>::max();
25 constexpr double SMALL_D = std::numeric_limits<double>::epsilon() * SMALL_FAC;
26
27 /* data alignment of 8 should suffice on all architecture */
28 /* !!! set after testing? */
29 #define ALIGNMENT 8 /* power of 2 and >= sizeof(int) ! */
30
31 #endif