13#ifndef ML_LINEAR_ALGEBRA_TOOLS_H
14#define ML_LINEAR_ALGEBRA_TOOLS_H
23#include <MeVisLabVersion.h>
30#if ML_DEPRECATED_SINCE(4, 2, 0)
31template <
typename T> [[deprecated(
"Use std::swap instead of MLSwap")]]
39template <
typename T> [[deprecated(
"Please use std::swap instead")]]
63 const typename BASE_TYPE::ComponentType ,
69 size_t i = 0,
j = 0,
i1 = 0;
72 for (
j = 0;
j <
Dim;
j++) {
76 if (std::abs(a[
i][
j]) > std::abs(a[
i1][
j])) {
81 std::swap(a[
i1], a[
j]);
82 std::swap(b[
i1], b[
j]);
85 const typename BASE_TYPE::ComponentType
avjj = a[
j][
j];
90 sstream <<
"Returning identity, matrix was:" << std::endl;
91 for (
size_t y = 0; y <
Dim; ++y) {
92 for (
size_t x = 0; x <
Dim; ++x) {
109 for (
i = 0;
i <
Dim;
i++) {
111 b[
i] -= a[
i][
j] * b[
j];
112 a[
i] -= a[
i][
j] * a[
j];
bool MLValueIs0WOM(MLint8 a)
Returns true if value is 0; otherwise, it returns false.
#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(T &, T &)=delete
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.