|
1 | | -module AffineHR |
2 | | -using ..CUDA |
3 | | -using ..DocStringExtensions |
4 | | -using SparseArrays |
5 | | - |
6 | | -import ..COBREXA |
7 | | -import ..TeaRNG |
8 | | -import Random |
9 | 1 |
|
10 | 2 | function random_mix_matrix(npts, mix_points) |
11 | 3 | mtx = sparse( |
@@ -48,19 +40,21 @@ present. |
48 | 40 | If you are generating a sample of the optimal model solution, it is expected |
49 | 41 | that the optimum bound is already present in `m`. |
50 | 42 |
|
51 | | -Returns a matrix of the same size as `start`. |
| 43 | +Returns blocks of the same size as `sample_c`. |
52 | 44 | """ |
53 | | -function sample( |
54 | | - m::COBREXA.MetabolicModel, |
55 | | - start::AbstractMatrix; |
56 | | - iters::Int, |
57 | | - bound_stoichiometry::Bool = false, |
58 | | - check_stoichiometry::Bool = true, |
59 | | - direction_noise_max::Union{Nothing,Float32} = nothing, |
60 | | - epsilon::Float32 = 1.0f-5, |
61 | | - seed = Random.rand(UInt32), |
| 45 | +function sample_chain_affine_hr_cuda( |
| 46 | + sample_c::COBREXA.M; |
| 47 | + variable_lower_bounds::COBREXA.V, |
| 48 | + variable_upper_bounds::COBREXA.V, |
| 49 | + constraints::COBREXA.SM, |
| 50 | + lower_bounds::COBREXA.V, |
| 51 | + upper_bounds::COBREXA.V, |
| 52 | + epsilon::Float32 = COBREXA.configuration.sampler_tolerance, |
| 53 | + collect_iterations::Vector{Int}, |
| 54 | + generator::StableRNG, |
62 | 55 | mix_points = 3, |
63 | | - mix_mtx = random_mix_matrix(size(start, 2), mix_points), |
| 56 | + mix_mtx = random_mix_matrix(size(sample_c, 2), mix_points), |
| 57 | + direction_noise_max::Union{Nothing,Float32} = nothing, |
64 | 58 | ) |
65 | 59 | # allocate base helper variables |
66 | 60 | npts = size(start, 2) |
@@ -183,5 +177,3 @@ function sample( |
183 | 177 |
|
184 | 178 | collect(pts) |
185 | 179 | end |
186 | | - |
187 | | -end # module AffineHR |
0 commit comments