Skip to content
Snippets Groups Projects
Commit 36833c0c authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Rename minor to m to avoid conflicts with system macro

parent 8a679286
No related branches found
No related tags found
No related merge requests found
...@@ -427,24 +427,24 @@ getMinor(const TinyMatrix<M, N, T>& A, size_t I, size_t J) ...@@ -427,24 +427,24 @@ getMinor(const TinyMatrix<M, N, T>& A, size_t I, size_t J)
{ {
static_assert(M >= 2 and N >= 2, "minor calculation requires at least 2x2 matrices"); static_assert(M >= 2 and N >= 2, "minor calculation requires at least 2x2 matrices");
Assert((I < M) and (J < N)); Assert((I < M) and (J < N));
TinyMatrix<M - 1, N - 1, T> minor; TinyMatrix<M - 1, N - 1, T> m;
for (size_t i = 0; i < I; ++i) { for (size_t i = 0; i < I; ++i) {
for (size_t j = 0; j < J; ++j) { for (size_t j = 0; j < J; ++j) {
minor(i, j) = A(i, j); m(i, j) = A(i, j);
} }
for (size_t j = J + 1; j < N; ++j) { for (size_t j = J + 1; j < N; ++j) {
minor(i, j - 1) = A(i, j); m(i, j - 1) = A(i, j);
} }
} }
for (size_t i = I + 1; i < M; ++i) { for (size_t i = I + 1; i < M; ++i) {
for (size_t j = 0; j < J; ++j) { for (size_t j = 0; j < J; ++j) {
minor(i - 1, j) = A(i, j); m(i - 1, j) = A(i, j);
} }
for (size_t j = J + 1; j < N; ++j) { for (size_t j = J + 1; j < N; ++j) {
minor(i - 1, j - 1) = A(i, j); m(i - 1, j - 1) = A(i, j);
} }
} }
return minor; return m;
} }
template <size_t N, typename T> template <size_t N, typename T>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment