Peano
Loading...
Searching...
No Matches
VectorScalarOperations.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
6namespace tarch {
7 namespace la {
8
15 template <int Size, typename Scalar>
16 Vector<Size, Scalar>& operator*=(Vector<Size, Scalar>& vector, const Scalar& scalar);
17
24 template <int Size, typename Scalar>
25 Vector<Size, Scalar>& operator/=(Vector<Size, Scalar>& vector, const Scalar& scalar);
26
33 template <int Size, typename Scalar>
34 Vector<Size, Scalar>& operator+=(Vector<Size, Scalar>& vector, const Scalar& scalar);
35
42 template <int Size, typename Scalar>
43 Vector<Size, Scalar>& operator-=(Vector<Size, Scalar>& vector, const Scalar& scalar);
44
51 template <int Size, typename Scalar>
52 Vector<Size, Scalar> operator*(const Vector<Size, Scalar>& vector, const Scalar& scalar);
53
54 template <int Size, typename Scalar>
55 Vector<Size, Scalar> operator*(const Scalar& scalar, const Vector<Size, Scalar>& vector);
56
63 template <int Size, typename Scalar>
64 Vector<Size, Scalar> operator/(const Vector<Size, Scalar>& vector, const Scalar& scalar);
65
72 template <int Size, typename Scalar>
73 Vector<Size, Scalar> operator+(const Vector<Size, Scalar>& vector, const Scalar& scalar);
74
75 template <int Size, typename Scalar>
76 Vector<Size, Scalar> operator+(const Scalar& scalar, const Vector<Size, Scalar>& vector);
77
84 template <int Size, typename Scalar>
85 Vector<Size, Scalar> operator-(const Vector<Size, Scalar>& vector, const Scalar& scalar);
86
96 template <int Size, typename Scalar>
97 bool equals(const Vector<Size, Scalar>& lhs, const Scalar& cmp, const Scalar tolerance = NUMERICAL_ZERO_DIFFERENCE);
98
99 template <int Size, typename Scalar>
101 const Vector<Size, Scalar>& lhs, const Scalar& cmp, const Scalar tolerance = NUMERICAL_ZERO_DIFFERENCE
102 );
103
104 template <int Size, typename Scalar>
106 const Vector<Size, Scalar>& lhs, const Scalar& cmp, const Scalar tolerance = NUMERICAL_ZERO_DIFFERENCE
107 );
108
109 template <int Size, typename Scalar>
111 const Vector<Size, Scalar>& lhs, const Scalar& cmp, const Scalar tolerance = NUMERICAL_ZERO_DIFFERENCE
112 );
113
114 template <int Size, typename Scalar>
116 const Vector<Size, Scalar>& lhs, const Scalar& cmp, const Scalar tolerance = NUMERICAL_ZERO_DIFFERENCE
117 );
118
119 template <int Size, typename Scalar>
121 const Vector<Size, Scalar>& lhs, const Scalar& cmp, const Scalar tolerance = NUMERICAL_ZERO_DIFFERENCE
122 );
123
124
125 template <int Size, typename Scalar>
127 const Vector<Size, Scalar>& lhs, const Scalar& cmp, const Scalar tolerance = NUMERICAL_ZERO_DIFFERENCE
128 );
129
130 template <int Size, typename Scalar>
132 const Vector<Size, Scalar>& lhs, const Scalar& cmp, const Scalar tolerance = NUMERICAL_ZERO_DIFFERENCE
133 );
134
135 template <int Size, typename Scalar>
137 const Vector<Size, Scalar>& lhs, const Scalar& cmp, const Scalar tolerance = NUMERICAL_ZERO_DIFFERENCE
138 );
139
140 template <int Size, typename Scalar>
142 const Vector<Size, Scalar>& lhs, const Scalar& cmp, const Scalar tolerance = NUMERICAL_ZERO_DIFFERENCE
143 );
144
145
149 template <int Size>
150 bool equals(const Vector<Size, int>& lhs, const int& cmp);
151
152 template <int Size>
153 bool oneEquals(const Vector<Size, int>& lhs, const int& cmp);
154
155 template <int Size>
156 bool oneGreater(const Vector<Size, int>& lhs, const int& cmp);
157
158 template <int Size>
159 bool oneGreaterEquals(const Vector<Size, int>& lhs, const int& cmp);
160
161 template <int Size>
162 bool oneSmaller(const Vector<Size, int>& lhs, const int& cmp);
163
164 template <int Size>
165 bool oneSmallerEquals(const Vector<Size, int>& lhs, const int& cmp);
166
167 template <int Size>
168 bool allGreater(const Vector<Size, int>& lhs, const int& cmp);
169
170 template <int Size>
171 bool allGreaterEquals(const Vector<Size, int>& lhs, const int& cmp);
172
173 template <int Size>
174 bool allSmaller(const Vector<Size, int>& lhs, const int& cmp);
175
176 template <int Size>
177 bool allSmallerEquals(const Vector<Size, int>& lhs, const int& cmp);
178
186 template <int Size, typename Scalar>
188
189 } // namespace la
190} // namespace tarch
191
192
193#include "tarch/la/VectorScalarOperations.cpph"
bool allGreaterEquals(const Vector< Size, Scalar > &lhs, const Scalar &cmp, const Scalar tolerance=NUMERICAL_ZERO_DIFFERENCE)
bool allGreater(const Vector< Size, Scalar > &lhs, const Scalar &cmp, const Scalar tolerance=NUMERICAL_ZERO_DIFFERENCE)
Vector< Size, Scalar > remainder(const Vector< Size, Scalar > &vector, double h)
Return the remainder of a division.
bool oneSmaller(const Vector< Size, Scalar > &lhs, const Scalar &cmp, const Scalar tolerance=NUMERICAL_ZERO_DIFFERENCE)
Matrix< Rows, Cols, Scalar > & operator*=(Matrix< Rows, Cols, Scalar > &matrix, const Scalar &scalar)
Matrix< Rows, Cols, Scalar > operator-(const Matrix< Rows, Cols, Scalar > &lhs, const Matrix< Rows, Cols, Scalar > &rhs)
Vector< Size, Scalar > & operator+=(Vector< Size, Scalar > &vector, const Scalar &scalar)
Adds every component of the vector to the scalar and assigns the result to the vector.
constexpr double NUMERICAL_ZERO_DIFFERENCE
Definition Scalar.h:17
Matrix< Rows, Cols, Scalar > operator+(const Matrix< Rows, Cols, Scalar > &lhs, const Matrix< Rows, Cols, Scalar > &rhs)
bool oneSmallerEquals(const Vector< Size, Scalar > &lhs, const Scalar &cmp, const Scalar tolerance=NUMERICAL_ZERO_DIFFERENCE)
Vector< Size, Scalar > operator/(const Vector< Size, Scalar > &vector, const Scalar &scalar)
Divides every component of the vector by the scalar and returns the result.
bool allSmallerEquals(const Vector< Size, Scalar > &lhs, const Scalar &cmp, const Scalar tolerance=NUMERICAL_ZERO_DIFFERENCE)
bool allSmaller(const Vector< Size, Scalar > &lhs, const Scalar &cmp, const Scalar tolerance=NUMERICAL_ZERO_DIFFERENCE)
bool oneEquals(const Vector< Size, Scalar > &lhs, const Scalar &cmp, const Scalar tolerance=NUMERICAL_ZERO_DIFFERENCE)
Matrix< Rows, Cols, Scalar > operator*(const Matrix< Rows, X, Scalar > &lhs, const Matrix< X, Cols, Scalar > &rhs)
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.
bool oneGreaterEquals(const Vector< Size, Scalar > &lhs, const Scalar &cmp, const Scalar tolerance=NUMERICAL_ZERO_DIFFERENCE)
Vector< Size, Scalar > & operator-=(Vector< Size, Scalar > &vector, const Scalar &scalar)
Subtracts the scalar from every component of the vector and assigns the result to the vector.
bool oneGreater(const Vector< Size, Scalar > &lhs, const Scalar &cmp, const Scalar tolerance=NUMERICAL_ZERO_DIFFERENCE)
Vector< Size, Scalar > & operator/=(Vector< Size, Scalar > &vector, const Scalar &scalar)
Divides every component of the vector by the scalar and assigns the result to the vector.
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19
Simple vector class.
Definition Vector.h:159