void _SetWreathOrder(Source & so,Sink & si) { stringGB name; list<stringGB> L; so >> name; GBInputSpecial(L,so); T * p = Name2Instance<AdmissibleOrder>::s_find(name); if(!p) { vector<vector<Variable> > VARS; vector<AdmissibleOrder *> ORDS; typedef list<stringGB>::const_iterator LI; LI w = L.begin(), e = L.end(); AdmissibleOrder * q; while(w!=e) { q = Name2Instance<AdmissibleOrder>::s_find((*w).value()); ORDS.push_back(q); ++w; }; DBG(); p = new WreathOrder(VARS,ORDS); Name2Instance<AdmissibleOrder>::s_add(name,p); }; GBInput(*p,so); so.shouldBeEnd(); si.noOutput(); };
// MUST BE CUSTOMIZED FOR EACH RuleSet void construct_ruleset_adm(const simpleString & s,Source & source) { asStringGB orderName; list<Polynomial> L; Source so(source.inputNamedFunction("List")); so >> orderName; GBInputSpecial(L,so); AdmissibleOrder * p; bool valid = StorageGet(order_storage,orderName.value(),p); if(valid) { RuleSet * result = new AdmRuleSet(*p); typedef list<Polynomial>::const_iterator LI; LI w = L.begin(), e = L.end(); int i = 1; while(w!=e) { RuleID rid(*w,i); result->insert(rid); ++w;++i; }; GBStream << "Constructing the ruleset with name " << s << '\n'; result->print(GBStream); GBStream << "end\n"; ruleset_storage.insert(make_pair(s,result)); } else DBG(); };