Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Apl > Re: Filling a m...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 6 Topic 923 of 1019
Post > Topic >>

Re: Filling a matrix with values

by sethb@[EMAIL PROTECTED] (Seth) Dec 24, 2007 at 04:09 PM

In article
<4de20ca0-f5e8-44ee-be1e-43ce7b422eaf@[EMAIL PROTECTED]
>,
Jimmy Miller  <CaptainThunder@[EMAIL PROTECTED]
> wrote:
>I'm a complete beginner to APL, and I had the following question:
>
>Suppose I have a 16x16 matrix of values.  How would I set each value
>in the matrix (starting in the second row) equal to the sum of the
>matrix element directly above it, and the element to the top-left of
>it?  Essentially,
>
>m[x;y]=m[x;y-1]+m[x-1;y-1]
>
>But I'm not sure how to express that in APL.

Two possibilities:

1. In a modern APL, something like 16 {x + 0, -1 <drop> x} \ topvector

2. In primitive APL (e.g. APL\360), some thinking shows that there's a
   magic matrix M, where the result is M +.* topvector.  Analysis gets
   M as a form of Pascal's Triangle, so it can be generated as a
   1-liner.

Seth




 6 Posts in Topic:
Filling a matrix with values
Jimmy Miller <CaptainT  2007-12-24 04:19:11 
Re: Filling a matrix with values
Lance <LanceMD@[EMAIL   2007-12-24 07:13:20 
Re: Filling a matrix with values
Phil Last <phil.last@[  2007-12-24 07:53:14 
Re: Filling a matrix with values
sethb@[EMAIL PROTECTED]   2007-12-24 16:09:26 
Re: Filling a matrix with values
aleph0 <apl68000@[EMAI  2007-12-24 10:10:37 
Re: Filling a matrix with values
admin9974@[EMAIL PROTECTE  2007-12-25 12:34:28 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 1:41:19 CDT 2008.