Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 5515453

Browse files
Merge pull request #9 from SciML/docstrings
improve docstrings
2 parents a8708d2 + 4469fd9 commit 5515453

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SimpleNonlinearSolve"
22
uuid = "727e6d20-b764-4bd8-a329-72de5adea6c7"
33
authors = ["SciML"]
4-
version = "0.1.2"
4+
version = "0.1.3"
55

66
[deps]
77
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"

src/bisection.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
"""
2+
`Bisection(; exact_left = false, exact_right = false)`
3+
4+
A common bisection method.
5+
6+
### Keyword Arguments
7+
8+
- `exact_left`: whether to enforce whether the left side of the interval must be exactly
9+
zero for the returned result. Defualts to false.
10+
- `exact_right`: whether to enforce whether the right side of the interval must be exactly
11+
zero for the returned result. Defualts to false.
12+
"""
113
struct Bisection <: AbstractBracketingAlgorithm
214
exact_left::Bool
315
exact_right::Bool

src/falsi.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
"""
2+
`Falsi`: A non-allocating regula falsi method
3+
"""
14
struct Falsi <: AbstractBracketingAlgorithm end
25

36
function SciMLBase.solve(prob::IntervalNonlinearProblem, alg::Falsi, args...;

src/raphson.jl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
"""
2+
```julia
3+
SimpleNewtonRaphson(; chunk_size = Val{0}(), autodiff = Val{true}(),
4+
diff_type = Val{:forward})
5+
```
6+
7+
A low-overhead implementation of Newton-Raphson. This method is non-allocating on scalar
8+
and static array problems.
9+
10+
!!! note
11+
12+
As part of the decreased overhead, this method omits some of the higher level error
13+
catching of the other methods. Thus to see better error messages, use one of the other
14+
methods like `NewtonRaphson`
15+
16+
### Keyword Arguments
17+
18+
- `chunk_size`: the chunk size used by the internal ForwardDiff.jl automatic differentiation
19+
system. This allows for multiple derivative columns to be computed simultaniously,
20+
improving performance. Defaults to `0`, which is equivalent to using ForwardDiff.jl's
21+
default chunk size mechanism. For more details, see the documentation for
22+
[ForwardDiff.jl](https://juliadiff.org/ForwardDiff.jl/stable/).
23+
- `autodiff`: whether to use forward-mode automatic differentiation for the Jacobian.
24+
Note that this argument is ignored if an analytical Jacobian is passed as that will be
25+
used instead. Defaults to `Val{true}`, which means ForwardDiff.jl is used by default.
26+
If `Val{false}`, then FiniteDiff.jl is used for finite differencing.
27+
- `diff_type`: the type of finite differencing used if `autodiff = false`. Defaults to
28+
`Val{:forward}` for forward finite differences. For more details on the choices, see the
29+
[FiniteDiff.jl](https://github.com/JuliaDiff/FiniteDiff.jl) documentation.
30+
"""
131
struct SimpleNewtonRaphson{CS, AD, FDT} <: AbstractNewtonAlgorithm{CS, AD, FDT}
232
function SimpleNewtonRaphson(; chunk_size = Val{0}(), autodiff = Val{true}(),
333
diff_type = Val{:forward})

0 commit comments

Comments
 (0)