Skip to content

Commit

Permalink
Schedule.m: Replace <type>GroupStruct functions with storageStructure…
Browse files Browse the repository at this point in the history
… function

This simplifies and clarifies the code.
  • Loading branch information
ianhinder committed Nov 21, 2012
1 parent 3682e29 commit 92386da
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions Tools/CodeGen/Schedule.m
Expand Up @@ -28,25 +28,11 @@
Scheduling
-------------------------------------------------------------------------- *)

simpleGroupStruct[groupName_, timelevels_] :=
storageStructure[groupName_, timelevels_, param_String] :=
{
Group -> groupName,
Timelevels -> timelevels,
MaxTimelevels -> "other_timelevels"
};

evolvedGroupStruct[groupName_, timelevels_] :=
{
Group -> groupName,
Timelevels -> timelevels,
MaxTimelevels -> "timelevels"
};

rhsGroupStruct[groupName_, timelevels_] :=
{
Group -> groupName,
Timelevels -> timelevels,
MaxTimelevels -> "rhs_timelevels"
MaxTimelevels -> param
};

groupsSetInCalc[calc_, groups_] :=
Expand Down Expand Up @@ -288,15 +274,15 @@
{tl},
tl = NonevolvedTimelevels[groupFromName[#, groups]];
If[tl===1,
simpleGroupStruct[#, tl],
evolvedGroupStruct[#, evolutionTimelevels]]] &,
storageStructure[#, tl, "other_timelevels"],
storageStructure[#, evolutionTimelevels, "timelevels"]]] &,
(* over *)
nonevolvedGroups],

Map[evolvedGroupStruct[#, evolutionTimelevels] &,
Map[storageStructure[#, evolutionTimelevels, "timelevels"] &,
evolvedGroups],

Map[rhsGroupStruct[#, evolutionTimelevels] &,
Map[storageStructure[#, evolutionTimelevels, "rhs_timelevels"] &,
rhsGroups]];

(* Schedule groups defined in calculations *)
Expand Down

0 comments on commit 92386da

Please sign in to comment.