This repository has been archived on 2025-02-26. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Pivot/test/test_jordan.cpp
Persson-dev f5a282c455
All checks were successful
Linux arm64 / Build (push) Successful in 6m40s
allow tests in release mode
2024-05-04 12:42:26 +02:00

44 lines
667 B
C++

#include "Gauss.h"
#include "Matrix.h"
#include "test_assert.h"
struct Test {
Matrix mat;
Matrix res;
};
static const std::vector<Test> TEST_MATRICES = {
// test 1
{{3, 3, {
1, 2, 3,
4, 5, 6,
7, 8, 9,
}}, {3, 3, {
1, 0, -1,
0, 1, 2,
0, 0, 0,
}}},
// test 2
{{3, 3, {
4, 5, 6,
1, 2, 3,
7, 8, 9,
}}, {3, 3, {
1, 0, -1,
0, 1, 2,
0, 0, 0,
}}}
};
void test() {
for (Test test : TEST_MATRICES) {
Gauss::GaussJordan(test.mat, true, true);
test_assert(test.mat == test.res);
}
}
int main(int argc, char** argv) {
test();
return 0;
}