Skip to content
Snippets Groups Projects

WIP: row-major everywhere; restore masks in GUI (#724,761,762)

Closed Wuttke, Joachim requested to merge j.761+724f into main
41 files
+ 392
1352
Compare changes
  • Side-by-side
  • Inline
Files
41
+ 4
5
@@ -94,17 +94,16 @@ std::vector<int> Frame::allIndices(size_t i_flat) const
return result;
}
size_t Frame::projectedIndex(size_t i_flat, size_t k_axis) const
size_t Frame::projectedIndex(size_t i, size_t k_axis) const
{
ASSERT(k_axis < rank());
if (rank() == 1)
return i_flat;
return i;
if (rank() == 2) {
if (k_axis == 0)
return (i_flat / m_axes[1]->size()) % m_axes[0]->size();
return i % m_axes[0]->size();
if (k_axis == 1)
return i_flat % m_axes[1]->size();
ASSERT_NEVER;
return (i / m_axes[0]->size()) % m_axes[1]->size();
}
ASSERT_NEVER;
}
Loading