Reference

Artificially centered hit-and-run sampling

CuFluxSampler.ACHR.sampleMethod
sample(
    m::COBREXA.MetabolicModel,
    start::AbstractMatrix;
    iters,
    bound_stoichiometry,
    check_stoichiometry,
    direction_noise_max,
    epsilon,
    seed
)

A traditional artificially-centered hit-and-run algorithm that starts with start points.

Refer to the documentation in module AffineHR for the meaning of arguments.

source

Affine hit-and-run sampling

CuFluxSampler.AffineHR.sampleMethod
sample(
    m::COBREXA.MetabolicModel,
    start::AbstractMatrix;
    iters,
    bound_stoichiometry,
    check_stoichiometry,
    direction_noise_max,
    epsilon,
    seed,
    mix_points,
    mix_mtx
)

Use the affine-combination hit-and-run algorithm to generate a sample of the feasible area of m from the set of start points supplied as columns in a matrix.

The run directions are generated from random affine combination of mix_points points (by default 3); matrices mix_mtx and permute_mtx give fine control about the mixing in the process. Preferably, this matrix is very sparse.

check_stoichiometry allows to turn on/off the filtering of generated points based on whether they are close to the steady state (with tolerance epsilon). bound_stoichiometry additionally computes run bounds based on the steady-state region, and uses it to generate better runs. This is useful in combination with direction_noise_max which may add a small noise to the generated run directions, allowing the sampler to discover new directions (potentially not obvious from warmup in start), but easily explodes without limiting the directions.

Additional bounds on run ranges are taken from model coupling constraints, if present.

If you are generating a sample of the optimal model solution, it is expected that the optimum bound is already present in m.

Returns a matrix of the same size as start.

source

Full-linear-combination affine hit-and-run sampling (internal)

CuFluxSampler.FullAffineHR.sampleMethod
sample(
    m::COBREXA.MetabolicModel,
    warmup::AbstractMatrix;
    npts,
    iters,
    bound_stoichiometry,
    check_stoichiometry,
    direction_noise_max,
    epsilon,
    seed
)

Use the full-affine-combination hit-and-run algorithm to generate a sample of the feasible area of m from the warmup points supplied as columns in a matrix. If you are generating a sample of the optimal solution, it is expected that the optimum bound is already present in m.

Returns a matrix of npts samples organized in columns.

This algorithm is mostly a toy for comparing the performance. It works, but do not use it in production.

source

Internal functions

TEA-based RNG

CuFluxSampler.TeaRNG.device_fill_rand!Method
device_fill_rand!(arr, seed::UInt32)

CUDA.jl grid-stride kernel that fills the array with random numbers generated by tea_random. seed is used as the stream ID, global thread index in grid is used as the sequence number.

source
CuFluxSampler.TeaRNG.tea_randomMethod
tea_random(stream::UInt32, seq::UInt32) -> UInt32

Use TEA cipher algorithm to reproducibly generate a seq-th random number from the stream-th random stream.

source