crystal-data / num.cr

Scientific computing in pure Crystal
MIT License
151 stars 12 forks source link

CBlas import error #75

Closed RainbowZephyr closed 2 years ago

RainbowZephyr commented 2 years ago

Hello, It seems there is a simple error when executing the following code:

# Your code here
require "num"
require "complex"

a1 = Complex.new(9,0)
a2 = Complex.new(6,0)
a3 = Complex.new(12,0)
a4 = Complex.new(8,0)

y =  [[a1,a2], [a3,a4]]
x = y.to_tensor.as_type(Complex)
puts x

begin
    puts x.inv
rescue ex
  puts ex.message
end

puts "continued"

Problem description

I get the following error:

In lib/num/src/linalg/work.cr:22:30

 22 | def get_cmplx(n) : Slice(LibCBLAS::ComplexDouble)
                               ^----------------------
Error: undefined constant LibCBLAS::ComplexDouble

Did you mean 'LibCblas'?

When I change the import to LibCblas instead of LibCBLAS it works as normal.

Thanks in advance

christopherzimmerman commented 2 years ago

Thanks for the issue, should be fixed in master