Compare commits
4 Commits
2b520f6648
...
5a44ff311a
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a44ff311a | |||
| 432fa99f71 | |||
| 911f016bb7 | |||
| 0f72f6603e |
@@ -122,6 +122,16 @@ class Matrix {
|
||||
* construit une matrice de 4 lignes et 1 colonne de coordonnées (1, 2, 3, 4)
|
||||
*/
|
||||
static Matrix ColumnVector(std::initializer_list<Element>&&);
|
||||
|
||||
/**
|
||||
* \brief Construit une matrice ligne à partir de données existantes.\n
|
||||
* Exemple :
|
||||
* \code
|
||||
* Matrix::RawVector({1, 2, 3, 4});
|
||||
* \endcode
|
||||
* construit une matrice de 1 ligne et 4 colonnes de coordonnées (1, 2, 3, 4)
|
||||
*/
|
||||
static Matrix RawVector(std::initializer_list<Element>&&);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -8,7 +8,4 @@
|
||||
0 1 0
|
||||
0 0 1
|
||||
|
||||
3 1
|
||||
0
|
||||
0
|
||||
0
|
||||
3 0
|
||||
|
||||
@@ -65,6 +65,14 @@ Matrix Matrix::ColumnVector(std::initializer_list<Element>&& initList) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Matrix Matrix::RawVector(std::initializer_list<Element>&& initList) {
|
||||
Matrix result {1, initList.size()};
|
||||
|
||||
result.m_Data = initList;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void Matrix::Augment(const Matrix& droite) {
|
||||
assert(droite.m_Raws == m_Raws);
|
||||
Matrix temp {m_Raws, m_Columns + droite.m_Columns};
|
||||
|
||||
@@ -36,10 +36,20 @@ VectAffine Solver::TriangularSystem() const {
|
||||
Vect noyau = solver.Kernel();
|
||||
Matrix origin = mat.SubMatrix(0, mat.GetColumnCount() - 1, mat.GetRawCount(), 1);
|
||||
|
||||
return {noyau, origin};
|
||||
// on rajoute des 0 si il faut
|
||||
|
||||
Matrix fullOrigin {mat.GetColumnCount() - 1, 1};
|
||||
for (int i = 0; i < mat.GetRawCount(); i++) {
|
||||
fullOrigin.at(i, 0) = origin.at(i, 0);
|
||||
}
|
||||
|
||||
for (int i = mat.GetRawCount(); i < mat.GetColumnCount() - 1; i++) {
|
||||
fullOrigin.at(i, 0) = 0;
|
||||
}
|
||||
|
||||
return {noyau, fullOrigin};
|
||||
}
|
||||
|
||||
std::size_t Solver::Rank() const {
|
||||
Vect image = Image();
|
||||
return image.GetCardinal();
|
||||
return Image().GetCardinal();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user