@@ -93,7 +93,7 @@ function coordinate(name, ex::Expr, p, scale_noise)
93
93
(jump_rate_expr, jump_affect_expr, jumps, regular_jumps) = get_jumps (reactions, reactants, parameters)
94
94
95
95
f_rhs = [element. args[2 ] for element in f_expr]
96
- symjac = Expr (:quote , calculate_jac (deepcopy (f_rhs), syms))
96
+ # symjac = Expr(:quote, calculate_jac(deepcopy(f_rhs), syms))
97
97
f_symfuncs = hcat ([SymEngine. Basic (f) for f in f_rhs])
98
98
99
99
# Build the type
@@ -103,7 +103,7 @@ function coordinate(name, ex::Expr, p, scale_noise)
103
103
f_funcs = [element. args[2 ] for element in f_expr]
104
104
g_funcs = [element. args[2 ] for element in g_expr]
105
105
106
- typeex,constructorex = maketype (name, f, f_funcs, f_symfuncs, g, g_funcs, jumps, regular_jumps, Meta. quot (jump_rate_expr), Meta. quot (jump_affect_expr), p_matrix, syms; params= params, symjac = symjac, reactions = reactions )
106
+ typeex,constructorex = maketype (name, f, f_funcs, f_symfuncs, g, g_funcs, jumps, regular_jumps, Meta. quot (jump_rate_expr), Meta. quot (jump_affect_expr), p_matrix, syms; params= params, reactions = reactions) # , symjac=symjac )
107
107
108
108
push! (exprs,typeex)
109
109
push! (exprs,constructorex)
@@ -379,7 +379,7 @@ function recursive_clean!(expr::Any)
379
379
in (expr. args[1 ],hill_name) && return hill (expr)
380
380
in (expr. args[1 ],mm_name) && return mm (expr)
381
381
(expr. args[1 ] == :binomial ) && (expr. args[3 ] == 1 ) && return expr. args[2 ]
382
- isdefined (expr. args[1 ]) || error (" Function $(expr. args[1 ]) not defined." )
382
+ # @ isdefined($( expr.args[1]) ) || error("Function $(expr.args[1]) not defined.")
383
383
end
384
384
return expr
385
385
end
@@ -432,11 +432,12 @@ end
432
432
# Makes the Jacobian.
433
433
function calculate_jac (f_expr:: Vector{Expr} , syms)
434
434
n = length (syms); internal_vars = [Symbol (:internal_variable___ ,var) for var in syms]
435
- symjac = Matrix {SymEngine.Basic} (n, n);
435
+ symjac = Matrix {SymEngine.Basic} (undef, n, n);
436
436
symfuncs = [SymEngine. Basic (recursive_replace! (f,Dict (zip (syms,internal_vars)))) for f in f_expr]
437
437
for i = 1 : n, j = 1 : n
438
438
symjac[i,j] = diff (symfuncs[i],internal_vars[j])
439
439
end
440
+ @show symjac
440
441
map! (symentry -> SymEngine. Basic (recursive_replace! (parse (string (symentry)),Dict (zip (internal_vars,syms)))),symjac)
441
442
return symjac
442
443
end
0 commit comments