From a566ac608dbc1b8c719ba3c73296f612783ca299 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Tue, 5 Jan 2016 11:48:10 +0100 Subject: [PATCH] Added TableColumn based overloads. --- opm/core/utility/NonuniformTableLinear.hpp | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/opm/core/utility/NonuniformTableLinear.hpp b/opm/core/utility/NonuniformTableLinear.hpp index 3354daa3..5d7c9276 100644 --- a/opm/core/utility/NonuniformTableLinear.hpp +++ b/opm/core/utility/NonuniformTableLinear.hpp @@ -27,8 +27,10 @@ #include #include +#include #include + namespace Opm { @@ -51,6 +53,12 @@ namespace Opm 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); + /// @brief Get the domain. /// @return the domain as a pair of doubles. std::pair domain(); @@ -120,6 +128,32 @@ namespace Opm { } + + template + inline + NonuniformTableLinear + ::NonuniformTableLinear(const TableColumn& x_column, + const TableColumn& y_column) + : x_values_( x_column.begin() , x_column.end()), + y_values_( y_column.begin() , y_column.end()) + { + assert(isNondecreasing(x_values_.begin(), x_values_.end())); + } + + + 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