On Sun, 23 Jan 2011, Claude Heiland-Allen wrote:
essentially, it creates a matrix of 1d splines, but now I see that this isn't
what you wanted...
for interpolated 2d matrix lookup, something like this, perhaps:
Interpolated matrix or vector lookup can of course be written as
interpolation of sub-matrices or sub-vectors. For lazy matrices and
vectors this would be almost as efficient.
interp i v =
vectorIndex (floor i) $
interpolateVectorSpace (fraction i)
(Vector.take (n-3) $ Vector.drop 0 v)
(Vector.take (n-3) $ Vector.drop 1 v)
(Vector.take (n-3) $ Vector.drop 2 v)
(Vector.take (n-3) $ Vector.drop 3 v)
(Sorry for the many fictional functions.)
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe