-
Notifications
You must be signed in to change notification settings - Fork 5
Function lookup has some type error in index array #62
Copy link
Copy link
Closed
Description
First import ArrayFire like this
import ArrayFire as AFThen the following works with the Haskell ArrayFire bindings
m = matrix @Double (5,3) [[1,0,9.8,7.999,65,21],[0.9,6.4,2.2,1.2,2.3],[0,0,8.3,3.2,4.3]]
idx = vector @Double 2 [0,2]
AF.lookup m idx 1Using complex matrices will result in an error:
m = matrix @(Complex Double) (5,3) [[1 :+ 1,0,9.8,7.999,65,21],[0.9,6.4,2.2,1.2,2.3],[0,0,8.3,3.2,4.3]]
idx = vector @Double 2 [0,2]
AF.lookup m idx 1leads to the error
"... Couldn't match type ‘Double’ with ‘Complex Double’..."
The following
m = matrix @(Complex Double) (5,3) [[1 :+ 1,0,9.8,7.999,65,21],[0.9,6.4,2.2,1.2,2.3],[0,0,8.3,3.2,4.3]]
idz = vector @(Complex Double) 2 [0,2]
AF.lookup m idz 1
leads to
*** Exception: AFException {afExceptionType = ArgError, afExceptionCode = 202, afExceptionMsg = "Invalid input argument"}
In any case, the index array has the wrong type, it should be acceptable only as
array @Int but it isn't.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels