public inbox for
 help / color / mirror / Atom feed
From: David Zaslavsky <>
To: "" <>
Subject: Re: [Help-gsl] Getting an extension listed on GSL page
Date: Sun, 05 Jan 2014 20:31:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

[-- Attachment #1: Type: text/plain, Size: 4334 bytes --]

I just noticed this message seems not to have made it out to the list
when I originally sent it on Friday. So I'm trying again.


Hi Patrick,

Thanks for the feedback. First let me say that texinfo documentation
will not be a problem. I'm happy to add it, but it's just a matter of
time - I have a lot of other things going on so it will probably take on
the order of some weeks for me to find time to do that.

On the indexing issue: interp2d treats the x index as the column
coordinate and the y index as the row coordinate, so that xsize is the
number of columns and ysize is the number of rows. This is done for
compatibility with Cartesian coordinates: most people envision x as the
horizontal coordinate and y as the vertical one. Given this
interpretation, the current implementation of INDEX_2D does use
row-major order.

If I'm not mistaken, it's still possible to use a GSL matrix's data
array in interp2d without transposing if you pass the y index as i and
the x index as j to gsl_matrix_get and friends.
  gsl_matrix_alloc(ysize, xsize)
  gsl_matrix_get(m, yi, xi)
So I would say the real issue is not the implementation, but the
variable naming.

I think it's worth putting in some thought on how best to resolve this
without confusing people. For compatibility with gsl_matrix, it might be
better to ditch the names xi, yi, xsize, ysize in favor of j, i, size2,
size1 respectively. But I must admit I find the x and y naming
convention much more intuitive. I guess something else I could do is
switch the order of the x and y arguments in the interp2d functions, to
put yi, ysize, etc. first. That would make it better correspond with the
standard notation in which the first index labels the row of the matrix
and the second index labels the column. But then again it would cause
some headaches with people who are already using the code. (I'm not sure
how many users the library has.)

Also, I should mention that I don't consider interp2d to be
feature-complete, nor am I in any particular rush to make it complete.
There are some features I'm interested in adding, including additional
interpolation schemes, more interpolation methods without boundary
checks (for extrapolation), etc. How would this move affect my ability
to continue to add features?

:) David

On 01/03/2014 02:00 PM, Patrick Alken wrote:
> Hi David, I'm moving this thread over to gsl-discuss from help-gsl.
> I've been taking a look at your interp2d code since I'm currently doing
> some work which needs 2d interpolation. I like your coding style and
> think this should be moved into the repository at some point.
> Just a few initial thoughts:
> 1. Your INDEX_2D macro for indexing the z array appears to use
> column-major ordering, even though the comment in the .h file says
> row-major. IE: it is currently defined as:
> #define INDEX_2D(xi, yi, xsize, ysize) ((yi) * (xsize) + (xi))
> which would store each column contiguously in memory instead of each
> row. The GSL gsl_matrix structure uses row-major ordering (see
> gsl_matrix_double.h):
> 283   return m->data[i * m->tda + j] ;
> and so if a user wants to store their 2D grid in a gsl_matrix, its not
> straightforward to just pass m->data as the z array argument to your
> functions; they'd have to transpose first.
> 2. It would be really great if you could document your library with
> texinfo so when we fold the code into the repository the docs are ready
> to go. You can look at some other extensions for examples (ie see the
> doc/alf.texi file in the ALF extension)
> Patrick
> On 08/16/2013 05:09 PM, David Zaslavsky wrote:
>> Hi there,
>> For quite some time I've been working on a 2D interpolation library
>> compatible with the GSL. I've mentioned it a couple times on this list.
>> With some recent work it's gotten to the point where I consider it
>> ready for a first release. How would I go about getting it listed in the
>> "Extensions" section on the GSL web page?
>> Also if anyone would like to try compiling and running the test suite,
>> I'd appreciate knowing about any bugs that pop up. I've only tried it on
>> Linux with GCC 4.6.3.
>> :) David

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 295 bytes --]

  reply	other threads:[~2014-01-05 20:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
2014-01-03 19:00 ` Patrick Alken
2014-01-05 20:31   ` David Zaslavsky [this message]
2014-01-06 16:58     ` interp2d discussion Patrick Alken
2014-01-10  6:05       ` David Zaslavsky
2014-01-10  6:11       ` David Zaslavsky
2014-01-10 16:37         ` Patrick Alken
2014-01-11  0:28           ` jeremy theler
2014-01-11  1:55             ` Patrick Alken
2014-01-14  1:51               ` jeremy theler
2014-01-14  2:23                 ` Patrick Alken
2014-01-11  1:58             ` David Zaslavsky

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:

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

  git send-email \ \ \ \

* 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).