Peano
Loading...
Searching...
No Matches
Scalar.h
Go to the documentation of this file.
1// This file is part of the Peano project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5#include <limits>
6
7namespace tarch {
8 namespace la {
9#if defined(GPUOffloadingOMP)
10#pragma omp declare target
11#endif
12 constexpr double PI = 3.1415926535897932384626433832795028841972;
13 constexpr double E = 2.7182818284590452353602874713526624977572;
14#ifdef MACHINE_PRECISION
15 constexpr double NUMERICAL_ZERO_DIFFERENCE = MACHINE_PRECISION;
16#else
17 constexpr double NUMERICAL_ZERO_DIFFERENCE = 1.0e-8;
18#endif
19#if defined(GPUOffloadingOMP)
20#pragma omp end declare target
21#endif
22
33 double valueA, double valueB = std::numeric_limits<double>::min(), double eps = NUMERICAL_ZERO_DIFFERENCE
34 );
35
51 double valueA, double valueB = std::numeric_limits<double>::min(), double eps = NUMERICAL_ZERO_DIFFERENCE
52 );
53
58 double max(double a, double b, double c);
59
64 double pow(double base, double exponent);
65
71 double convertAbsoluteIntoRelativeValue(double referenceValue, double value);
72 } // namespace la
73} // namespace tarch
constexpr double E
Definition Scalar.h:13
double relativeEpsNormalisedAgainstValueGreaterOne(double valueA, double valueB=std::numeric_limits< double >::min(), double eps=NUMERICAL_ZERO_DIFFERENCE)
Determine a relative tolerance from one or two values.
constexpr double NUMERICAL_ZERO_DIFFERENCE
Definition Scalar.h:17
double relativeEps(double valueA, double valueB=std::numeric_limits< double >::min(), double eps=NUMERICAL_ZERO_DIFFERENCE)
Determine a relative tolerance from one or two values.
double max(double a, double b, double c)
I need the maximum of three values all the time, to I decided to write a function for this.
constexpr double PI
Definition Scalar.h:12
double convertAbsoluteIntoRelativeValue(double referenceValue, double value)
Convert an absolute value into a relative one.
double pow(double base, double exponent)
Wrapper around std::pow which is redirected to Intel's implementation on Intel machines.
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19