From 4df4c9147a65c1b265e193e47ff871215e3a5843 Mon Sep 17 00:00:00 2001 From: Robert Kloefkorn Date: Mon, 15 Feb 2016 11:38:09 +0100 Subject: [PATCH] fastSparseProduct.hpp --> fastSparseOperations.hpp --- CMakeLists_files.cmake | 2 +- opm/autodiff/AutoDiffBlock.hpp | 2 +- opm/autodiff/AutoDiffMatrix.hpp | 2 +- .../{fastSparseProduct.hpp => fastSparseOperations.hpp} | 7 ++++--- 4 files changed, 7 insertions(+), 6 deletions(-) rename opm/autodiff/{fastSparseProduct.hpp => fastSparseOperations.hpp} (96%) diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index 3818ab8c3..f0b3cd2f7 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -138,7 +138,7 @@ list (APPEND PUBLIC_HEADER_FILES opm/autodiff/BlackoilSolventState.hpp opm/autodiff/BlackoilMultiSegmentModel.hpp opm/autodiff/BlackoilMultiSegmentModel_impl.hpp - opm/autodiff/fastSparseProduct.hpp + opm/autodiff/fastSparseOperations.hpp opm/autodiff/DuneMatrix.hpp opm/autodiff/ExtractParallelGridInformationToISTL.hpp opm/autodiff/FlowMain.hpp diff --git a/opm/autodiff/AutoDiffBlock.hpp b/opm/autodiff/AutoDiffBlock.hpp index 3fee8b74e..308bc52aa 100644 --- a/opm/autodiff/AutoDiffBlock.hpp +++ b/opm/autodiff/AutoDiffBlock.hpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include diff --git a/opm/autodiff/AutoDiffMatrix.hpp b/opm/autodiff/AutoDiffMatrix.hpp index b94ea2058..1bac09c1d 100644 --- a/opm/autodiff/AutoDiffMatrix.hpp +++ b/opm/autodiff/AutoDiffMatrix.hpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include diff --git a/opm/autodiff/fastSparseProduct.hpp b/opm/autodiff/fastSparseOperations.hpp similarity index 96% rename from opm/autodiff/fastSparseProduct.hpp rename to opm/autodiff/fastSparseOperations.hpp index b6e64341a..b20696f78 100644 --- a/opm/autodiff/fastSparseProduct.hpp +++ b/opm/autodiff/fastSparseOperations.hpp @@ -181,8 +181,8 @@ template inline bool equalSparsityPattern(const Lhs& lhs, const Rhs& rhs) { - // if non zeros don't match, matrices don't have the same sparsity pattern - bool equal = (lhs.nonZeros() == rhs.nonZeros()); + // if both matrices have equal storage and non zeros match, we can check sparsity pattern + bool equal = (Lhs::IsRowMajor == Rhs::IsRowMajor) && (lhs.nonZeros() == rhs.nonZeros()); // check complete sparsity pattern if( equal ) @@ -195,7 +195,6 @@ equalSparsityPattern(const Lhs& lhs, const Rhs& rhs) for(Index i=0; i