From 333df926ce4ad646b6cc6ba6b6bbf2ea0e3b6ec1 Mon Sep 17 00:00:00 2001 From: Patrick O'Leary Date: Sat, 3 Mar 2012 18:12:13 -0600 Subject: [PATCH] Added support for mixing integers and floats in matrix division. --- j/linalg_lapack.j | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/j/linalg_lapack.j b/j/linalg_lapack.j index e52d4f150892d..d3ef44665f5a5 100644 --- a/j/linalg_lapack.j +++ b/j/linalg_lapack.j @@ -620,8 +620,6 @@ end @_jl_lapack_backslash_macro :zgesv_ :zposv_ :zgels_ :ztrtrs_ Complex128 @_jl_lapack_backslash_macro :cgesv_ :cposv_ :cgels_ :ctrtrs_ Complex64 -(\){T1<:Integer, T2<:Integer}(A::StridedMatrix{T1}, B::StridedVecOrMat{T2}) = (\)(float64(A), float64(B)) - function (\){T<:Union(Float64,Float32,Complex128,Complex64)}(A::StridedMatrix{T}, B::VecOrMat{T}) m, n = size(A) mrhs = size(B, 1) @@ -694,3 +692,7 @@ function (\){T<:Union(Float64,Float32,Complex128,Complex64)}(A::StridedMatrix{T} error("error in LAPACK solving A*X = B") end + +(\){T1<:Integer, T2<:Integer}(A::StridedMatrix{T1}, B::StridedVecOrMat{T2}) = (\)(float64(A), float64(B)) +(\){T1<:Float, T2<:Integer}(A::StridedMatrix{T1}, B::StridedVecOrMat{T2}) = (\)(A, float64(B)) +(\){T1<:Integer, T2<:Float}(A::StridedMatrix{T1}, B::StridedVecOrMat{T2}) = (\)(float64(A), B)