60 lines
1.1 KiB
C++
60 lines
1.1 KiB
C++
#include "Gauss.h"
|
|
#include "IO.h"
|
|
#include "Matrix.h"
|
|
#include "NR.h"
|
|
#include "Solver.h"
|
|
#include <iostream>
|
|
|
|
void test() {
|
|
/* Matrix mat{"matrice4x4.mat"};
|
|
mat.Print();
|
|
// mat.Save("matrice3x3.mat");
|
|
std::cout << "sdfdjiofoseifheoiefhoig\n";
|
|
mat.Print();
|
|
//mat = {"matrice4x4.mat"};
|
|
mat.GaussJordan(false);
|
|
std::cout << "\nResultat :\n";
|
|
mat.Print();
|
|
mat.Transpose();
|
|
std::cout << "<<\nTransposée:\n";
|
|
mat.Print();
|
|
// mat.Save("matrice4x4echelonne.mat"); */
|
|
|
|
Matrix mat2 = LoadMatrix("matrice4x4.mat");
|
|
Print(mat2);
|
|
|
|
Solver solver;
|
|
|
|
Vect image = solver.Image(Matrix{mat2});
|
|
Vect noyau = solver.Kernel(Matrix{mat2});
|
|
|
|
std::cout << "\tImage :\n";
|
|
Print(image);
|
|
std::cout << "Système :\n";
|
|
Print(image.GetLinearSystem());
|
|
std::cout << "\tNoyau :\n";
|
|
Print(noyau);
|
|
std::cout << "Système :\n";
|
|
Print(noyau.GetLinearSystem());
|
|
|
|
std::cout << "\n\n";
|
|
// Print(solver.TriangularSystem(mat2));
|
|
}
|
|
|
|
void prompt() {
|
|
|
|
Matrix mat = InsertMatrix();
|
|
|
|
Print(mat);
|
|
|
|
Gauss::GaussJordan(mat, true, true);
|
|
|
|
Print(mat);
|
|
}
|
|
|
|
int main(int argc, char** argv) {
|
|
test();
|
|
prompt();
|
|
return 0;
|
|
}
|