vectorial space to linear equation
All checks were successful
Linux arm64 / Build (push) Successful in 30s
All checks were successful
Linux arm64 / Build (push) Successful in 30s
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#include "Matrix.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
#include "Matrix.h"
|
||||
|
||||
Matrix::Matrix(const std::string& fileNameInput) {
|
||||
Load(fileNameInput);
|
||||
}
|
||||
|
||||
12
src/Vect.cpp
12
src/Vect.cpp
@@ -1,4 +1,6 @@
|
||||
#include "Vect.h"
|
||||
|
||||
#include "Solver.h"
|
||||
#include <iostream>
|
||||
|
||||
Vect::Vect(const Matrix& mat) : m_Data(mat) {
|
||||
@@ -21,6 +23,16 @@ void Vect::Simplify() {
|
||||
m_Data = mat;
|
||||
}
|
||||
|
||||
Matrix Vect::GetLinearSystem() const {
|
||||
Matrix vect = m_Data;
|
||||
vect.Transpose();
|
||||
|
||||
Solver solver {vect};
|
||||
vect = solver.Noyau().m_Data;
|
||||
vect.Transpose();
|
||||
return vect;
|
||||
}
|
||||
|
||||
void Vect::Print() const {
|
||||
std::cout << "Espace vectoriel de dimension " << GetDimension() << " de base :\n\n";
|
||||
for (std::size_t i = 0; i < m_Data.GetRawCount(); i++) {
|
||||
|
||||
@@ -22,6 +22,8 @@ class Vect {
|
||||
|
||||
std::size_t GetDimension() const;
|
||||
|
||||
Matrix GetLinearSystem() const;
|
||||
|
||||
private:
|
||||
void Simplify();
|
||||
};
|
||||
11
src/main.cpp
11
src/main.cpp
@@ -21,10 +21,17 @@ void test() {
|
||||
|
||||
Solver solver{mat2};
|
||||
|
||||
Vect image = solver.Image();
|
||||
Vect noyau = solver.Noyau();
|
||||
|
||||
std::cout << "\tImage :\n";
|
||||
solver.Image().Print();
|
||||
image.Print();
|
||||
std::cout << "Système :\n";
|
||||
image.GetLinearSystem().Print();
|
||||
std::cout << "\tNoyau :\n";
|
||||
solver.Noyau().Print();
|
||||
noyau.Print();
|
||||
std::cout << "Système :\n";
|
||||
noyau.GetLinearSystem().Print();
|
||||
}
|
||||
|
||||
void prompt() {
|
||||
|
||||
Reference in New Issue
Block a user