Managing state space

NumCME.StateSpaceSparse โ€” Type
mutable struct StateSpaceSparse{NS, NR, IntT<:Integer, SizeT<:Integer} <: AbstractStateSpaceSparse{NS, NR, IntT<:Integer, SizeT<:Integer}

Basic Sparse FSP State space.

Fields

  • stoich_matrix: Stoichiometry matrix S = [sโ‚ ... sโ‚˜] of size N x M where N is the number of species, M the number of the reactions.

  • sink_count: Number of sinks

  • states: Array of CME states included in the subspace

  • state2idx: Dictionary of states, containing pairs (x=>i) for (i,x) in enumerate(states). The implementation must ensure that each state in states is a key in state2idx and conversely every key in state2idx exists in states.

  • state_connectivity: List of state connectivity information. state_connectivity[i][k] = j if xแตข = xโฑผ + sโ‚–, that is, states[i] = states[j] + stoich_mat[:, k]. If there is no existing state that can reach xแตข via reaction k, the implementation must ensure that state_connectivity[i][k] = 0.

  • sink_connectivity: Matrix to store reaction events by which the included states transit to outside of the projected state space

See also

expand!,deleteat!

source
NumCME.StateSpaceSparse โ€” Method

StateSpaceSparse(stoich_mat::Matrix{IntT}, init_state::Vector{IntT}; index_type::Type{<:Integer}=UInt32)

Construct a basic FSP state space with stoichiometry matrix stoich_mat and a single state init_state with their integer entries being stored in type IntT <: Integer. The optional keyword argument index_type allows for more customization on internal indexing representations.

Examples

jldoctest julia> S = [[1,0] [-1,0] [0,1] [0,-1]] 2ร—4 Matrix{Int64}: 1 -1 0 0 0 0 1 -1 julia> x0 = [0,1] julia> StateSpaceSparse(S, states)`

source
NumCME.StateSpaceSparse โ€” Method
mutable struct StateSpaceSparse{NS, NR, IntT<:Integer, SizeT<:Integer} <: AbstractStateSpaceSparse{NS, NR, IntT<:Integer, SizeT<:Integer}

Construct a basic FSP state space with stoichiometry matrix stoich_mat and initial list of states initstates with their integer entries being stored in type IntT <: Integer.

Examples

julia> S = [[1,0] [-1,0] [0,1] [0,-1]]
2ร—4 Matrix{Int64}:
 1  -1  0   0
 0   0  1  -1
 julia> states = [[0,1], [10, 1], [0, 10]]
 3-element Vector{Vector{Int64}}:
 [0, 1]
 [10, 1]
 [0, 10]
julia> StateSpaceSparse(S, states)
source
Base.deleteat! โ€” Method
deleteat!(
    statespace::StateSpaceSparse,
    ids::Array{T<:Integer, 1}
)

Delete states with indices ids from the state space.

source
NumCME.expand! โ€” Method
expand!(
    statespace::StateSpaceSparse{NS, NR, IntT<:Integer, SizeT<:Integer},
    expansionlevel::Integer;
    onlyreactions
)

Expand the FSP state space to include all states that are reachable from the existing states in expansionlevel or fewer reaction events. State exploration direction is restricted to only reaction channels within onlyreactions if this argument is non-empty.

source
NumCME.get_statedict โ€” Method
get_statedict(
    statespace::StateSpaceSparse
) -> Dict{StaticArraysCore.MVector{NS, IntT}, SizeT} where {NS, IntT<:Integer, SizeT<:Integer}

Return state dictionary.

source
NumCME.get_states โ€” Method
get_states(
    statespace::StateSpaceSparse
) -> Array{StaticArraysCore.MVector{NS, IntT}, 1} where {NS, IntT<:Integer}

Return list of states.

source
NumCME.get_stoich_matrix โ€” Method
get_stoich_matrix(
    space::StateSpaceSparse
) -> Matrix{IntT} where IntT<:Integer

Return the stoichiometry matrix.

source