Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building of documentation #190

Merged
merged 2 commits into from
Oct 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/clean-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Doc Preview Cleanup

on:
pull_request:
types: [closed]

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
ref: gh-pages

- name: Delete preview and history
run: |
git config user.name "Documenter.jl"
git config user.email "[email protected]"
git rm -rf "previews/PR$PRNUM"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
env:
PRNUM: ${{ github.event.number }}

- name: Push changes
run: |
git push --force origin gh-pages-new:gh-pages
24 changes: 24 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Documentation

on:
push:
branches:
- master
tags: '*'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: '1.6'
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
run: julia --project=docs/ docs/make.jl
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ makedocs(
"Library" => Any[
"Types" => "lib/types.md",
"Methods" => "lib/methods.md"],
"About" => "about.md"
"About" => "about.md",
"References" => "references.md"
],
strict = true
)
Expand Down
14 changes: 7 additions & 7 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ julia> (-1.0..1.0) * A

Or compute the square of $A$,
```jldoctest quickstart
julia> A*A
julia> square(A)
Copy link
Member

@mforets mforets Oct 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the intent of this paragraph was to show operations that "just work" with interval matrices, hence the A * A, and to introduce specialized methods in the next paragraph. i can send a small change in a new PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it because A*A now gives much wider intervals.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok i think that's ok for motivation of this package, but we have to add the result using square.

we can also show the result upon changing the multiplication mode.

2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[2, 7] [-8, 0]
[-12, -1] [6, 22]
[2, 7] [-8, -1]
[-12, -2] [6, 22]
```
In these cases, the rules of interval arithmetic are used; see the wikipedia page
In these cases, the rules of interval arithmetic are used; see the Wikipedia page
on [interval arithmetic](https://en.wikipedia.org/wiki/Interval_arithmetic) for the
relevant definitions and algebraic rules that apply.

Expand All @@ -107,14 +107,14 @@ $e^{At} - I$. Then, at $t = 1.0$,
```jldoctest quickstart
julia> A + 1/2 * A^2
2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[1, 4.5] [-3, 2]
[-4, 2.5] [-1, 9]
[0.5, 4.5] [-3.25, 2.5]
[-4.25, 3] [-2.25, 9]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this change due to the new multiplication settings default?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess so.

```
However, that result is not tight. The computation can be performed exactly via
single-use expressions implemented in this library:

```jldoctest quickstart
julia> quadratic_expansion(A, 1.0)
julia> quadratic_expansion(A, 1.0, 0.5)
2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[1, 4.5] [-2, 1]
[-3, 1.5] [1, 7]
Expand Down
16 changes: 13 additions & 3 deletions docs/src/lib/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,25 @@ inf
sup
mid
diam
radius
midpoint_radius
rand
sample
split
±
hull
```

## Arithmetic

```@docs
square
scale
scale!
set_multiplication_mode
```

## Matrix power
Expand Down
53 changes: 53 additions & 0 deletions docs/src/references.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# References

#### [RUM10]

```@raw html
<ul><li>
```
S.M. Rump, [*Verification methods: Rigorous results using floating-point arithmetic*](https://www.tuhh.de/ti3/paper/rump/Ru10.pdf), Acta Numerica, 19:287–449, 2010
```@raw html
<li style="list-style: none"><details>
<summary>bibtex</summary>
```
```
@article{rump2010verification,
title={Verification methods: Rigorous results using floating-point arithmetic},
author={Rump, Siegfried M},
journal={Acta Numerica},
volume={19},
pages={287--449},
year={2010},
publisher={Cambridge University Press}
}
```
```@raw html
</details></li></ul>
```
---

#### [RUM99]

```@raw html
<ul><li>
```
Rump, Siegfried M. [*Fast and parallel interval arithmetic*](https://www.tuhh.de/ti3/paper/rump/Ru99b.pdf), BIT Numerical Mathematics 39.3, 534-554, 1999
```@raw html
<li style="list-style: none"><details>
<summary>bibtex</summary>
```
```
@article{rump1999fast,
title={Fast and parallel interval arithmetic},
author={Rump, Siegfried M},
journal={BIT Numerical Mathematics},
volume={39},
number={3},
pages={534--554},
year={1999},
publisher={Springer}
}
```
```@raw html
</details></li></ul>
```
6 changes: 3 additions & 3 deletions src/matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ i.e. `B[i, j] ≥ A[i, j]` for each `i` and `j`.
```jldoctest
julia> IntervalMatrix([1 2; 3 4], [1 2; 4 5])
2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[1, 1] [2, 2]
[1, 1] [2, 2]
[3, 4] [4, 5]
```
"""
Expand All @@ -144,7 +144,7 @@ function IntervalMatrix(A::MT, B::MT) where {T, MT<:AbstractMatrix{T}}
"matrices should match, but they are $(size(A)) " *
"and $(size(B)) respectively"))

return map((x, y) -> Interval(x, y), A, B)
return IntervalMatrix(map((x, y) -> Interval(x, y), A, B))
end

"""
Expand Down Expand Up @@ -182,5 +182,5 @@ function ±(C::MT, S::MT) where {T, MT<:AbstractMatrix{T}}
"radii matrix should match, but they are $(size(C)) " *
"and $(size(S)) respectively"))

return map((x, y) -> x ± y, C, S)
return IntervalMatrix(map((x, y) -> x ± y, C, S))
end
4 changes: 2 additions & 2 deletions src/operations/power.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ julia> increment!(pow)

julia> increment(pow)
2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
[8, 8] [-1, 21]
[0, 0] [-1, 1]
[8, 8] [-1, 21]
[-0, 0] [-1, 1]

julia> get(pow)
2×2 IntervalMatrix{Float64, Interval{Float64}, Matrix{Interval{Float64}}}:
Expand Down