Skip to content

Commit

Permalink
add constructor of matrix power given a target index
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Feb 11, 2020
1 parent 16edd54 commit d67d1c0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/power.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ mutable struct IntervalMatrixPower{T}
@assert k >= 1 "matrix powers must be positive"
return new{T}(M, Mᵏ, k)
end

function IntervalMatrixPower(M::IntervalMatrix{T}, k::Int) where {T}
@assert k >= 1 "matrix powers must be positive"
pow = IntervalMatrixPower(M, M, 1)
@inbounds for i in 1:k
increment!(pow)
end
return pow
end
end

function copy(pow::IntervalMatrixPower)
Expand Down

0 comments on commit d67d1c0

Please sign in to comment.