Peano
Loading...
Searching...
No Matches
ScalarOperations.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
6#include "tarch/tarch.h"
7#include "tarch/la/Scalar.h"
8
9#pragma once
10
11#pragma once
12
13
14#include <complex>
15
16
17namespace tarch {
18 namespace la {
19
23 double abs( double value);
24
28 int abs (int value);
29
30 double abs( const std::complex<double>& value );
31
35 int aPowI(int i,int a);
36
40 bool greater( double lhs, double rhs, double tolerance = NUMERICAL_ZERO_DIFFERENCE);
41
45 bool greaterEquals( double lhs, double rhs, double tolerance = NUMERICAL_ZERO_DIFFERENCE);
46
50 bool equals( double lhs, double rhs, double tolerance = NUMERICAL_ZERO_DIFFERENCE);
51
62 [[maybe_unused]] // Compiler warns about the inline function unused if no extension is enabled that uses it
63 static bool smaller( double lhs, double rhs, double tolerance = NUMERICAL_ZERO_DIFFERENCE) InlineMethod {
64 return lhs - rhs < -tolerance;
65 }
66
70 bool smallerEquals( double lhs, double rhs, double tolerance = NUMERICAL_ZERO_DIFFERENCE);
71
75 bool equals( const std::complex<double>& lhs, const std::complex<double>& rhs, double tolerance = NUMERICAL_ZERO_DIFFERENCE);
76
80 int sign(double value, double tolerance = NUMERICAL_ZERO_DIFFERENCE);
81
82 int round(double value);
83 int round(float value);
84 }
85}
86
87
const float const float const float struct part *restrict struct part *restrict const float a
Definition hydro_iact.h:55
static bool smaller(double lhs, double rhs, double tolerance=NUMERICAL_ZERO_DIFFERENCE) InlineMethod
Smaller operator for floating point values.
bool greater(double lhs, double rhs, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
bool greaterEquals(double lhs, double rhs, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
constexpr double NUMERICAL_ZERO_DIFFERENCE
Definition Scalar.h:17
double abs(double value)
Returns the absolute value of a type by redirecting to std::abs.
bool smallerEquals(double lhs, double rhs, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
int sign(double value, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
bool equals(const Matrix< Rows, Cols, Scalar > &lhs, const Matrix< Rows, Cols, Scalar > &rhs, const Scalar &tolerance=NUMERICAL_ZERO_DIFFERENCE)
Compares to matrices on equality by means of a numerical accuracy.
int aPowI(int i, int a)
Computes the i-th power of a in integer arithmetic.
int round(double value)
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19
#define InlineMethod
This is the marker that is to be used after the argument list of a function declaration.
Definition tarch.h:58