Skip to content

Commit

Permalink
Merge pull request #247 from JuliaReach/schillic/get
Browse files Browse the repository at this point in the history
Rename `get` -> `matrix`
  • Loading branch information
schillic authored Sep 9, 2024
2 parents b915821 + 1323907 commit 579135f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/src/lib/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ set_multiplication_mode
```@docs
increment!
increment
get
matrix
base
index
```
Expand Down
3 changes: 2 additions & 1 deletion src/IntervalMatrices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using LinearAlgebra: checksquare
using Random: AbstractRNG, GLOBAL_RNG, seed!
import Random: rand

import Base: copy, get,
import Base: copy,
+, -, *, /, \,
size, IndexStyle, getindex, setindex!,
similar, , , , , real, imag
Expand Down Expand Up @@ -68,6 +68,7 @@ export inf, sup,

export IntervalMatrixPower,
increment!, increment,
matrix,
base,
index

Expand Down
6 changes: 3 additions & 3 deletions src/operations/power.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ julia> increment(pow)
[8.0, 8.0] [-1.0, 21.0]
[0.0, 0.0] [-1.0, 1.0]
julia> get(pow)
julia> matrix(pow)
2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[4.0, 4.0] [2.0, 9.0]
[0.0, 0.0] [0.0, 1.0]
Expand Down Expand Up @@ -210,7 +210,7 @@ function base(pow::IntervalMatrixPower)
end

"""
get(pow::IntervalMatrixPower)
matrix(pow::IntervalMatrixPower)
Return the matrix represented by a wrapper of a matrix power.
Expand All @@ -222,7 +222,7 @@ Return the matrix represented by a wrapper of a matrix power.
The matrix power represented by the wrapper.
"""
function get(pow::IntervalMatrixPower)
function matrix(pow::IntervalMatrixPower)
return pow.Mᵏ
end

Expand Down
6 changes: 3 additions & 3 deletions test/exponential.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ end
pow = IntervalMatrixPower(m)

@test base(pow) === m
@test get(pow) === pow.Mᵏ
@test matrix(pow) === pow.Mᵏ
@test index(pow) == 1

pow2 = copy(pow)
@test pow2 isa IntervalMatrixPower && get(pow) == get(pow2)
@test pow2 isa IntervalMatrixPower && matrix(pow) == matrix(pow2)

pow2 = IntervalMatrixPower(m, 2)
pow3 = increment(pow)
@test pow3 isa IntervalMatrix && pow3 == get(pow2)
@test pow3 isa IntervalMatrix && pow3 == matrix(pow2)

increment!(pow) # next step is a power of two
@test index(pow) == 2
Expand Down

0 comments on commit 579135f

Please sign in to comment.