Skip to content

Commit 264dafe

Browse files
Merge pull request #46 from SciML/docs
add docs
2 parents 0de12b2 + 74ad214 commit 264dafe

File tree

18 files changed

+490
-34
lines changed

18 files changed

+490
-34
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- 'release-'
8+
tags: '*'
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: julia-actions/setup-julia@latest
17+
with:
18+
version: '1'
19+
- name: Install dependencies
20+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
21+
- name: Build and deploy
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
24+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
25+
run: julia --project=docs/ docs/make.jl

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name = "LinearSolve"
22
uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
3-
authors = ["Jonathan <edelman.jonathan.s@gmail.com> and contributors"]
3+
authors = ["SciML"]
44
version = "0.1.6"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
8+
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
89
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
910
KLU = "ef3ab10e-7fda-4108-b977-705223b18434"
1011
Krylov = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7"

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,70 @@
44
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://EdelmanJonathan.github.io/LinearSolvers.jl/dev)
55
[![Build Status](https://github.com/EdelmanJonathan/LinearSolvers.jl/workflows/CI/badge.svg)](https://github.com/EdelmanJonathan/LinearSolvers.jl/actions)
66
[![Coverage](https://codecov.io/gh/EdelmanJonathan/LinearSolvers.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/EdelmanJonathan/LinearSolvers.jl)
7+
8+
Fast implementations of linear solving algorithms in Julia that satisfy the SciML
9+
common interface. LinearSolve.jl makes it easy to define high level algorithms
10+
which allow for swapping out the linear solver that is used while maintaining
11+
maximum efficiency.
12+
13+
For information on using the package,
14+
[see the stable documentation](https://nonlinearsolve.sciml.ai/stable/). Use the
15+
[in-development documentation](https://nonlinearsolve.sciml.ai/dev/) for the version of
16+
the documentation which contains the unreleased features.
17+
18+
## High Level Examples
19+
20+
```julia
21+
n = 4
22+
A = rand(n,n)
23+
b1 = rand(n); b2 = rand(n)
24+
prob = LinearProblem(A, b1)
25+
26+
linsolve = init(prob)
27+
sol1 = solve(linsolve)
28+
29+
sol1.u
30+
#=
31+
4-element Vector{Float64}:
32+
-0.9247817429364165
33+
-0.0972021708185121
34+
0.6839050402960025
35+
1.8385599677530706
36+
=#
37+
38+
linsolve = LinearSolve.set_b(linsolve,b2)
39+
sol2 = solve(linsolve)
40+
41+
sol2.u
42+
#=
43+
4-element Vector{Float64}:
44+
1.0321556637762768
45+
0.49724400693338083
46+
-1.1696540870182406
47+
-0.4998342686003478
48+
=#
49+
50+
linsolve = LinearSolve.set_b(linsolve,b2)
51+
sol2 = solve(linsolve,IterativeSolversJL_GMRES()) # Switch to GMRES
52+
sol2.u
53+
#=
54+
4-element Vector{Float64}:
55+
1.0321556637762768
56+
0.49724400693338083
57+
-1.1696540870182406
58+
-0.4998342686003478
59+
=#
60+
61+
A2 = rand(n,n)
62+
linsolve = LinearSolve.set_A(linsolve,A2)
63+
sol3 = solve(linsolve)
64+
65+
sol3.u
66+
#=
67+
4-element Vector{Float64}:
68+
-6.793605395935224
69+
2.8673042300837466
70+
1.1665136934977371
71+
-0.4097250749016653
72+
=#
73+
```

docs/make.jl

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,29 @@ using Documenter
33

44
DocMeta.setdocmeta!(LinearSolve, :DocTestSetup, :(using LinearSolve); recursive=true)
55

6-
makedocs(;
6+
makedocs(
7+
sitename="LinearSolve.jl",
8+
authors="Chris Rackauckas",
79
modules=[LinearSolve],
8-
authors="Jonathan <edelman.jonathan.s@gmail.com> and contributors",
9-
repo="https://github.com/SciML/LinearSolve.jl/blob/{commit}{path}#{line}",
10-
sitename="LinearSolvers.jl",
11-
format=Documenter.HTML(;
12-
prettyurls=get(ENV, "CI", "false") == "true",
13-
canonical="https://linearsolve.sciml.ai/",
14-
assets=String[],
15-
),
10+
clean=true,doctest=false,
11+
format = Documenter.HTML(#analytics = "UA-90474609-3",
12+
assets = ["assets/favicon.ico"],
13+
canonical="https://linearsolve.sciml.ai/stable/"),
1614
pages=[
1715
"Home" => "index.md",
18-
],
16+
"Tutorials" => Any[
17+
"tutorials/linear.md"
18+
"tutorials/caching_interface.md"
19+
],
20+
"Basics" => Any[
21+
"basics/LinearProblem.md",
22+
"basics/CachingAPI.md",
23+
"basics/FAQ.md"
24+
],
25+
"Solvers" => Any[
26+
"solvers/solvers.md"
27+
]
28+
]
1929
)
2030

2131
deploydocs(;

docs/src/assets/favicon.ico

1.36 KB
Binary file not shown.

docs/src/assets/logo.png

26 KB
Loading

docs/src/basics/CachingAPI.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Caching Interface API Functions
2+
3+
```@docs
4+
set_A
5+
set_b
6+
set_u
7+
set_p
8+
set_prec
9+
```

docs/src/basics/FAQ.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Frequently Asked Questions
2+
3+
Ask more questions.

docs/src/basics/LinearProblem.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Nonlinear Problems
2+
3+
## Mathematical Specification of a Nonlinear Problem
4+
5+
To define a Nonlinear Problem, you simply need to give the function ``f``
6+
which defines the nonlinear system:
7+
8+
```math
9+
f(u,p) = 0
10+
```
11+
12+
and an initial guess ``u₀`` of where `f(u,p)=0`. `f` should be specified as `f(u,p)`
13+
(or in-place as `f(du,u,p)`), and `u₀` should be an AbstractArray (or number)
14+
whose geometry matches the desired geometry of `u`. Note that we are not limited
15+
to numbers or vectors for `u₀`; one is allowed to provide `u₀` as arbitrary
16+
matrices / higher-dimension tensors as well.
17+
18+
## Problem Type
19+
20+
### Constructors
21+
22+
```julia
23+
NonlinearProblem(f::NonlinearFunction,u0,p=NullParameters();kwargs...)
24+
NonlinearProblem{isinplace}(f,u0,p=NullParameters();kwargs...)
25+
```
26+
27+
`isinplace` optionally sets whether the function is in-place or not. This is
28+
determined automatically, but not inferred.
29+
30+
Parameters are optional, and if not given, then a `NullParameters()` singleton
31+
will be used, which will throw nice errors if you try to index non-existent
32+
parameters. Any extra keyword arguments are passed on to the solvers. For example,
33+
if you set a `callback` in the problem, then that `callback` will be added in
34+
every solve call.
35+
36+
For specifying Jacobians and mass matrices, see the [NonlinearFunctions](@ref nonlinearfunctions)
37+
page.
38+
39+
### Fields
40+
41+
* `f`: The function in the ODE.
42+
* `u0`: The initial guess for the steady state.
43+
* `p`: The parameters for the problem. Defaults to `NullParameters`.
44+
* `kwargs`: The keyword arguments passed on to the solvers.

docs/src/index.md

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,39 @@
1-
```@meta
2-
CurrentModule = LinearSolve
3-
```
1+
# LinearSolve.jl: High-Performance Unified Nonlinear Solvers
42

5-
# LinearSolve
3+
LinearSolve.jl is a unified interface for the linear solving packages of
4+
Julia. It interfaces with other packages of the Julia ecosystem
5+
to make it easy to test alternative solver packages and pass small types to
6+
control algorithm swapping. It also interfaces with the
7+
[ModelingToolkit.jl](https://mtk.sciml.ai/dev/) world of symbolic modeling to
8+
allow for automatically generating high-performance code.
69

7-
Documentation for [LinearSolve](https://github.com/SciML/LinearSolve.jl).
10+
Performance is key: the current methods are made to be highly performant on
11+
scalar and statically sized small problems, with options for large-scale systems.
12+
If you run into any performance issues, please file an issue.
813

9-
```@index
10-
```
14+
## Installation
1115

12-
```@autodocs
13-
Modules = [LinearSolve]
16+
To install LinearSolve.jl, use the Julia package manager:
17+
18+
```julia
19+
using Pkg
20+
Pkg.add("LinearSolve")
1421
```
22+
23+
## Contributing
24+
25+
- Please refer to the
26+
[SciML ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://github.com/SciML/ColPrac/blob/master/README.md)
27+
for guidance on PRs, issues, and other matters relating to contributing to ModelingToolkit.
28+
- There are a few community forums:
29+
- the #diffeq-bridged channel in the [Julia Slack](https://julialang.org/slack/)
30+
- [JuliaDiffEq](https://gitter.im/JuliaDiffEq/Lobby) on Gitter
31+
- on the Julia Discourse forums (look for the [modelingtoolkit tag](https://discourse.julialang.org/tag/modelingtoolkit)
32+
- see also [SciML Community page](https://sciml.ai/community/)
33+
34+
## Roadmap
35+
36+
Wrappers for every linear solver in the Julia language is on the roadmap. If
37+
there are any important ones that are missing that you would like to see added,
38+
please open an issue. The current algorithms should support automatic differentiation.
39+
Pre-defined preconditioners would be a welcome addition.

0 commit comments

Comments
 (0)