[GSLL-devel] grid:map-n-grids does not play nice with gsll:make-interpolation

Mirko Vukovic mirko.vukovic at gmail.com
Thu Nov 3 19:02:40 UTC 2011


The following is using a a few months old GSLL and SBCL -- I do not want to
upgrade unless absolutely necessary at this moment, because I need to
finish a project first.

Consider the following function:

(defun foo (x y)
  (let ((z (grid:map-n-grids  :combination-function (lambda (y)
                              y)
                  :sources `((,y nil)))))
    (gsll:make-interpolation gsll:+linear-interpolation+
                 x z)))

If I call it twice with vectors of different size on the second call

(let ((x #m(1d0 2d0 3d0))
      (y #m(1d0 1d0 1d0))
      (u #m(1d0 2d0 3d0 4d0))
      (v #m(1d0 1d0 1d0 1d0)))
  (foo x y)
  (foo u v))

I get an error on the second call

Invalid argument; data must match size of interpolation object in interp.c
at line 76
   [Condition of type GSLL:INVALID-ARGUMENT]

It seems that `z' still somehow lives with incorrect dimensions between the
calls.

In actual use, I call foo from repl.  So, before calling it, I force a
recompile, so that it works for a new vector.

Is there a more elegant workaround for this problem?

Thanks,

Mirko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/gsll-devel/attachments/20111103/e49b5cca/attachment.html>


More information about the gsll-devel mailing list