Re: dgemm subroutine in BLAS - I think I've cracked the difference, please confirm

From: Ron Shepard (ron-shepard_at_NOSPAM.comcast.net)
Date: 02/14/05


Date: Sun, 13 Feb 2005 23:53:27 -0600

In article <d_6dnXmi_Nh1io3fRVn-vw@comcast.com>,
 glen herrmannsfeldt <gah@ugcs.caltech.edu> wrote:

> If you have a matrix with one row per line in a file, and columns
> on successive lines, and read it in using either list directed or
> formatted input in the natural Fortran ordering, which is row and which
> is column?

While this is true, it has nothing to do with DGEMM or with most
mathematical subroutines. A typical mathematical subroutine might
consist of dozens or hundreds of lines involving array subscripts
but not a single I/O operation on them. The C convention might
appear simpler for that rare I/O statement, but the fortran
convention is simpler for those dozens or hundreds of lines of code
that are actually doing the work. And if you are debugging the
code, is is almost certainly not an I/O operation that is the
problem.

I fairly seldom make mistakes getting fortran array indices
interchanged when I write code. I won't say it is never, but it is
rare. However, when I write C or Mathematica code, both of which
use the backward array index conventions, it is almost a coin toss
whether I get it right or not the first time. The reason is that it
just doesn't match up with the mathematics that I'm usually trying
to do. It is not just a matter of switching row and column indices,
it is also a question of which conventions the various subprograms
and built-in functions use. I've been programming C for over 20
years and Mathematica for about 15 years, so you might think I'd
catch on eventually, but the fact that I don't is evidence of a
serious design flaw in those languages for doing standard
mathematical operations.

$.02 -Ron Shepard



Relevant Pages

  • Re: Verbose functional languages?
    ... Sometimes it is unavoidable to use Fortran. ... I used Mathematica a lot, ... We recently bought a Mac Mini and a SlideArch keyboard. ...
    (comp.lang.functional)
  • Re: A question on Newtons Method
    ... bug reports per day. ... there are arbitrary-precision integers and rationals (Num in OCaml, ... native format in Mathematica, and a major hassle in Fortran). ...
    (sci.math.num-analysis)
  • Re: A question on Newtons Method
    ... Have you considered the Fortran equivalent of my numerical ... the Mathematica implementation is much more powerful as it ... > referring to the original function ... incorrect Mathematica code, it is actually incorrect mathematics - you've ...
    (sci.math.num-analysis)
  • Re: Excel Math Bug
    ... > Yeah, it's a convention, but there IS an established convention in math, ... or academic math convention has been deviated ... Or the language applications just didn't feel it necessary to ... real math application -- maybe Mathematica. ...
    (sci.math)
  • Re: Excel Math Bug
    ... > Yeah, it's a convention, but there IS an established convention in math, ... or academic math convention has been deviated ... Or the language applications just didn't feel it necessary to ... real math application -- maybe Mathematica. ...
    (microsoft.public.excel.programming)