diff --git a/j/sparse.j b/j/sparse.j index 59135e71ea9e9..cc37d26217bf5 100644 --- a/j/sparse.j +++ b/j/sparse.j @@ -224,12 +224,17 @@ macro binary_op_A_sparse_B_sparse_res_sparse(op) end # quote end # macro -(+)(A::SparseMatrixCSC, B::Union(Array,Number)) = (+)(full(A), B) -(+)(A::Union(Array,Number), B::SparseMatrixCSC) = (+)(A, full(B)) +(+)(A::SparseMatrixCSC, B::Number) = (+)(full(A), B) +(+)(A::Number, B::SparseMatrixCSC) = (+)(A, full(B)) +(+)(A::SparseMatrixCSC, B::Array) = (+)(full(A), B) +(+)(A::Array, B::SparseMatrixCSC) = (+)(A, full(B)) +(+)(A::SparseMatrixCSC, B::Array) = (+)(full(A), B) @binary_op_A_sparse_B_sparse_res_sparse (+) -(-)(A::SparseMatrixCSC, B::Union(Array,Number)) = (-)(full(A), B) -(-)(A::Union(Array,Number), B::SparseMatrixCSC) = (-)(A, full(B)) +(-)(A::SparseMatrixCSC, B::Number) = (-)(full(A), B) +(-)(A::Number, B::SparseMatrixCSC) = (-)(A, full(B)) +(-)(A::SparseMatrixCSC, B::Array) = (-)(full(A), B) +(-)(A::Array, B::SparseMatrixCSC) = (-)(A, full(B)) @binary_op_A_sparse_B_sparse_res_sparse (-) (.*)(A::SparseMatrixCSC, B::Number) = SparseMatrixCSC(A.m, A.n, A.colptr, A.rowval, A.nzval .* B)