Added TableColumn based overloads.
This commit is contained in:
parent
65ff9bb75b
commit
a566ac608d
@ -27,8 +27,10 @@
|
||||
#include <utility>
|
||||
|
||||
#include <opm/common/ErrorMacros.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/TableColumn.hpp>
|
||||
#include <opm/core/utility/linearInterpolation.hpp>
|
||||
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
@ -51,6 +53,12 @@ namespace Opm
|
||||
NonuniformTableLinear(const std::vector<double>& x_values,
|
||||
const std::vector<T>& y_values);
|
||||
|
||||
NonuniformTableLinear(const TableColumn& x_column,
|
||||
const std::vector<T>& 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<double, double> domain();
|
||||
@ -120,6 +128,32 @@ namespace Opm
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline
|
||||
NonuniformTableLinear<T>
|
||||
::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<typename T>
|
||||
inline
|
||||
NonuniformTableLinear<T>
|
||||
::NonuniformTableLinear(const TableColumn& x_column,
|
||||
const std::vector<T>& y_values)
|
||||
: x_values_( x_column.begin() , x_column.end()),
|
||||
y_values_(y_values)
|
||||
{
|
||||
assert(isNondecreasing(x_values_.begin(), x_values_.end()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline
|
||||
NonuniformTableLinear<T>
|
||||
|
Loading…
Reference in New Issue
Block a user