On Thursday, 22 July 2021 at 03:13:14 UTC, seany wrote:
I have a perimeter of a shape, given by a `double [][]` . I
want to keep the lengths of various diagonals in another
associative array.
So,
/// define some associative array to keep track of
diagonals here..
auto perimeter = n
On Thursday, 22 July 2021 at 04:46:13 UTC, frame wrote:
Of course a double* makes more sense than a void* type for the AA
here.
On Thursday, 22 July 2021 at 03:13:14 UTC, seany wrote:
If there are multiple possibilities, what is the fastest in
terms of memory? Thank you.
I believe the fastest way (as seen from your loop) would be using
pointer arithmetric and using void* keys for diagonalLengths and
an index function
I have a perimeter of a shape, given by a `double [][]` . I want
to keep the lengths of various diagonals in another associative
array.
So,
/// define some associative array to keep track of diagonals
here..
auto perimeter = new double[][] (0,0);
/// --- fill up perimeter here