diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-05-02 09:08:19 +0200 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-05-02 09:11:38 +0200 |
commit | 51d6d5bf49e6f2b1829de971a3c9da2b4b09372e (patch) | |
tree | 7417de095592a7c624b9aa7599961ab1f51dbec5 | |
parent | e28caac46d817eb9b8e41274bd3bb6a5a22b9ed4 (diff) |
Calculation.m: Add GetSchedule function
-rw-r--r-- | Tools/CodeGen/Calculation.m | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Tools/CodeGen/Calculation.m b/Tools/CodeGen/Calculation.m index 55644ed..7169b05 100644 --- a/Tools/CodeGen/Calculation.m +++ b/Tools/CodeGen/Calculation.m @@ -37,6 +37,7 @@ AddCondition; AddConditionSuffix; InNewScheduleGroup; BoundaryCalculationQ; +GetSchedule; Begin["`Private`"]; @@ -329,6 +330,15 @@ InNewScheduleGroup[groupName_String, calc_List] := Schedule, {"in "<>groupName}], ScheduleGroups, Append[lookup[calc, ScheduleGroups, {}],newGroup]]]; +DefFn[ + GetSchedule[calc_List] := + Module[ + {s = lookup[calc,Schedule,Automatic]}, + If[s =!= Automatic && !ListQ[s], + ThrowError["Calculation "<>lookup[calc,Name]<>" has an invalid Schedule entry: ", + s]]; + s]]; + End[]; EndPackage[]; |