PADRE-9: Replace nested vector with xtensor for DDECal next_solutions
This MR is a prerequisite for !680 (merged).
In this MR, the next_solutions
data structure is refactored to use an 4D xt::xtensor
(wrapped in a aocommon::xt::Span
), rather than a double-nested std::vector
.
The original code had two dimensions: channel
and solution/polarization
, with solution
actually containing antenna
and direction
dimensions. Using a 4D datatype leads to more readable code, which should be easier to maintain because the index calculations (and in some cases even entire parts of the computation) have become simpler.
This also allows the use of a custom allocator. We aim to use this in padre-5-ddecal to work on page-locked memory that works well for GPU I/O, without the need to copy to another temporary buffer.
For consistency, solutions
should also use xt::xtensor
. As this data structure is used in even more places than next_solutions
, this will require a very significant amount of effort which is outside the scope of this MR.