aboutsummaryrefslogtreecommitdiffstats
path: root/matfile.scm
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:34 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:34 -0800
commit237c6e380aebdcbc70bd1c9ecf7d3f6effca2752 (patch)
tree9832fbdd6fbeedf3fc7f0e7923fe20b7d35b1499 /matfile.scm
parent5145dd3aa0c02c9fc496d1432fc4410674206e1d (diff)
downloadslib-237c6e380aebdcbc70bd1c9ecf7d3f6effca2752.tar.gz
slib-237c6e380aebdcbc70bd1c9ecf7d3f6effca2752.zip
Import Upstream version 3a3upstream/3a3
Diffstat (limited to 'matfile.scm')
-rw-r--r--matfile.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/matfile.scm b/matfile.scm
index a7a96a6..49c603b 100644
--- a/matfile.scm
+++ b/matfile.scm
@@ -122,7 +122,8 @@
(else (slib:error 'p 'type d-prot)))
mrows ncols))
((text) (make-array "." mrows ncols))
- ((sparse) (slib:error 'sparse '?)))))
+ ((sparse) (slib:error 'sparse '?))))
+ (d-endn*leng (* -1 d-endn d-leng)))
(do ((idx 0 (+ 1 idx)))
((>= idx namlen))
(string-set! namstr idx (read-char port)))
@@ -133,7 +134,7 @@
((>= jdx ncols))
(do ((idx 0 (+ 1 idx)))
((>= idx mrows))
- (array-set! mat (d-conv (read-bytes (* d-endn d-leng) port))
+ (array-set! mat (d-conv (read-bytes d-endn*leng port))
idx jdx)))
(if imagf
(do ((jdx 0 (+ 1 jdx)))
@@ -141,7 +142,7 @@
(do ((idx 0 (+ 1 idx)))
((>= idx mrows))
(array-set! mat
- (+ (* (d-conv (read-bytes (* d-endn d-leng) port))
+ (+ (* (d-conv (read-bytes d-endn*leng port))
+i)
(array-ref mat idx jdx))
idx jdx))))