diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2013-09-09 19:59:52 +0200 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2013-09-09 19:59:52 +0200 |
commit | 1d7c2717cecd3102118bc408fff3b3061165d032 (patch) | |
tree | caba8752e3e93025caddc8436e8a32c65e7bacbb /Tools | |
parent | b3caf109cd564cb63a4f4248c348a7d81df91844 (diff) |
KrancGroups.m: Add EnsureTimelevels function
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/CodeGen/KrancGroups.m | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Tools/CodeGen/KrancGroups.m b/Tools/CodeGen/KrancGroups.m index f1ee2ea..9140eb2 100644 --- a/Tools/CodeGen/KrancGroups.m +++ b/Tools/CodeGen/KrancGroups.m @@ -54,6 +54,7 @@ NonevolvedTimelevels; CheckGroups; VerifyGroupNames; VerifyGroups; +EnsureTimelevels; Begin["`Private`"]; @@ -258,6 +259,15 @@ VerifyGroupNames[gns_] := ThrowError["Not a list of group names: ", gns], Map[VerifyGroupName, gns]]; +EnsureTimelevels[g_, n_] := + Module[ + {tls, g2}, + tls = GroupTimelevels[g]; + If[tls === False, + AddGroupExtra[g, Timelevels -> n], + (* else *) + g /. {(Timelevels -> x_) :> (Timelevels -> Max[tls, n])}]]; + End[]; EndPackage[]; |