Skip to content

Commit 7cda13f

Browse files
committed
Revert "fix range bugs for matrix multiply/solve, with AbstractMatrix"
This reverts commit 392b1a3.
1 parent f045831 commit 7cda13f

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

base/linalg/bidiag.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ function naivesub!{T}(A::Bidiagonal{T}, b::AbstractVector, x::AbstractVector = b
262262
x
263263
end
264264

265-
function \{T,S}(A::Bidiagonal{T}, B::StridedVecOrMat{S})
265+
function \{T,S}(A::Bidiagonal{T}, B::AbstractVecOrMat{S})
266266
TS = typeof(zero(T)*zero(S) + zero(T)*zero(S))
267267
TS == S ? A_ldiv_B!(A, copy(B)) : A_ldiv_B!(A, convert(AbstractArray{TS}, B))
268268
end

base/range.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -647,10 +647,6 @@ end
647647
./(r::FloatRange, x::Real) = FloatRange(r.start/x, r.step/x, r.len, r.divisor)
648648
./(r::LinSpace, x::Real) = LinSpace(r.start / x, r.stop / x, r.len, r.divisor)
649649

650-
# Matrix multiplication/solve on ranges, A*r should treat r as collected vector
651-
*{T}(A::AbstractArray{T, 2}, r::Range) = A*collect(r)
652-
\{T}(A::AbstractArray{T, 2}, r::Range) = A\collect(r)
653-
654650
promote_rule{T1,T2}(::Type{UnitRange{T1}},::Type{UnitRange{T2}}) =
655651
UnitRange{promote_type(T1,T2)}
656652
convert{T}(::Type{UnitRange{T}}, r::UnitRange{T}) = r

test/ranges.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,6 @@ end
250250
@test all(([1:5;] - (1:5)) .== 0)
251251
@test all(((1:5) - [1:5;]) .== 0)
252252

253-
# matrix multiplication between matrix and range, e.g. A*r
254-
@test [1 2 3;]*(1:3) == [14]
255-
# and a matrix solve A\r
256-
@test [1 0; 0 1]\linspace(1,2,2) [1., 2.]
257-
258253
# tricky floating-point ranges
259254

260255
@test [0.1:0.1:0.3;] == [linspace(0.1,0.3,3);] == [1:3;]./10

0 commit comments

Comments
 (0)