[Gsll-devel] grid:row and grid:column error when used in sequence on the same marray
Sumant Oemrawsingh
soemraws at xs4all.nl
Tue May 4 11:28:10 UTC 2010
Sorry for the typos in the previous e-mail; I was typing it from memory,
without paying too much attention to detail (bad, I know). Below is an actual
SBCL session.
-Sumant
---START---
* (require :gsll)
; loading system definition from /usr/share/common-lisp/systems/cffi-grovel.asd
; into #<PACKAGE "ASDF2">
; registering #<SYSTEM CFFI-GROVEL {10035FEE21}> as CFFI-GROVEL
; loading system definition from /usr/share/common-lisp/systems/alexandria.asd
; into #<PACKAGE "ASDF2">
; registering #<SYSTEM :ALEXANDRIA {1002D20101}> as ALEXANDRIA
; loading system definition from /usr/share/common-lisp/systems/cffi.asd into
; #<PACKAGE "ASDF2">
; registering #<SYSTEM CFFI {10032F20A1}> as CFFI
; loading system definition from /usr/share/common-lisp/systems/babel.asd into
; #<PACKAGE "ASDF2">
; registering #<SYSTEM BABEL {10035DC9B1}> as BABEL
; loading system definition from
; /usr/share/common-lisp/systems/trivial-features.asd into #<PACKAGE "ASDF2">
; registering #<SYSTEM TRIVIAL-FEATURES {1002C48101}> as TRIVIAL-FEATURES
; loading system definition from
; /usr/share/common-lisp/systems/cl-utilities.asd into #<PACKAGE "ASDF0">
; registering #<SYSTEM CL-UTILITIES {10035EB831}> as CL-UTILITIES
; loading system definition from
; /usr/share/common-lisp/systems/trivial-garbage.asd into #<PACKAGE "ASDF0">
; registering #<SYSTEM TRIVIAL-GARBAGE {10031C11B1}> as TRIVIAL-GARBAGE
; registering #<SYSTEM TRIVIAL-GARBAGE-TESTS {1003481DF1}> as
; TRIVIAL-GARBAGE-TESTS
; loading system definition from /home/soemraws/.sbcl/systems/grid.asd into
; #<PACKAGE "ASDF0">
; registering #<SYSTEM GRID {1003741ED1}> as GRID
; loading system definition from /home/soemraws/.sbcl/systems/c-array.asd into
; #<PACKAGE "ASDF0">
; registering #<SYSTEM C-ARRAY {1003A56591}> as C-ARRAY
("SB-ROTATE-BYTE")
* (defparameter *data* (gsll:make-marray 'double-float :dimensions '(2 2) :initial-contents '((1 2) (3 4))))
*DATA*
* (grid:row *data* 0)
#<GSLL:VECTOR-DOUBLE-FLOAT #(1.0d0 2.0d0)>
* (grid:row *data* 1)
#<GSLL:VECTOR-DOUBLE-FLOAT #(3.0d0 4.0d0)>
* (grid:column *data* 0)
debugger invoked on a GSLL:INVALID-ARGUMENT in thread #<THREAD
"initial thread" RUNNING
{1002ACB011}>:
Invalid argument; vector length n must be positive integer in init_source.c at line 90
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
(GSLL::SIGNAL-GSL-ERROR
4
"vector length n must be positive integer"
"init_source.c"
90)
0] 0
* (defparameter *data* (gsll:make-marray 'double-float :dimensions '(2 2) :initial-contents '((1 2) (3 4))))
*DATA*
* (grid:column *data* 0)
#<GSLL:VECTOR-DOUBLE-FLOAT #(1.0d0 3.0d0)>
* (grid:column *data* 1)
#<GSLL:VECTOR-DOUBLE-FLOAT #(2.0d0 4.0d0)>
* (grid:row *data* 0)
debugger invoked on a GSLL:INVALID-ARGUMENT in thread #<THREAD
"initial thread" RUNNING
{1002ACB011}>:
Invalid argument; vector length n must be positive integer in init_source.c at line 90
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
(GSLL::SIGNAL-GSL-ERROR
4
"vector length n must be positive integer"
"init_source.c"
90)
0] 0
*
----END----
On Tue, May 04, 2010 at 12:04:00PM +0200, Sumant Oemrawsingh wrote:
> Lately, I've been playing around a bit with GSL and slicing etc using GSD. I
> found that grid:row and grid:column don't work as expected:
>
> (defparameter *data*
> (make-marray double-float :inital-contents '((1 2) (3 4)))
>
> ; vector (1,3), works fine
> (grid:column *data* 0)
>
> ; vector (2,4), works fine
> (grid:column *data* 1)
>
> ; Errors
> (grid:row *data* 0)
> ; Invalid argument; vector length n must be positive integer in init_source.c at line 90
>
> ; Same error
> (grid:row *data* 1)
> ; Invalid argument; vector length n must be positive integer in init_source.c at line 90
>
> Now, if I rerun the defparameter, and run the grid:row functions first, they
> succeed, but the grid:column functions afterwards fail. I don't quite
> understand, because *data* is not modified by these functions.
>
> At the moment, I'm too lazy^H^H^H^Hbusy to look into the source code and
> discover the source of the problem on my own. Maybe I'm just doing it wrong,
> though. Any help is appreciated.
--
Sumant Oemrawsingh
More information about the gsll-devel
mailing list