Skip to content

Commit 9a04691

Browse files
committed
add LinRange
1 parent fd264b6 commit 9a04691

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/constructors.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@ function (::TridiagonalConstructor)(dl::V, d::V, du::V, maybe_du2::V...) where {
3434
end
3535

3636
constructorof(::Type{<:LinearAlgebra.Tridiagonal}) = TridiagonalConstructor()
37+
38+
39+
_linrange(start, stop, len, lendiv) = LinRange(start, stop, len)
40+
41+
constructorof(::Type{<:LinRange}) = _linrange

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ end
101101
# tda = Tridiagonal(dl, d, du)
102102
# @test constructorof(typeof(tda))(dl, d, du) === tda
103103
# end
104+
@testset "LinRange" begin
105+
lr1 = LinRange(1, 7, 10)
106+
@test constructorof(typeof(lr1))(1, 7, 10, nothing) === lr1
107+
end
104108

105109
end
106110

0 commit comments

Comments
 (0)