lib/nmatrix/blas.rb in nmatrix-0.0.2 vs lib/nmatrix/blas.rb in nmatrix-0.0.3
- old
+ new
@@ -35,12 +35,12 @@
ldb ||= b.shape[1]
ldc ||= c.shape[1]
# NM_COMPLEX64 and NM_COMPLEX128 both require complex alpha and beta.
if a.dtype == :complex64 or a.dtype == :complex128
- alpha = Complex.new(1.0, 0.0) if alpha == 1.0
- beta = Complex.new(0.0, 0.0) if beta == 0.0
+ alpha = Complex(1.0, 0.0) if alpha == 1.0
+ beta = Complex(0.0, 0.0) if beta == 0.0
end
# For argument descriptions, see: http://www.netlib.org/blas/dgemm.f
::NMatrix::BLAS.cblas_gemm(:row, transpose_a, transpose_b, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
@@ -55,11 +55,11 @@
incx ||= 1
incy ||= 1
# NM_COMPLEX64 and NM_COMPLEX128 both require complex alpha and beta.
if a.dtype == :complex64 or a.dtype == :complex128
- alpha = Complex.new(1.0, 0.0) if alpha == 1.0
- beta = Complex.new(0.0, 0.0) if beta == 0.0
+ alpha = Complex(1.0, 0.0) if alpha == 1.0
+ beta = Complex(0.0, 0.0) if beta == 0.0
end
::NMatrix::BLAS.cblas_gemv(transpose_a, m, n, alpha, a, lda, x, incx, beta, y, incy)
return y