Peano 4
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 static bool smaller( double lhs, double rhs, double tolerance = NUMERICAL_ZERO_DIFFERENCE) InlineMethod {
63 return lhs - rhs < -tolerance;
64 }
65
69 bool smallerEquals( double lhs, double rhs, double tolerance = NUMERICAL_ZERO_DIFFERENCE);
70
74 bool equals( const std::complex<double>& lhs, const std::complex<double>& rhs, double tolerance = NUMERICAL_ZERO_DIFFERENCE);
75
79 int sign(double value, double tolerance = NUMERICAL_ZERO_DIFFERENCE);
80
81 int round(double value);
82 int round(float value);
83 }
84}
85
86
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:17
#define InlineMethod
This is the marker that is to be used after the argument list of a function declaration.
Definition tarch.h:58