Skip to content
Snippets Groups Projects
Commit 4062c7de authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

Datafield::values2D use FieldUtil::reshapeTo2D

parent 0a119f26
No related branches found
No related tags found
1 merge request!2701everywhere using double2d_t for vector<vector<double>; move fcts to FieldUtil; simplify & unify initialization
...@@ -413,19 +413,5 @@ Datafield Datafield::normalizedToMax() const ...@@ -413,19 +413,5 @@ Datafield Datafield::normalizedToMax() const
double2d_t Datafield::values2D() const double2d_t Datafield::values2D() const
{ {
ASSERT(rank() == 2); return FieldUtil::reshapeTo2D(m_values, axis(1).size());
double2d_t result;
const size_t nrows = axis(1).size();
const size_t ncols = axis(0).size();
result.resize(nrows);
for (size_t row = 0; row < nrows; ++row) {
result[row].resize(ncols, 0.0);
for (size_t col = 0; col < ncols; ++col)
result[row][col] = m_values[row * ncols + col];
}
return result;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment