is it possible to define a property to access (read/write) a matrix? (I.e., more dimensions than a vector)

Charles D Hixson charleshixsn at earthlink.net
Sat Jul 29 11:09:43 PDT 2006


Hasan Aljudy wrote:
> 
> 
> Charles D Hixson wrote:
>> Hasan Aljudy wrote:
>>
>>>
>>> Charles D Hixson wrote:
>>>
>>>> Mike Parker wrote:
>>>>
>>>>
>>>>> Charles D Hixson wrote:
>>>>>
>>>>>
>>>>>> ...
>>>
>>> Note that float vals[][] in D is actually a jagged array.
>>> I think it would be a better idea to store the matrix internally as a
>>> one-dimensional array.
>>>
>>
>> I'm sure you're right.  I'd planned to allocate a static
>> array at run time, but apparently that only works for one
>> dimensional arrays...in which case (I think) I do just as
>> well by using a dynamic array and setting the length before
>> I use it.
>>
> 
> uhh .. static array means array allocated at compile time ^_^'
Which is probably where I went wrong.  I was thinking of
"fixed size" as opposed to "dynamic", so I was figuring that
I could allocate a "static" (i.e. fixed size) doubly indexed
array on the stack.  It's no big deal...it just means that I
need to code in an index method (ndx = row + col*(# rows) ).




More information about the Digitalmars-d-learn mailing list