Skip to content

Commit

Permalink
improved EvalcLTD using Block for the evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
apelloni committed Oct 20, 2022
1 parent e39c7cd commit 27e5a0b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cLTD.m
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,11 @@ id Diff(k`i',n1?{>0})*k`i'^n3? =


(* ::Input::Initialization:: *)
EvalcLTD[cLTDexpr_,numerics_]:=cLTDexpr[[1]]/.(cLTDexpr[[2]]/.numerics)/.numerics
EvalcLTD[cLTDexpr_,numerics_]:=Module[{subs=Rule@@@Transpose[{#,#/.cLTDexpr[[2]]/.numerics}]&@Variables[cLTDexpr[[1]]]},
Block[Evaluate[First/@subs],
subs/.Rule->Set;cLTDexpr[[1]]
]
]


(* ::Input::Initialization:: *)
Expand Down

0 comments on commit 27e5a0b

Please sign in to comment.