[Gsll-devel] Introducing "Grid Structured Data"

Tamas Papp tkpapp at gmail.com
Wed Jan 13 06:54:15 UTC 2010


On Tue, 12 Jan 2010, Mirko Vukovic wrote:

> Features that I would like:
> 
>    1. Compatibility with GSLL and LAPACK (and NETLIB for that matter).  When
>    doing numerics, I would use grid (or xarray) and forget about cl-arrays.

LLA, a Lisp interface to LAPACK, already supports xarray.  LLA is on
github, but it is undergoing a major rewrite at the moment --- drop me
an e-mail if you are interested in the latest version (which I will
push soon anyway).

>    2. More forgiving interface in array creation: coerce supplied values to
>    declared type
>    3. syntactic sugar: refer to array subscripts using underscores: a_i_j or
>    a_2:5_*
> 
> On that last point, I have a small utility that does the first example.  I
> am not sure where to post it for your review.  I  think github is overkill
> to post three files (asd, package, and lisp).

paste.lisp.org

> I am intrigued by xarrays' generic interface, so that xarrays can interface
> with `any type of object'.  I fail to see its use now, but that is just my
> lack of imagination.

Imagine that you write your

(do-something-to-a matrix)

method, which is supposed to work on, say, GSLL matrices.  You can
define a fallback method as

(defmethod do-something-to-a (matrix)
  (do-something-to-a (take 'gsll:matrix matrix)))

and from then on, your method will work with all kinds of matrix-like
objects for which you have defined take methods.  Of course,
conversion may not be fast, but for exploratory programming, you
should not worry about this.

> On a `lack of imagination' topic, can someone give me an example of indexing
> that xarray has, and that the affine indexing cannot accomplish?

Eg if you want the first, second, and fifth row from a matrix.

Tamas




More information about the gsll-devel mailing list