cme_matrix

Builds CME matrix for dp/dt, broken into terms for each reaction.

cmepy.cme_matrix.compute_propensity(prop, states)
Returns the propensity prop evaluated over states.
cmepy.cme_matrix.create_diff_eqs(reaction_matrices, phi=None)

create_diff_eqs(reaction_matrices [, phi]) -> diff_eqs

where diff_eqs(t, p) -> dp_dt

reaction_matrices : sequence of terms of dp/dt matrix corresponding to
the reactions.
phi : mapping of time dependent coefficient functions keyed by subsets of
reaction indices. By default, no time dependent coefficient functions are specified, so the returned diff_eqs function is time independent.
cmepy.cme_matrix.gen_reaction_matrices(model, domain_enum, sink, validity_test)

Returns generator yielding the sparse matrices for each reaction term.

Generator yielding the sparse matrices for the dp/dt term of each reaction, matching the ordering implied by the ordering of the reaction propensity functions and transtions in the model.

Arguments:

  • domain_enum : StateEnum instance enumerating the states in the domain

  • sink : boolean flag indicating if the reaction matrices should add a ‘sink’ state used to accumulate probability that flows outside of the domain. If sink is set to True, the index of the sink state is chosen to be domain_enum.size

  • validity_test : a function of the form

    validity_test(state_array) -> bool_array

    Returns a boolean array of flags corresponding to those states in state_array that are valid.

    See: non_neg_states(state_array)

cmepy.cme_matrix.non_neg_states(state_array)

non_neg_states(state_array) -> bool_array

Returns a boolean array of flags corresponding to those states in state_array that have no negative coordinate.

cmepy.cme_matrix.optimise_csr_matrix(csr_matrix)
Performs in place operations to optimise csr matrix data. Returns None.

Previous topic

api documentation

Next topic

domain

This Page