Re: Associative Array with double[][]

2021-07-22 Thread bauss via Digitalmars-d-learn
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

Re: Associative Array with double[][]

2021-07-21 Thread frame via Digitalmars-d-learn
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.

Re: Associative Array with double[][]

2021-07-21 Thread frame via Digitalmars-d-learn
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

Associative Array with double[][]

2021-07-21 Thread seany via Digitalmars-d-learn
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