develooper Front page | | Postings from August 2000

Special syntax for 2-d

Thread Next
Baris Sumengen
August 29, 2000 08:14
Special syntax for 2-d
Message ID:

On 8/29/00 at 2:31 PM Jeremy Howard wrote:

>The role of this list is to try and create the features necessary to make
>Perl the best language for data crunching around, while keeping it

"Easy things should be easy".

PDL has a great and powerful built-in multidimentional support, which makes
it a better tool than most similar packages. But on the other hand 90%
(maybe more) of the number crunching is done using 2-d matrices. Matlab 4.x
didn't have any idea of multidimentionality (as far as I know) and it was
the most popular tool back than. Sometimes the multidimentional syntax
makes it painful for people who wants to just use 2-d matrices. So I
suggest syntax improvements specific for 2-d (A dual representation where
someone can use either multidimentional syntax for 2-d or the new
simplified syntax). This idea is not restrictive at all and doesn't effect
the current syntax. I think it as a syntax alias. I have to admit that I
didn't write many pdl programs (only couple of them) so maybe somebody else
who wrote programs using 2-d might comment.

For example to create a new 3x4 matrix you should write:
$m = pdl [1, 2, 3],
              [3, 3, 4],
              [2, 4, 5],
              [2, 4, 6];

I find this painful and would prefer:
$m = pdl [1 2 3,
               3 3 4,
               2 4 5,
               2 4 6];


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About