solver rework + refactor

This commit is contained in:
2024-03-06 21:24:15 +01:00
parent 259750a794
commit 99624d1b00
10 changed files with 191 additions and 163 deletions

View File

@@ -8,7 +8,21 @@
namespace fs = std::filesystem;
int main() {
void TestRectangular() {
Matrix mat2 = {2, 4, {
1, 1, 1, 1,
1, -1, -1, 2
}};
VectAffine aff {Matrix::ColumnVector({0, -1, 1}), Matrix::ColumnVector({3.0 / 2.0, 0, -1.0 / 2.0})};
Solver solver;
std::cout << solver.RectangularSystem(mat2, Matrix::ColumnVector({1, 2})).GetLinearSystem() << std::endl;
std::cout << aff.GetLinearSystem() << std::endl;
}
void TestKernelImage() {
std::string path = "test";
for (const auto& entry : fs::directory_iterator(path)) {
std::string fileName = entry.path().string();
@@ -23,10 +37,15 @@ int main() {
Vect image {imageMat};
Vect noyau {noyauMat};
Solver solver {mat};
Solver solver;
assert(solver.Image() == image);
assert(solver.Kernel() == noyau);
assert(solver.Image(mat) == image);
assert(solver.Kernel(mat) == noyau);
}
}
int main() {
TestKernelImage();
TestRectangular();
return 0;
}