Yes it's silly, but there were some worthwhile points:

a. Benchmarks require care. e.g. exclude the time to
generate the random numbers; in fact, exclude
everything you can except for the operations you
are comparing.

b. Regarding your second paragraph ("Does J reduce
thinking time? Not really in this case. ...")  

Depends on what you mean by "this case".

b.1 It used to be that MatLab has a small limit (2 or 3)
on the rank (dimensionality) of an array, so that if you 
want to do inner product of higher-ranked arrays J does
have a thinking advantage.  In fact, knowing that there
is such a limit the thinking is more likely to be,
why would I want to do that?

b.2 J permits inner products on other operations, such 
as ~:/ .* or *./ .> .

b.3 If you consider matrix inversion as part of "this case"
then the Hilbert matrix example may be a plus on the
J side.  I don't whether MatLab can invert the 40-by-40
Hilbert matrix but if it does not have extended precision 
it would not be able to.

   det=: -/ .*
   0j_10 ": det % 1 + +/~ i.40x
1.0971114170e_932



----- Original Message -----
From: John Randall <[EMAIL PROTECTED]>
Date: Friday, November 9, 2007 3:07
Subject: Re: [Jprogramming] Re: speed of matrix*vector operation
To: Programming forum <[email protected]>

> Are such contests silly?  Yes, unless you are modelling the 
> universe.Then you need better hardware.
> 
> Does J reduce thinking time?  Not really in this 
> case.  J and MATLAB
> have builtin functions for matrix multiplication and 
> inversion.  If
> you were writing in C, you would need a bit more thinking time for
> matrix multiplication and a lot more for inversion.
> 
> Even though it is heresy, it may be the case that MATLAB can do
> matrix multiplication faster than J.  The reason is the 
> BLAS (Basic
> Linear Algebra Subprograms), used for linear algebra in scientific
> computing (for example, it underpins LAPACK).  The BLAS is 
> tuned to
> a particular CPU chip, since the algorithm used may depend on cache
> size, ability to pipeline, etc.  Some versions will fine tune
> themselves from the actual system.
> 
> MATLAB makes a big point of this, for example a feature of 
> version 7.5
> is
> 
> Upgraded Linear Algebra Package library (LAPACK 3.1) on all platforms,
> plus upgraded optimized Basic Linear Algebra Subprogram libraries
> (BLAS) on AMD processors (AMCL 3.6)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to