Skip to content
Snippets Groups Projects

Add NaNHelper utility

Merged Stéphane Del Pino requested to merge feature/nan-output-for-vectors-and-matrices into develop
2 files
+ 52
0
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -9,6 +9,8 @@
#include <utils/PugsUtils.hpp>
#include <utils/Types.hpp>
#include <iostream>
template <typename DataType>
class DenseMatrix // LCOV_EXCL_LINE
{
@@ -246,6 +248,19 @@ class DenseMatrix // LCOV_EXCL_LINE
PUGS_INLINE
DenseMatrix& operator=(DenseMatrix&&) = default;
friend std::ostream&
operator<<(std::ostream& os, const DenseMatrix& A)
{
for (size_t i = 0; i < A.numberOfRows(); ++i) {
os << i << '|';
for (size_t j = 0; j < A.numberOfColumns(); ++j) {
os << ' ' << j << ':' << NaNHelper(A(i, j));
}
os << '\n';
}
return os;
}
template <typename DataType2>
DenseMatrix(const DenseMatrix<DataType2>& A)
{
Loading