19#ifndef OPM_FIXZERODIAGONAL_HEADER_INCLUDED
20#define OPM_FIXZERODIAGONAL_HEADER_INCLUDED
38template <
class Matrix>
41 const typename Matrix::field_type replacementValue
42 = std::numeric_limits<typename Matrix::field_type>::epsilon())
44 auto newMatrix = matrix;
46 for (
size_t row = 0; row < newMatrix.N(); ++row) {
47 for (
size_t component = 0; component < Matrix::block_type::cols; ++component) {
48 if (newMatrix[row][row][component][component] == 0) {
49 newMatrix[row][row][component][component] = replacementValue;
Definition: autotuner.hpp:29
const Matrix makeMatrixWithNonzeroDiagonal(const Matrix &matrix, const typename Matrix::field_type replacementValue=std::numeric_limits< typename Matrix::field_type >::epsilon())
makeMatrixWithNonzeroDiagonal creates a new matrix with the zero diagonal elements (when viewed as a ...
Definition: fix_zero_diagonal.hpp:40