Skip to content

Commit 4662123

Browse files
committed
Updated documentation
1 parent b0d5d74 commit 4662123

File tree

13 files changed

+38
-73
lines changed

13 files changed

+38
-73
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ end ρ σ_on σ_off d
5252

5353
# This automatically reduces the dimensionality of the
5454
# network by exploiting conservation laws
55-
ih = ReducedIndexHandler(rn)
55+
ih = ReducingIndexHandler(rn)
5656
sys = FSPSystem(rn, ih)
5757

5858
# There is one conserved quantity: G_on + G_off

docs/make.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Documenter
22
using FiniteStateProjection
33
using SparseArrays
4-
using FiniteStateProjection: AbstractIndexHandler
54

65
makedocs(sitename="FiniteStateProjection.jl",
76
modules=[FiniteStateProjection],
@@ -12,7 +11,7 @@ makedocs(sitename="FiniteStateProjection.jl",
1211
"Index Handlers" => "indexhandlers.md",
1312
"Matrix Conversions" => "matrix.md",
1413
"Internal API" => "internal.md",
15-
"Tips & Tricks" => "tips.md"
14+
"Tips & Tricks" => "tips.md",
1615
"Examples" => "examples.md"
1716
])
1817

docs/src/examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ end ρ σ_on σ_off d
4747

4848
# This automatically reduces the dimensionality of the
4949
# network by exploiting conservation laws
50-
ih = ReducedIndexHandler(rn)
50+
ih = ReducingIndexHandler(rn)
5151
sys = FSPSystem(rn, ih)
5252

5353
# There is one conserved quantity: G_on + G_off

docs/src/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ This function is generated dynamically as an `ODEFunction` for use with Differen
2020
- The Chemical Master Equation can be generated as a `SparseMatrixCSC`
2121
- Flexible API for user-defined array types via `IndexHandler`s
2222
- Automatic dimensionality reduction for systems with conserved quantities
23+
24+
## Acknowledgments
25+
26+
Special thanks to [Xiamong Fu](https://github.com/palmtree2013), [Brian Munsky](https://www.engr.colostate.edu/~munsky/) and [Huy Vo](https://github.com/voduchuy) for their examples and suggestions and for contributing most of the content in the [Tips & Tricks](@ref tips) page!

docs/src/indexhandlers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Index Handlers
22

3-
The task of an index handler is to provide a mapping between the system state and the way it is stored in memory, usually as a multidimensional array. The standard approach is to represent the states of a system with ``s`` reactions as an ``s``-dimensional array and have the index ``(i_1, \ldots, i_s)`` correspond to the state ``(n_1 = i_1, \ldots, n_s = i_s)``. This is implemented by the class [`NaiveIndexHandler`](@ref), which accepts an offset argument to deal with Julia's 1-based indexing (so the Julia index $(1,\ldots,1)$ corresponds to the state with no molecules). For systems with conservation laws the [`DefaultIndexHandler`](@ref) class generally stores the data more efficiently.
3+
The task of an index handler is to provide a mapping between the system state and the way it is stored in memory, usually as a multidimensional array. The standard approach is to represent the states of a system with ``s`` reactions as an ``s``-dimensional array and have the index ``(i_1, \ldots, i_s)`` correspond to the state ``(n_1 = i_1, \ldots, n_s = i_s)``. This is implemented by the class [`NaiveIndexHandler`](@ref), which accepts an offset argument to deal with Julia's 1-based indexing (so the Julia index $(1,\ldots,1)$ corresponds to the state with no molecules). For systems with conservation laws the [`ReducingIndexHandler`](@ref) class generally stores the data more efficiently.
44

55
See the [internal API](@ref index_handlers_internal) on how to define your own `IndexHandler` type.
66

77
```@docs
88
NaiveIndexHandler
9-
DefaultIndexHandler
9+
ReducingIndexHandler
1010
reducedspecies
11-
elidedspecies(::DefaultIndexHandler)
11+
elidedspecies(::ReducingIndexHandler)
1212
```

docs/src/internal.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ For matrix conversions they should additionally implement:
2626
singleindices
2727
pairedindices
2828
getsubstitutions
29-
build_rhs_header(::AbstractIndexHandler, ::FSPSystem)
29+
build_rhs_header
3030
LinearIndices
3131
```
3232

3333
### Built-in implementations
3434
```@docs
3535
elidedspecies(::AbstractMatrix{Int})
3636
elisions
37-
getsubstitutions(::NaiveIndexHandler, ::FSPSystem)
38-
getsubstitutions(::DefaultIndexHandler, ::FSPSystem)
39-
build_rhs_header(::DefaultIndexHandler, ::FSPSystem)
40-
pairedindices(::DefaultIndexHandler, ::AbstractArray, ::CartesianIndex)
37+
getsubstitutions(::NaiveIndexHandler, ::ReactionSystem)
38+
getsubstitutions(::ReducingIndexHandler, ::ReactionSystem)
39+
build_rhs_header(::FSPSystem{ReducingIndexHandler})
40+
pairedindices(::ReducingIndexHandler, ::AbstractArray, ::CartesianIndex)
4141
```
4242

4343
## Function Building

docs/src/mainapi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ conservedquantities
1818
The following methods are the main way to create a system of ODEs representing the time-dependent FSP. This package provides a flexible way to represent the FSP in memory via index handlers, see [Index Handlers] for more information.
1919

2020
```@docs
21-
Base.convert(::Type{ODEFunction}, ::AbstractIndexHandler, ::FSPSystem)
22-
Base.convert(::Type{ODEProblem}, ::AbstractIndexHandler, ::FSPSystem, u0, tmax, p)
21+
Base.convert(::Type{ODEFunction}, ::FSPSystem)
22+
Base.convert(::Type{ODEProblem}, ::FSPSystem, u0, tmax, p)
2323
```

docs/src/matrix.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
CurrentModule = FiniteStateProjection
44
```
55

6-
FiniteStateProjection.jl provides functionality for building the right-hand side of the CME as a (sparse) matrix. This provides another way to solve the CME in time via
6+
FiniteStateProjection.jl provides functionality for building the right-hand side of the CME as a (sparse) matrix. This provides another way to solve the CME in time:
77
```julia
88
...
99

10-
A = convert(SparseMatrixCSC, sys, idxhandler, dims, p)
10+
A = convert(SparseMatrixCSC, sys, dims, p, 0)
1111

1212
prob = ODEProblem((du,u,p,t) -> mul!(du, p, u), u0, tt, A)
1313

@@ -18,7 +18,6 @@ Note that the matrix `A` has to be rebuilt for every truncation size and every s
1818
a restriction not shared by the `ODEFunction` returned by FiniteStateProjection.jl.
1919

2020
```@docs
21-
convert(::Type{SparseMatrixCSC}, ::FSPSystem, ::AbstractIndexHandler,
22-
::NTuple, ps; combinatoric_ratelaw::Bool=true)
21+
convert(::Type{SparseMatrixCSC}, ::FSPSystem, ::NTuple, ps, t)
2322
vec
2423
```

docs/src/theory.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

docs/src/tips.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Tips and Tricks
1+
# [Tips and Tricks](@id tips)
22

33
The FSP approximates an infinite-dimensional system of equations by truncating it to a finite number of variables. The accuracy of the FSP therefore depends on how many variables are retained, ie.~what portion of the state space is modelled. While simple reaction networks with 1 or 2 species are not too difficult to handle using the FSP, a naive approach will require unfeasibly large truncations for systems of even moderate complexity.
44

0 commit comments

Comments
 (0)