LU and LU inverse is done

This commit is contained in:
2025-09-14 18:35:37 +02:00
parent 88087ea6a6
commit 92437e5ef1
23 changed files with 503 additions and 978 deletions
+27 -2
View File
@@ -27,6 +27,7 @@ public:
}
//##########################################################
//# VECTOR: --- basic properties --- #
//##########################################################
@@ -399,13 +400,37 @@ public:
void print() const{
std::cout << *this << std::endl;
}
bool nearly_equal(const Vector<T>& a, T tol = static_cast<T>(1e-9)) const {
if (v.size() != a.size()){
return false;
}
for (uint64_t i = 0; i < v.size(); ++i){
T val1 = v[i];
T val2 = a[i];
if (std::is_floating_point<T>::value) {
if (std::fabs(val1 - val2) > tol) return false;
} else {
if (val1 != val2) return false;
}
}
return true;
}
};
typedef Vector<int> Vi;
typedef Vector<float> Vf;
typedef Vector<double> Vd;
/*
if (std::is_floating_point<T>::value) {
if (std::fabs(a - b) > tol) return false;
} else {
if (a != b) return false;
}*/
} // namespace utils
#endif // _vector_n_