diff options
author | Daniel Llorens <daniel.llorens@bluewin.ch> | 2013-04-24 23:29:48 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2014-01-27 21:48:02 +0100 |
commit | cdd7cc9e9b3750a759ab442249a6f004a503fba5 (patch) | |
tree | f36e7f8ef3dd7c5288cabf1602f87e51f0f21aa0 /test-suite | |
parent | 7c78a99f80642c0340faaa3ee45a07637f2bf351 (diff) | |
download | guile-cdd7cc9e9b3750a759ab442249a6f004a503fba5.tar.gz |
Rewrite scm_ramapc()
* libguile/array-map.c
- (cind): replace by cindk, that operates only on the unrolled index set.
- (klen): new function.
- (make1array): take extra inc argument.
- (scm_ramapc): rewrite to unroll as many axes as possible instead of just all
or one.
- (AREF): lbnd is known to be 0: remove.
- (ASET): v is known to come from SCM_I_ARRAY_V; assume base, inc, lbnd.
- (racp): use ssize_t instead of long for the indices.
- (scm_array_index_map_x): build the index list at the last-but-one axis, then
set the car of the last element, instead of building the list at the last axis.
* test-suite/tests/ramap.test
- add array-map! test with offset arguments.
Diffstat (limited to 'test-suite')
-rw-r--r-- | test-suite/tests/ramap.test | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test-suite/tests/ramap.test b/test-suite/tests/ramap.test index acb0f22d8..037850582 100644 --- a/test-suite/tests/ramap.test +++ b/test-suite/tests/ramap.test @@ -316,7 +316,14 @@ (c (make-array 0 2))) (begin (array-map! c + (array-col a 1) (array-row a 1)) - (array-equal? c #(3 6)))))) + (array-equal? c #(3 6))))) + + (pass-if "offset arrays 1" + (let ((a #2@1@-3((0 1) (2 3))) + (c (make-array 0 '(1 2) '(-3 -2)))) + (begin + (array-map! c + a a) + (array-equal? c #2@1@-3((0 2) (4 6))))))) ;; note that array-copy! has the opposite behavior. |