public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Robert G. Brown" <rgb@phy.duke.edu>
To: Tuomo Keskitalo <Tuomo.Keskitalo@iki.fi>
Cc: GSL Discuss Mailing List <gsl-discuss@sourceware.org>
Subject: Re: GSL 2.0 roadmap (one man's view)
Date: Sun, 20 Sep 2009 13:23:00 -0000	[thread overview]
Message-ID: <alpine.LFD.2.00.0909200907570.8848@lilith> (raw)
In-Reply-To: <4AB5F77F.8020104@iki.fi>

On Sun, 20 Sep 2009, Tuomo Keskitalo wrote:

> I agree that use of other libraries and even other languages with GSL should 
> be made as easy as possible. Data structures with dimension > 1 should be 
> explicit about the data being stored as "column-major" or "row-major".

I agree completely, and I further strongly suggest that a) the actual
data in any tensor form be stored in a single contiguous vector whose
address is available to the user and not hidden inside an opaque data
object; b) the tensor itself be a **...*pointer, cast to the desired
type, packed with the offsets into this vector; c) that the data should
be stored/packed using the same convention that C already uses to pack
e.g. v[i], m[i][j] declared data types.  Yes, this leaves one with the
perpetual conflict with e.g. fortran libraries, but GSL is a C library,
not a fortran library, and it should conform to the common usages and
standards of C and not try to interpolate to make fortran programmers
comfortable at the expense of C programmers.

My reasons for each suggestion are straightforward.  a) permits many
routines, e.g. ODE solvers, to be written for general purpose tensors by
letting them trivially directly access the vector data associated with
the tensor; b) allows the caller to use meaningful tensor notation to
evaluate functional forms throughout their code instead of using get or
set utilities to access particular elements of the tensor; c) makes the
code portable in critical ways -- it would be silly to have

for(i=0;i<imax;i++)
   for(j=0;j<jmax;j++)
      cmatrix[i][j] = gslmatrix[i][j];

(where cmatrix is a matrix allocated via e.g. double
cmatrix[imax][jmax] and gslmatrix is one created via the process
suggested above) do the wrong thing, and higher rank tensors should
obviously satisfy the same convention to make programming contractions
etc maximally simple.

Since MANY GSL routines could be affected by this -- in particular ODE
solution, linear algebra routines (if/when this is added),
multidimensional quadrature routines (ditto) -- the discussion should
occur at the very beginning.

    rgb

>
> -- 
> Tuomo.Keskitalo@iki.fi
> http://iki.fi/tuomo.keskitalo
>

Robert G. Brown	                       http://www.phy.duke.edu/~rgb/
Duke University Dept. of Physics, Box 90305
Durham, N.C. 27708-0305
Phone: 1-919-660-2567  Fax: 919-660-2525     email:rgb@phy.duke.edu


  reply	other threads:[~2009-09-20 13:23 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-30 17:07 ode-initval implicit solvers and development Tuomo Keskitalo
2008-10-01 18:29 ` Brian Gough
2008-10-09 13:22 ` Brian Gough
2008-11-02 17:35 ` Tuomo Keskitalo
2008-11-03 18:09   ` Brian Gough
2009-01-24 11:52     ` Tuomo Keskitalo
2009-02-01 17:01       ` Brian Gough
2009-02-02 17:05         ` Tuomo Keskitalo
2009-03-01 14:37           ` Tuomo Keskitalo
2009-03-03 16:34             ` Brian Gough
2009-03-05 19:47               ` Tuomo Keskitalo
2009-03-05 19:54                 ` Heikki Orsila
2009-03-06 20:03                 ` Brian Gough
2009-04-05 12:28             ` Tuomo Keskitalo
2009-05-01 14:05             ` Tuomo Keskitalo
2009-05-04 11:23               ` Brian Gough
2009-05-08 10:51               ` Brian Gough
2009-08-06 13:51                 ` GSL 2.0 roadmap Tuomo Keskitalo
2009-08-21 20:42                   ` Brian Gough
2009-08-27 11:42                     ` Tuomo Keskitalo
2009-08-27 12:51                       ` Robert G. Brown
2009-08-28 13:57                         ` Jordi Burguet Castell
2009-08-27 17:13                           ` Robert G. Brown
2009-08-28 13:58                       ` Brian Gough
2009-08-27 23:10                     ` Gerard Jungman
2009-08-27 23:13                       ` GSL 2.0 roadmap (one man's view) Gerard Jungman
2009-08-28 13:58                         ` Brian Gough
2009-09-16  0:43                           ` Gerard Jungman
2009-09-03 19:37                         ` Brian Gough
2009-09-16  0:44                           ` Gerard Jungman
2009-09-07 15:10                         ` Brian Gough
2009-09-07 15:34                           ` Rhys Ulerich
2009-09-07 18:21                             ` Robert G. Brown
2009-09-16  0:47                           ` Gerard Jungman
2009-09-18  3:51                             ` column-major Z F
2009-09-21 12:08                               ` column-major Brian Gough
2009-09-07 15:10                         ` GSL 2.0 roadmap (one man's view) Brian Gough
2009-09-16  0:45                           ` Gerard Jungman
2009-09-20  9:36                             ` Tuomo Keskitalo
2009-09-20 13:23                               ` Robert G. Brown [this message]
2009-09-20 15:31                                 ` Rhys Ulerich
2009-09-20 16:19                                   ` Robert G. Brown
2009-09-21 15:13                                   ` Brian Gough
2009-09-20 15:08                               ` Rhys Ulerich
2009-09-21 12:08                               ` Brian Gough
2009-09-07 15:10                         ` Brian Gough
2009-09-16  0:46                           ` Gerard Jungman
2009-09-16  2:48                             ` Robert G. Brown
2009-09-17 19:14                             ` Brian Gough
2009-09-07 15:10                         ` Brian Gough
2009-09-16  0:47                           ` Gerard Jungman
2009-09-27  8:03                             ` new double precision data structure? Tuomo Keskitalo
2009-09-28  8:44                               ` James Bergstra
2009-09-28 15:48                                 ` Tuomo Keskitalo
2009-10-16 13:59                                   ` Brian Gough
2009-09-29 18:38                               ` Gerard Jungman
2009-09-07 15:10                         ` GSL 2.0 roadmap (one man's view) Brian Gough
2009-09-16  0:46                           ` Gerard Jungman
2009-09-17 20:12                             ` Brian Gough
2009-09-07 15:10                         ` Brian Gough
2009-09-16  0:44                           ` Gerard Jungman
2009-09-17 20:12                             ` Brian Gough
     [not found]                           ` <645d17210909090818u474f32f0q19a6334578b9f02c@mail.gmail.com>
2009-09-17 19:14                             ` Brian Gough
2009-08-28 13:58                     ` GSL 2.0 roadmap Brian Gough

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.0909200907570.8848@lilith \
    --to=rgb@phy.duke.edu \
    --cc=Tuomo.Keskitalo@iki.fi \
    --cc=gsl-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).