Matrix class

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Thu May 10 01:08:02 PDT 2007


Bill Baxter wrote:
> Frits van Bommel wrote:
>> Bill Baxter wrote:
>>> Silverling wrote:
>>  >> Bill Baxter wrote:
>>>>> Storage format?
>>>> Currently Type[row][col].
>>>
>>> Got it.  You may be better off with Type[row*col].  Type[row][col] is 
>>> an array of col pointers to 1D arrays of rows, rather than densely 
>>> packed memory.
>>
>> No, it's definitely densely packed memory. Static arrays always put 
>> their elements directly where you put the array itself, "inline".
>>
>> Only dynamic (Type[]) and associative (Type[Type2]) arrays use 
>> "hidden" pointers.
> 
> Ok, but he said it was going to be resizeable.  Does that change your 
> answer?

Hmm... Right. I don't see how he could do that for non-square matrices 
without allocating a new matrix; if general resizing is implemented, he 
must've used a different storage format (not Type[row*col] either, but 
Type[] with length (row*col) would work). Maybe he was just inaccurate 
with in his answer...


More information about the Digitalmars-d-learn mailing list