├── .codecov ├── test ├── REQUIRE └── runtests.jl ├── docs ├── .gitignore ├── src │ └── index.md └── make.jl ├── .gitignore ├── REQUIRE ├── .travis.yml ├── README.md ├── appveyor.yml ├── src └── IntervalEigenvalues.jl └── LICENSE.md /.codecov: -------------------------------------------------------------------------------- 1 | comment: false -------------------------------------------------------------------------------- /test/REQUIRE: -------------------------------------------------------------------------------- 1 | Documenter -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | site/ 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.jl.cov 2 | *.jl.*.cov 3 | *.jl.mem 4 | -------------------------------------------------------------------------------- /REQUIRE: -------------------------------------------------------------------------------- 1 | julia 1.0 2 | 3 | IntervalArithmetic 0.15 4 | IntervalRootFinding 5 | Polynomials 6 | IntervalOptimisation 7 | -------------------------------------------------------------------------------- /docs/src/index.md: -------------------------------------------------------------------------------- 1 | # IntervalEigenvalues.jl 2 | 3 | ```@index 4 | ``` 5 | 6 | ```@autodocs 7 | Modules = [IntervalEigenvalues] 8 | ``` 9 | -------------------------------------------------------------------------------- /docs/make.jl: -------------------------------------------------------------------------------- 1 | import Documenter 2 | 3 | Documenter.deploydocs( 4 | repo = "github.com/dpsanders/IntervalEigenvalues.jl.git", 5 | target = "build", 6 | deps = nothing, 7 | make = nothing 8 | ) 9 | -------------------------------------------------------------------------------- /test/runtests.jl: -------------------------------------------------------------------------------- 1 | using IntervalEigenvalues 2 | 3 | import Documenter 4 | Documenter.makedocs( 5 | modules = [IntervalEigenvalues], 6 | format = :html, 7 | sitename = "IntervalEigenvalues.jl", 8 | root = joinpath(dirname(dirname(@__FILE__)), "docs"), 9 | pages = Any["Home" => "index.md"], 10 | strict = true, 11 | linkcheck = true, 12 | checkdocs = :exports, 13 | authors = "David Sanders" 14 | ) 15 | 16 | using Base.Test 17 | 18 | # write your own tests here 19 | @test 1 == 2 20 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Documentation: http://docs.travis-ci.com/user/languages/julia/ 2 | language: julia 3 | os: 4 | - linux 5 | - osx 6 | julia: 7 | - 0.6 8 | - nightly 9 | notifications: 10 | email: false 11 | after_success: 12 | # build documentation 13 | - julia -e 'cd(Pkg.dir("IntervalEigenvalues")); Pkg.add("Documenter"); include(joinpath("docs", "make.jl"))' 14 | # push coverage results to Codecov 15 | - julia -e 'cd(Pkg.dir("IntervalEigenvalues")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())' 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IntervalEigenvalues 2 | 3 | [![travis badge][travis_badge]][travis_url] 4 | [![appveyor badge][appveyor_badge]][appveyor_url] 5 | [![codecov badge][codecov_badge]][codecov_url] 6 | 7 | ## Documentation [here][documenter_latest] 8 | 9 | Change documentation link to `documenter_stable` once published! 10 | 11 | [travis_badge]: https://travis-ci.org/dpsanders/IntervalEigenvalues.jl.svg?branch=master 12 | [travis_url]: https://travis-ci.org/dpsanders/IntervalEigenvalues.jl 13 | 14 | [appveyor_badge]: https://ci.appveyor.com/api/projects/status/github/dpsanders/IntervalEigenvalues.jl?svg=true&branch=master 15 | [appveyor_url]: https://ci.appveyor.com/project/dpsanders/intervaleigenvalues-jl 16 | 17 | [codecov_badge]: http://codecov.io/github/dpsanders/IntervalEigenvalues.jl/coverage.svg?branch=master 18 | [codecov_url]: http://codecov.io/github/dpsanders/IntervalEigenvalues.jl?branch=master 19 | 20 | [documenter_stable]: https://dpsanders.github.io/IntervalEigenvalues.jl/stable 21 | [documenter_latest]: https://dpsanders.github.io/IntervalEigenvalues.jl/latest 22 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | matrix: 3 | - JULIAVERSION: "julialang/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe" 4 | - JULIAVERSION: "julialang/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe" 5 | - JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe" 6 | - JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe" 7 | branches: 8 | only: 9 | - master 10 | - /release-.*/ 11 | notifications: 12 | - provider: Email 13 | on_build_success: false 14 | on_build_failure: false 15 | on_build_status_changed: false 16 | install: 17 | - ps: (new-object net.webclient).DownloadFile( 18 | $("http://s3.amazonaws.com/"+$env:JULIAVERSION), 19 | "C:\projects\julia-binary.exe") 20 | - C:\projects\julia-binary.exe /S /D=C:\projects\julia 21 | build_script: 22 | - IF EXIST .git\shallow (git fetch --unshallow) 23 | - C:\projects\julia\bin\julia -e "versioninfo(); 24 | Pkg.clone(pwd(), \"IntervalEigenvalues\"); Pkg.build(\"IntervalEigenvalues\")" 25 | test_script: 26 | - C:\projects\julia\bin\julia -e "Pkg.test(\"IntervalEigenvalues\")" 27 | -------------------------------------------------------------------------------- /src/IntervalEigenvalues.jl: -------------------------------------------------------------------------------- 1 | module IntervalEigenvalues 2 | 3 | using IntervalArithmetic, IntervalRootFinding, Polynomials 4 | using IntervalOptimisation 5 | using LinearAlgebra 6 | 7 | 8 | export characteristic_polynomial, eigenvalue_bounds 9 | 10 | 11 | function characteristic_polynomial(A::AbstractMatrix{T}) where {T} 12 | 13 | n = size(A, 1) 14 | c = zeros(T, n+1) 15 | 16 | M_old = zeros(T, n, n) 17 | 18 | II = Matrix{T}(I, n, n) 19 | 20 | c[end] = 1 21 | 22 | for k = 1:n 23 | 24 | M_new = A * M_old + c[n+1-k+1] * II 25 | 26 | c[n+1-k] = -tr(A * M_new) / k # `trace(A*M) / k` doesn't work for some reason 27 | 28 | M_old = M_new 29 | 30 | # should store product A*M for next step 31 | end 32 | 33 | return c 34 | end 35 | 36 | 37 | function eigenvalue_bounds(A::AbstractMatrix) 38 | AI = interval.(A) 39 | 40 | p = characteristic_polynomial(AI) 41 | P = Poly(p) 42 | 43 | @show P 44 | 45 | X = Complex(-10..10, -10..10) 46 | eigvals = IntervalRootFinding.roots(z->P(z), X) 47 | root_intervals = [root.interval for root in eigvals] 48 | 49 | rts = [ IntervalBox(reim(λ)) for λ in root_intervals ] 50 | rts = unify(rts) 51 | 52 | complex_roots = [Complex(root...) for root in rts] 53 | return complex_roots 54 | 55 | end 56 | 57 | 58 | end 59 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The IntervalEigenvalues.jl package is licensed under the MIT "Expat" License: 2 | 3 | 4 | > Copyright (c) 2017: David Sanders. 5 | > 6 | > 7 | > Permission is hereby granted, free of charge, to any person obtaining a copy 8 | > 9 | > of this software and associated documentation files (the "Software"), to deal 10 | > 11 | > in the Software without restriction, including without limitation the rights 12 | > 13 | > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | > 15 | > copies of the Software, and to permit persons to whom the Software is 16 | > 17 | > furnished to do so, subject to the following conditions: 18 | > 19 | > 20 | > 21 | > The above copyright notice and this permission notice shall be included in all 22 | > 23 | > copies or substantial portions of the Software. 24 | > 25 | > 26 | > 27 | > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 28 | > 29 | > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | > 31 | > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | > 33 | > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 34 | > 35 | > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | > 37 | > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | > 39 | > SOFTWARE. 40 | > 41 | > 42 | --------------------------------------------------------------------------------