@@ -93,7 +93,7 @@ function coordinate(name, ex::Expr, p, scale_noise)
9393 (jump_rate_expr, jump_affect_expr, jumps, regular_jumps) = get_jumps (reactions, reactants, parameters)
9494
9595 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))
9797 f_symfuncs = hcat ([SymEngine. Basic (f) for f in f_rhs])
9898
9999 # Build the type
@@ -103,7 +103,7 @@ function coordinate(name, ex::Expr, p, scale_noise)
103103 f_funcs = [element. args[2 ] for element in f_expr]
104104 g_funcs = [element. args[2 ] for element in g_expr]
105105
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 )
107107
108108 push! (exprs,typeex)
109109 push! (exprs,constructorex)
@@ -379,7 +379,7 @@ function recursive_clean!(expr::Any)
379379 in (expr. args[1 ],hill_name) && return hill (expr)
380380 in (expr. args[1 ],mm_name) && return mm (expr)
381381 (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.")
383383 end
384384 return expr
385385end
@@ -432,11 +432,12 @@ end
432432# Makes the Jacobian.
433433function calculate_jac (f_expr:: Vector{Expr} , syms)
434434 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);
436436 symfuncs = [SymEngine. Basic (recursive_replace! (f,Dict (zip (syms,internal_vars)))) for f in f_expr]
437437 for i = 1 : n, j = 1 : n
438438 symjac[i,j] = diff (symfuncs[i],internal_vars[j])
439439 end
440+ @show symjac
440441 map! (symentry -> SymEngine. Basic (recursive_replace! (parse (string (symentry)),Dict (zip (internal_vars,syms)))),symjac)
441442 return symjac
442443end
0 commit comments