Skip to content

Commit

Permalink
adding helper function retuning dimensions of parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Feb 11, 2015
1 parent adcb585 commit 14c4384
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions meta/Parameters.m
Expand Up @@ -28,6 +28,7 @@
GetPhase::usage="";
HasPhase::usage="";
GetTypeFromDimension::usage="";
GetParameterDimensions::usage="";

IsRealParameter::usage="";
IsComplexParameter::usage="";
Expand Down Expand Up @@ -294,6 +295,16 @@
GetType[sym_] :=
GetTypeFromDimension[sym, SARAH`getDimParameters[sym]];

GetParameterDimensions[sym_] :=
Module[{dim},
dim = SARAH`getDimParameters[sym];
Switch[dim,
{}, {1},
{0}, {1},
_, dim
]
];

CreateIndexReplacementRules[pars_List] :=
Module[{indexReplacementRules, p, i,j,k,l, dim, rule, parameter},
indexReplacementRules = {};
Expand Down

0 comments on commit 14c4384

Please sign in to comment.