[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: associative array
From: |
Andrew Janke |
Subject: |
Re: associative array |
Date: |
Thu, 26 Mar 2020 18:13:01 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
On 3/26/20 6:07 PM, Francesco Potortì wrote:
>>> Are there more efficient ways to build and update an associative array?
>
>> cheating and looking at matlab documentation, they point to Map containers
>> objects as being specifically built for key-value pair mapping, and it
>> appears Octave has a compatible implementation. see:
>> https://octave.org/doc/v5.2.0/containers_002eMap.html
>
> Yes, I had seen that by looking for "hash" in the documentation, whose
> index contain an "hash table" entry. The manual does not explain how to
> use it, so I have neglected it.
>
> Thank you. If the slowness turns out ot be unbearable I will consider it.
>
FWIW: Matlab's containers.Map is a bummer, because it's a
pass-by-reference handle object, so it doesn't play well with normal
Matlab/Octave objects and data structures. I've found that this
limitation makes it basically useless for M-code programming over the
last couple years.
It would be nice if there were a pass-by-value/COW version of
containers.Map. I know that Octave core is shy of "innovating" in
non-Matlab-compatible ways, but maybe an exception should be made here.
Cheers,
Andrew