quil-lang/magicl

EYE constructor ignores :TYPE when :VALUE is specified

colescott opened this issue · 0 comments

When constructing an identity matrix, if :value is specified, :type is ignored.

* (magicl:eye 2 :value 2 :type '(complex double-float))

#<MAGICL::MATRIX/INT32 (2x2):
    2      0
    0      2>

This is counter to what the docstring seems to imply:
If TYPE is not specified then it is inferred from the type of VALUE, defaulting to *DEFAULT-TENSOR-TYPE*.

eye should prefer :type when both are specified.