5 #include "../IoStream.hpp" 6 #include "../Matrix.hpp" 7 #include "../Vector.hpp" 16 if (std::abs(d1) < 1e-38 && std::abs(d2) < 1e-38) {
19 if ((d1 == 0 && d2 < 1e-4) || (d2 == 0 && d1 < 1e-4)) {
22 T scaler = pow(T(10), floor(std::log10(std::abs(d1))));
27 return round(d1) == round(d2);
39 return AlmostEqual(d1, d2, std::integral_constant<
bool, std::is_floating_point<T>::value>());
42 template <
class T,
int Dim,
bool Packed1,
bool Packed2>
45 for (
auto i :
Range(Dim)) {
51 template <
class T,
bool Packed1,
bool Packed2>
54 for (
auto i :
Range(4)) {
69 bool AlmostEqual(
const Matrix<T, Rows, Columns, Order1, Layout1, Packed1>& lhs,
const Matrix<T, Rows, Columns, Order2, Layout2, Packed2>& rhs) {
71 for (
auto i :
Range(Rows)) {
72 for (
auto j :
Range(Columns)) {
81 template <
class LinalgClass>
91 template <
class LinalgClass1,
class LinalgClass2>
96 template <
class LinalgClass1,
class LinalgClass2>
101 template <
class LinalgClass1,
class LinalgClass2>
106 template <
class LinalgClass>
107 std::ostream& operator<<(std::ostream& os, const ApproxHelper<LinalgClass>& arg) {
112 template <
class LinalgClass>
ApproxHelper()
Definition: Approx.hpp:83
Allows you to do quaternion math and represent rotation in a compact way.
Definition: Definitions.hpp:69
ApproxHelper(LinalgClass object)
Definition: Approx.hpp:84
ApproxHelper< LinalgClass > ApproxVec(const LinalgClass &arg)
Definition: Approx.hpp:113
bool operator==(const ApproxHelper< LinalgClass1 > &lhs, const LinalgClass2 &rhs)
Definition: Approx.hpp:92
Represents a vector in N-dimensional space.
Definition: Definitions.hpp:57
LinalgClass object
Definition: Approx.hpp:87
Definition: Approx.hpp:11
Definition: Approx.hpp:82
Definition: Traits.hpp:152
Definition: Definitions.hpp:63
Definition: Traits.hpp:178
RangeHelper< T > Range(T first, T last, T step)
Definition: Range.hpp:54
bool AlmostEqual(T d1, T d2, std::true_type)
Definition: Approx.hpp:15
Vector< T, 4, Packed > vec
Definition: QuaternionImpl.hpp:41
eMatrixOrder
Determines if you want to left- or right-multiply your matrices with vectors.
Definition: Definitions.hpp:22
eMatrixLayout
Determines the memory layout of matrices.
Definition: Definitions.hpp:36