Open v0dro opened 8 years ago
Currently numbers of the Ruby Complex type cannot be assigned to a matrix of type GSL::Matrix::Complex, it must have GSL::Complex types:
Complex
GSL::Matrix::Complex
GSL::Complex
q = GSL::Matrix::Complex.alloc(2,2) # => #<GSL::Matrix::Complex[2,2]:0x7da6cc0> # [ [ 0.000e+00 0.000e+00 ] [ 0.000e+00 0.000e+00 ] # [ 0.000e+00 0.000e+00 ] [ 0.000e+00 0.000e+00 ] ] q[0,0] = Complex(2,3) # TypeError: wrong type Complex, (nil, Array, Float, Integer, or GSL::Complex expected) q[0,0] = GSL::Complex.alloc(2,3) #=> #<GSL::Matrix::Complex[2,2]:0x7d9b488> #[ [ 2.000e+00 3.000e+00 ] [ 0.000e+00 0.000e+00 ] # [ 0.000e+00 0.000e+00 ] [ 0.000e+00 0.000e+00 ] ]
Making this work with Ruby Complex types would be great.
I've added PR #38 for this, @v0dro can you please review?
Currently numbers of the Ruby
Complex
type cannot be assigned to a matrix of typeGSL::Matrix::Complex
, it must haveGSL::Complex
types:Making this work with Ruby Complex types would be great.