Skip to content

Commit

Permalink
Handle indices for input and extra parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Harries committed Dec 7, 2016
1 parent 7cb4424 commit 0d6eb35
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions meta/Parameters.m
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,17 @@

IsInputParameter[parameter_] := MemberQ[GetInputParameters[], parameter];

IsInputParameter[parameter_[indices__] /; And @@ (IsIndex /@ {indices})] :=
IsInputParameter[parameter];

IsOutputParameter[lst_List] := And @@ (IsOutputParameter /@ lst);
IsOutputParameter[sym_] := MemberQ[GetOutputParameters[],sym];

IsExtraParameter[parameter_] := MemberQ[GetExtraParameters[], parameter];

IsExtraParameter[parameter_[indices__] /; And @@ (IsIndex /@ {indices})] :=
IsExtraParameter[parameter];

IsRealParameter[Re[sym_]] := True;
IsRealParameter[Im[sym_]] := True;
IsRealParameter[FlexibleSUSY`M[_]] := True;
Expand Down Expand Up @@ -642,6 +648,9 @@
RuleDelayed @@ Rule[parameter[i_,j_,k_,l_], parameter[i-1,j-1,k-1,l-1]]
];

CreateIndexReplacementRule[parameter_ /; (IsInputParameter[parameter] || IsExtraParameter[parameter])] :=
CreateIndexReplacementRule[{parameter, GetType[parameter]}];

CreateIndexReplacementRule[parameter_] :=
Module[{i,j,k,l, dim, rule},
dim = SARAH`getDimParameters[parameter];
Expand Down Expand Up @@ -1106,8 +1115,8 @@
IncreaseIndexLiterals[expr, 1];

IncreaseIndexLiterals[expr_, num_Integer] :=
IncreaseIndexLiterals[expr, num, Join[GetInputParameters[], allModelParameters,
allOutputParameters]];
IncreaseIndexLiterals[expr, num, Join[GetInputParameters[], GetExtraParameters[],
allModelParameters, allOutputParameters]];

IncreaseIndexLiterals[expr_, num_Integer, heads_List] :=
Module[{indexedSymbols, rules, decrExpr, allHeads},
Expand Down

0 comments on commit 0d6eb35

Please sign in to comment.