Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixes type checking error in issue #6 #7

Closed
wants to merge 1 commit into from

2 participants

@masonium

Issue 6 was caused because e+ was returning arrays of element type t in the e-operations-test, rather than double-float. In the array-array specialization of e2+, the element type was being set to t rather than the common numeric type, so array= failed because the types didn't match.

I fixed the issue by adding the type specialization in e2+ and e2-.

@tpapp
Owner
@tpapp
Owner

The last update (which I pushed a couple of days ago, along with other things) should fix this issue. However, I am still testing this, so tests & patches are very welcome.

@tpapp tpapp closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 26, 2011
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/elementwise.lisp
View
12 src/elementwise.lisp
@@ -252,7 +252,9 @@ of arguments, no optional, key, rest etc)."
(row-major-aref b index))))
result))
(let* ((dimensions (common-dimensions a b))
- (result (make-array dimensions :element-type t))
+ (result (make-array dimensions
+ :element-type (emap-common-numeric-type
+ (array-element-type a) (array-element-type b))))
(size (array-total-size result)))
(assert dimensions)
(dotimes (index size)
@@ -275,7 +277,9 @@ of arguments, no optional, key, rest etc)."
(row-major-aref b index))))
result))
(let* ((dimensions (common-dimensions a b))
- (result (make-array dimensions :element-type t))
+ (result (make-array dimensions
+ :element-type (emap-common-numeric-type
+ (array-element-type a) (array-element-type b))))
(size (array-total-size result)))
(assert dimensions)
(dotimes (index size)
@@ -296,7 +300,9 @@ of arguments, no optional, key, rest etc)."
(setf (row-major-aref result index)
(- a (row-major-aref b index))))
result))
- (let* ((result (make-array (array-dimensions b) :element-type t))
+ (let* ((result (make-array (array-dimensions b) :element-type
+ (emap-common-numeric-type (type-of a)
+ (array-element-type b))))
(size (array-total-size result)))
(dotimes (index size)
(setf (row-major-aref result index) (- a (row-major-aref b index))))
Something went wrong with that request. Please try again.