Skip to content

Incompatibilities involving matrix mulm and eye functions #63

@mars0i

Description

@mars0i
(def m (fm/seq->double-double-array [[1 2 3][4 5 6][7 8 9]]))

(def I (fmat/eye 3))
(fmat/mulm I m)
; eval (effective-root-form): (fmat/mulm I m)
; (err) Execution error (ClassCastException) at fastmath.matrix.Mat3x3/mulm (matrix.clj:313).
; (err) class [[D cannot be cast to class fastmath.matrix.Mat3x3 ([[D is in module java.base of loader 'bootstrap'; fastmath.matrix.Mat3x3 is in unnamed module of loader clojure.lang.DynamicClassLoader @c1e1f4c)

(def Ireal (fmat/eye 3 true))
(fmat/mulm Ireal m)
; eval (effective-root-form): (fmat/mulm Ireal m)
; (err) Execution error (ClassCastException) at fastmath.matrix/eval41805$fn (matrix.clj:686).
; (err) class [[D cannot be cast to class org.apache.commons.math3.linear.RealMatrix ([[D is in module java.base of loader 'bootstrap'; org.apache.commons.math3.linear.RealMatrix is in unnamed module of loader 'app')

;; this works:
(def Idouble (fm/seq->double-double-array [[1 0 0][0 1 0][0 0 1]]))
(fmat/mulm Idouble m)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions