Home > Archive > Scheme > September 2006 > Two dimensional array...
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Two dimensional array...
|
|
|
| I would like to know whether there is an efficient SRFI of 2
dimensional array. I mean, 2 dimensional arrays that one can use for
numerical analysis. I have been using Bigloo, and I know for sure that
Bigloo does not provide anything of the kind. Farr proposes
(module f64vector
(type (tvector f64vector (double)))
(eval (export-all)))
This solves the problem as far as efficiency goes, but I would like to
have a 2D syntax, so it would be easier to port 2D array algorithms to
Scheme.
| |
| Per Bothner 2006-08-27, 4:01 am |
| Edu wrote:
> I would like to know whether there is an efficient SRFI of 2
> dimensional array. I mean, 2 dimensional arrays that one can use for
> numerical analysis. I have been using Bigloo, and I know for sure that
> Bigloo does not provide anything of the kind. Farr proposes
>
> (module f64vector
> (type (tvector f64vector (double)))
> (eval (export-all)))
>
> This solves the problem as far as efficiency goes, but I would like to
> have a 2D syntax, so it would be easier to port 2D array algorithms to
> Scheme.
>
Kawa supports SRFI 25 arrays that wrap SRFI 4 uniform vectors.
See the end of: http://www.gnu.org/software/kawa/Arrays.html
This makes efficient storage. Kawa doesn't yet optimize arithmetic
or access of the elments of such arrays, though. One can write
performance-critical code using Java. Or nag me to implement these
optimizations.
If by "2-D" syntax, you means something like Common Lisp's
#2A((0 1 5) (foo 2 (hot dog)))
then Kawa doesn't yet support that. It wouldn't be difficult
to implement, but of course that still eaves the issue of how
to specify that this is an array of (say) unboxed doubles.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
| |
| Aubrey Jaffer 2006-09-01, 7:02 pm |
| "Edu" <edu500ac@yahoo.com> writes:
> I would like to know whether there is an efficient SRFI of 2
> dimensional array. I mean, 2 dimensional arrays that one can use for
> numerical analysis. ... but I would like to have a 2D syntax, so it
> would be easier to port 2D array algorithms to Scheme.
SCM efficiently implements the homogeneous and heterogeneous
multi-dimensional arrays of SRFI-63 with read syntax SRFI-58.
|
|
|
|
|