|
1 | | -__precompile__() |
2 | | - |
3 | 1 | """ |
4 | 2 | $(DocStringExtensions.README) |
5 | 3 | """ |
@@ -27,66 +25,3 @@ module ParameterizedFunctions |
27 | 25 |
|
28 | 26 | export @ode_def, ode_def_opts, @ode_def_bare, @ode_def_all |
29 | 27 | end # module |
30 | | - |
31 | | -##### Extra |
32 | | - |
33 | | -# Jacobian Factorization |
34 | | - |
35 | | -#= |
36 | | -local fsymjac_L |
37 | | -local fsymjac_U |
38 | | -local Jex_L |
39 | | -local Jex_U |
40 | | -try |
41 | | - # Factorize the Jacobian |
42 | | - fsymjac = lufact(symjac) |
43 | | - fsymjac_L = fsymjac[:L] |
44 | | - fsymjac_U = fsymjac[:U] |
45 | | - Jex_L,Jex_U = build_fjac_func(fsymjac_L,fsymjac_U,indvar_dict,param_dict,inline_dict) |
46 | | -catch |
47 | | - fsymjac_L = Matrix{SymEngine.Basic}(0,0) |
48 | | - fsymjac_U = Matrix{SymEngine.Basic}(0,0) |
49 | | -end |
50 | | -
|
51 | | -""" |
52 | | -Builds the LU-factorized Jacobian functions |
53 | | -""" |
54 | | -function build_fjac_func(symjac_L,symjac_U,indvar_dict,param_dict,inline_dict) |
55 | | - # Lower Triangle |
56 | | - Jex = :() |
57 | | - for i in 1:size(symjac_L,1) |
58 | | - for j in 1:i |
59 | | - ex = parse(string(symjac_L[i,j])) |
60 | | - if ex isa Expr |
61 | | - ode_findreplace(ex,ex,indvar_dict,param_dict,inline_dict) |
62 | | - else |
63 | | - ex = ode_symbol_findreplace(ex,indvar_dict,param_dict,inline_dict) |
64 | | - end |
65 | | - push!(Jex.args,:(J[$i,$j] = $ex)) |
66 | | - end |
67 | | - end |
68 | | - Jex.head = :block |
69 | | - push!(Jex.args,nothing) |
70 | | - Jex_L = :(jac = (t,u,J)->$Jex) |
71 | | -
|
72 | | - # Upper Triangle |
73 | | - Jex = :() |
74 | | - for j in 1:size(symjac_U,2) |
75 | | - for i in 1:j |
76 | | - ex = parse(string(symjac_U[i,j])) |
77 | | - if ex isa Expr |
78 | | - ode_findreplace(ex,ex,indvar_dict,param_dict,inline_dict) |
79 | | - else |
80 | | - ex = ode_symbol_findreplace(ex,indvar_dict,param_dict,inline_dict) |
81 | | - end |
82 | | - push!(Jex.args,:(J[$i,$j] = $ex)) |
83 | | - end |
84 | | - end |
85 | | - Jex.head = :block |
86 | | - push!(Jex.args,nothing) |
87 | | - Jex_U = :(jac = (t,u,J)->$Jex) |
88 | | -
|
89 | | - Jex_L,Jex_U |
90 | | -end |
91 | | -
|
92 | | -=# |
0 commit comments