const std::array<std::vector<double>, dim> &coordinate_values,
const Table<dim, double> & data_values);
+ /**
+ * Like the previous constructor, but take the arguments as rvalue
+ * references and *move*, instead of *copy* the data. This is often useful
+ * in cases where the data stored in these tables is large and the
+ * information used to initialize the current object is no longer needed
+ * separately. In other words, there is no need to keep the original object
+ * from which this object could copy its information, but it might as well
+ * take over ("move") the data.
+ */
+ InterpolatedTensorProductGridData(
+ std::array<std::vector<double>, dim> &&coordinate_values,
+ Table<dim, double> && data_values);
+
/**
* Compute the value of the function set by bilinear interpolation of the
* given data set.
}
} // namespace
+
+
template <int dim>
InterpolatedTensorProductGridData<dim>::InterpolatedTensorProductGridData(
const std::array<std::vector<double>, dim> &coordinate_values,
+ template <int dim>
+ InterpolatedTensorProductGridData<dim>::InterpolatedTensorProductGridData(
+ std::array<std::vector<double>, dim> &&coordinate_values,
+ Table<dim, double> && data_values)
+ : coordinate_values(std::move(coordinate_values))
+ , data_values(std::move(data_values))
+ {
+ for (unsigned int d = 0; d < dim; ++d)
+ {
+ Assert(
+ this->coordinate_values[d].size() >= 2,
+ ExcMessage(
+ "Coordinate arrays must have at least two coordinate values!"));
+ for (unsigned int i = 0; i < this->coordinate_values[d].size() - 1; ++i)
+ Assert(
+ this->coordinate_values[d][i] < this->coordinate_values[d][i + 1],
+ ExcMessage(
+ "Coordinate arrays must be sorted in strictly ascending order."));
+
+ Assert(this->data_values.size()[d] == this->coordinate_values[d].size(),
+ ExcMessage(
+ "Data and coordinate tables do not have the same size."));
+ }
+ }
+
+
+
template <int dim>
TableIndices<dim>
InterpolatedTensorProductGridData<dim>::table_index_of_point(