Commit 97e8c85a authored by David Frank's avatar David Frank
Browse files

Replace if over dimension with eigen block operation

parent 7b977fbd
Pipeline #652472 passed with stages
in 23 minutes and 53 seconds
......@@ -40,13 +40,12 @@ namespace elsa
const auto spacingPerDim = volumeDescriptor.getSpacingPerDimension();
if (dim == 2) {
coeffs << coeffsPerDimSclaed[0], numberOfPoses;
spacing << spacingPerDim[0], 1;
} else {
coeffs << coeffsPerDimSclaed[0], coeffsPerDimSclaed[1], numberOfPoses;
spacing << spacingPerDim[0], spacingPerDim[1], 1;
}
coeffs.head(dim - 1) = coeffsPerDimSclaed.head(dim - 1);
coeffs[dim - 1] = numberOfPoses; // TODO: with eigen 3.4: `coeffs(Eigen::last) = 1`
spacing.head(dim - 1) = spacingPerDim.head(dim - 1);
spacing[dim - 1] = 1; // TODO: same as coeffs
// Return a pair, then split it using structured bindings
return std::pair{coeffs, spacing};
}();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment