This commit is contained in:
2024-05-11 19:44:32 +02:00
parent 0d071b1cf9
commit 2975006972
10 changed files with 201 additions and 32 deletions

View File

@@ -10,13 +10,15 @@
#include <string>
#include <vector>
#include "BigInt.h"
/**
* \class Matrix
* \brief Représente une matrice d'éléments
*/
class Matrix {
public:
typedef long double Element;
typedef BigInt Element;
typedef std::vector<Element>::iterator iterator;
private:
@@ -154,6 +156,21 @@ class Matrix {
};
template <typename T>
bool IsEqualZero(T var) {
bool IsEqualZero(const T& var) {
return std::abs(var) < std::pow(10, -5);
}
template <>
inline bool IsEqualZero(const int& var) {
return var == 0;
}
template <>
inline bool IsEqualZero(const long& var) {
return var == 0;
}
template <>
inline bool IsEqualZero(const BigInt& var) {
return var.IsEqualZero();
}