Skip to content

Commit

Permalink
Differencing.m: Fix logic in ComponentDerivativeOperatorMacroDefinition
Browse files Browse the repository at this point in the history
The variable assignment in this function got messed up at some point, so that differencing operators which didn't fit the pattern for precomputation would not be generated correctly.
  • Loading branch information
ianhinder committed Oct 13, 2011
1 parent f9f02fa commit a55421d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Tools/CodeGen/Differencing.m
Expand Up @@ -381,15 +381,16 @@ A GridFunctionDerivative (GFD) is an expression of the form
Print["Sequenced: ", Apply[SequenceForm,Simplify[1/(ss /. spacings2)],{0,Infinity}]];*)

liName = "p" <> signModifier <> quotient <> ToString[Apply[SequenceForm,Simplify[1/(ss /. spacings2)],{0,Infinity}]];
(* Print["liName == ", liName];*)
pDefs = {{liName -> CFormHideStrings[ReplacePowers[num / den ss /. spacings2, vectorise]]}};

rhs = rhs /. pat -> Times[liName, rest],
(* Print["!!!!!!!!DOES NOT MATCH!!!!!!!!!"];*)
rhs = rhs];
rhs = rhs;
pDefs = {};
liName = rhs];

(* Print["rhs3 == ", FullForm[rhs]];*)

pDefs = {{liName -> CFormHideStrings[ReplacePowers[num / den ss /. spacings2, vectorise]]}};

(* rhs = Factor[rhs];*)
rhs = rhs //. (x_ a_ + x_ b_) -> x (a+b);
Expand Down

0 comments on commit a55421d

Please sign in to comment.