Peano 4
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
39 double valueA, double valueB = std::numeric_limits<double>::min(), double eps = NUMERICAL_ZERO_DIFFERENCE
40 );
41
56 double relativeEps(
57 double valueA, double valueB = std::numeric_limits<double>::min(), double eps = NUMERICAL_ZERO_DIFFERENCE
58 );
59
64 double max(double a, double b, double c);
65
70 double pow(double base, double exponent);
71
77 double convertAbsoluteIntoRelativeValue(double referenceValue, double value);
78 } // namespace la
79} // namespace tarch
constexpr double E
Definition Scalar.h:13
double relativeEpsNormaledAgainstValueGreaterOne(double valueA, double valueB=std::numeric_limits< double >::min(), double eps=NUMERICAL_ZERO_DIFFERENCE)
Determine a relative tolerance from one or two values.
Definition Scalar.cpp:10
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.
Definition Scalar.cpp:14
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.
Definition Scalar.cpp:8
constexpr double PI
Definition Scalar.h:12
double convertAbsoluteIntoRelativeValue(double referenceValue, double value)
Convert an absolute value into a relative one.
Definition Scalar.cpp:26
double pow(double base, double exponent)
Wrapper around std::pow which is redirected to Intel's implementation on Intel machines.
Definition Scalar.cpp:23
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:17