From d700402b156b6519238515fe6d5d64320f20456a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Thu, 11 Jan 2018 15:00:20 +0100 Subject: [PATCH 1/2] Remove unused boost include. --- opm/core/utility/SparseVector.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/opm/core/utility/SparseVector.hpp b/opm/core/utility/SparseVector.hpp index 09f2e102..610916ab 100644 --- a/opm/core/utility/SparseVector.hpp +++ b/opm/core/utility/SparseVector.hpp @@ -40,7 +40,6 @@ #include #include #include -#include #include namespace Opm From 2977d8659e7710cd1abbae8af5f8494c339ce352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Thu, 11 Jan 2018 15:00:49 +0100 Subject: [PATCH 2/2] Make constructor generic. This supports std::vector and Opm::TableColumn (from opm-parser) as before, but without requiring any OPM includes, making the class independent. --- opm/core/utility/NonuniformTableLinear.hpp | 40 ++++------------------ 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/opm/core/utility/NonuniformTableLinear.hpp b/opm/core/utility/NonuniformTableLinear.hpp index 5d7c9276..2fdd1599 100644 --- a/opm/core/utility/NonuniformTableLinear.hpp +++ b/opm/core/utility/NonuniformTableLinear.hpp @@ -27,7 +27,6 @@ #include #include -#include #include @@ -50,14 +49,9 @@ namespace Opm /// @brief Construct from vectors of x and y values. /// @param x_values vector of domain values /// @param y_values vector of corresponding range values. - NonuniformTableLinear(const std::vector& x_values, - const std::vector& y_values); - - NonuniformTableLinear(const TableColumn& x_column, - const std::vector& y_values); - - NonuniformTableLinear(const TableColumn& x_column, - const TableColumn& y_column); + template + NonuniformTableLinear(const XContainer& x_values, + const YContainer& y_values); /// @brief Get the domain. /// @return the domain as a pair of doubles. @@ -130,10 +124,11 @@ namespace Opm template + template inline NonuniformTableLinear - ::NonuniformTableLinear(const TableColumn& x_column, - const TableColumn& y_column) + ::NonuniformTableLinear(const XContainer& x_column, + const YContainer& y_column) : x_values_( x_column.begin() , x_column.end()), y_values_( y_column.begin() , y_column.end()) { @@ -141,29 +136,6 @@ namespace Opm } - template - inline - NonuniformTableLinear - ::NonuniformTableLinear(const TableColumn& x_column, - const std::vector& y_values) - : x_values_( x_column.begin() , x_column.end()), - y_values_(y_values) - { - assert(isNondecreasing(x_values_.begin(), x_values_.end())); - } - - - - template - inline - NonuniformTableLinear - ::NonuniformTableLinear(const std::vector& x_values, - const std::vector& y_values) - : x_values_(x_values), y_values_(y_values) - { - assert(isNondecreasing(x_values.begin(), x_values.end())); - } - template inline std::pair NonuniformTableLinear