13#ifndef ML_LINEAR_ALGEBRA_TOOLS_H
14#define ML_LINEAR_ALGEBRA_TOOLS_H
32 template <
class OBJ_TYPE>
59 template <
class BASE_TYPE>
62 const typename BASE_TYPE::ComponentType ,
70 size_t i=0,
j=0,
i1=0;
86 const typename BASE_TYPE::ComponentType
avjj = a[
j][
j];
92 sstream <<
"Returning identity, matrix was:" << std::endl;
93 for (
size_t y = 0; y <
Dim; ++y)
95 for (
size_t x = 0; x <
Dim; ++x)
116 b[
i] -= a[
i][
j]*b[
j];
117 a[
i] -= a[
i][
j]*a[
j];
bool MLValueIs0WOM(MLint8 a)
Returns true if value is 0, otherwise false.
DT MLAbs(const DT val)
Defines templated MLAbs version to circumvent fabs ambiguities on different platforms.
#define ML_BAD_PARAMETER
A bad/invalid parameter (or even an inappropriate image) has been passed to a module or an algorithm;...
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
void ML_UTILS_EXPORT printTemplateError(const char *location, MLErrorCode reason, const std::string_view &handling)
void MLSwap(OBJ_TYPE &obj1, OBJ_TYPE &obj2)
Swaps two objects obj1 and obj2.
BASE_TYPE MLInverseMatHelper(const BASE_TYPE &origMat, bool *isInvertible, const typename BASE_TYPE::ComponentType, const char *const ZeroDetErrString, const BASE_TYPE &Identity, const size_t Dim)
Computes an N dimensional inverse from given default parameters.