jed-users mailing list

[2003 Date Index] [2003 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: howto concat arrays


Günter Milde <milde@xxxxxxxxxxxxxxxxxxxx> wrote:
>> Versions of slang _prior_ to 1.4.6 allowed one to create 2-d arrays in
>> this manner if the dimensions of the arrays allow it, 
>> ...
>> versions of slang _after_ 1.4.6 simply
>> concatenate the arrays to produce a 1-d array.   
>
>I am glad it works consistently now. 
>
>Two questions remain:
>
>What does version 1.4.6 do?

My mistake.  I meant to say _since_ 1.4.6, instead of _after_ 1.4.6.

>What is the simplest way to create a 2d array _after_ 1.4.6?

What kind of array do you want to create?  A diagonal NxN unit matrix
may be created using

    define diag (N)
    {
       variable a = Int_Type[N,N];
       a[[0:N*N-1:N+1]] = 1;
       return a;
    }

Thanks,
--John

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2003 date index] [2003 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]