void _UnixDo(Source & so,Sink & si) { stringGB s; so >> s; so.shouldBeEnd(); si.noOutput(); system(s.value().chars()); };
void _GroebnerCutOffSum(Source & so,Sink & si) { int n; so >> n; so.shouldBeEnd(); si.noOutput(); run->setSumNumberCutOff(n); };
void _GroebnerCutOffFlag(Source & so,Sink & si) { int n; so >> n; so.shouldBeEnd(); run->setCutOffFlag(n!=0); si.noOutput(); };
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(); };
void _RunGBAlg(Source & source,Sink & sink) { asStringGB name; source >> name; source.shouldBeEnd(); sink.noOutput(); GBALG_STORAGE::const_iterator w = gbalg_storage.find(name.value()); if(w==gbalg_storage.end()) DBG(); (*w).second->perform(); };
void _CppTeXTheFile(Source & so,Sink & si) { stringGB format; so >> format; StringAccumulator x; x.add(PlatformSpecific::s_latex_command()); x.add(format.value().chars()); so.shouldBeEnd(); si.noOutput(); system(x.chars()); };
void _ShowTeX(Source & so,Sink & si) { stringGB format; so >> format; StringAccumulator x; x.add(PlatformSpecific::s_dvi_viewer()); x.add(format.value().chars()); x.add(PlatformSpecific::s_background()); so.shouldBeEnd(); si.noOutput(); system(x.chars()); };
void _registerStartingRelations(Source & so,Sink & si) { int m; so >> m; so.shouldBeEnd(); int id = BaRoutineFactory::s_getCurrent().ID(); if(false) { } #ifdef WANT_MNGRSUPER else if(id==PDRoutineFactory::s_ID) { ((MngrSuper *)run)->RegisterStartingRelations(m); } #endif si.noOutput(); } /* _registerStartingRelations */
void _namedRegisterStartingRelations(Source & so,Sink & si) { stringGB item_name; so >> item_name; so.shouldBeEnd(); si.noOutput(); GBList<Polynomial>* p = Pools<GBList<Polynomial> >::s_lookup_error(GBStream,item_name.value()); if(p) { registerStartingRelationsHelper(*p); } else { GBStream << "There is no GBList of polynomials called \"" << item_name << "\"\n"; }; };
void _DeclareProgrammableVariableNotDefault(Source & so,Sink & sink) { asStringGB type, name; so >> type >> name; TYPEINFO::const_iterator w = d_type_info.find(type.value()); if(w==d_type_info.end()) { GBStream << "Cannot find the type " << type.value() << "\n"; DBG(); }; d_name_to_type[name.value()] = type.value(); void (*func)(const simpleString &,Source & so) = (*w).second.d_construct_not_default; if(!func) DBG(); func(name.value(),so); so.shouldBeEnd(); sink.noOutput(); };
void _PrintProgrammableVariable(Source & so,Sink & si) { asStringGB name; so >> name; NAME2TYPE::const_iterator w = d_name_to_type.find(name.value()); if(w==d_name_to_type.end()) { GBStream << name.value() << " is not a programmable variable" << " and, therefore, cannot be printed.\n"; } else { TYPEINFO::const_iterator ww = d_type_info.find((*w).second); void (*func)(const simpleString &,MyOstream &) = (*ww).second.d_print; if(!func) DBG(); func(name.value(),GBStream); }; so.shouldBeEnd(); si.noOutput(); };
void _ConstructSheets(Source & so,Sink & si) { simpleString filename("build_output.tex"); ofstream output(filename.chars()); MyOstream output2(output); #ifdef WANT_MNGRADAPTER PartialGB & pgb = (PartialGB &) ((ManagerAdapter *)run)->PARTIALGB(); Spreadsheet x(pgb,AdmissibleOrder::s_getCurrent()); #endif #ifdef WANT_MNGRSUPER FactControl & fc = (FactControl &) ((MngrSuper *)run)->GetFactBase(); // GBStream << fc; #if 1 const GBList<int> VEC(fc.indicesOfPermanentFacts()); GBList<int>::const_iterator VECB = VEC.begin(); vector<GroebnerRule> vec; const int VECSZ = VEC.size(); vec.reserve(VECSZ); for(int iii=1;iii<=VECSZ;++iii,++VECB) { vec.push_back(fc.fact(*VECB)); }; Sheet1 x(vec,AdmissibleOrder::s_getCurrent()); #else Spreadsheet x(fc,AdmissibleOrder::s_getCurrent()); x.uglyprint(GBStream); #endif TeXSink tex_sink(output2); #if 0 TeX1Display tester(tex_sink,x,AdmissibleOrder::s_getCurrent()); #endif #if 0 list<GroebnerRule> L; copy(x.d_rules.begin(),x.d_rules.end(),back_inserter(L)); TeX2Display tester(tex_sink,L,AdmissibleOrder::s_getCurrent()); #endif #if 1 TeX3Display tester(tex_sink,x,AdmissibleOrder::s_getCurrent()); #endif tester.perform(); #endif GBStream << '\n'; so.shouldBeEnd(); si.noOutput(); os.flush(); output.close(); };
void _SetUpProgrammableSymbols(Source &so,Sink & si) { so.shouldBeEnd(); si.noOutput(); { AuxilaryProgrammableSymbolData x(construct_int,remove_int,print_int, input_int,output_int); simpleString I("int"); d_type_info.insert(make_pair(I,x)); } { AuxilaryProgrammableSymbolData x(construct_mlex,remove_order, print_mlex,do_nothing,do_nothing); simpleString I("mlex"); d_type_info.insert(make_pair(I,x)); } { AuxilaryProgrammableSymbolData x(construct_reduce_adm,remove_reduce, print_reduce,do_nothing,do_nothing); simpleString I("admreduction"); d_type_info.insert(make_pair(I,x)); } { AuxilaryProgrammableSymbolData x(construct_ruleset_adm, remove_ruleset,print_ruleset,do_nothing,do_nothing); simpleString I("admruleset"); d_type_info.insert(make_pair(I,x)); } { AuxilaryProgrammableSymbolData x(construct_polyset_adm,remove_polyset, print_polyset_adm,do_nothing,do_nothing); simpleString I("admpolyset"); d_type_info.insert(make_pair(I,x)); } { AuxilaryProgrammableSymbolData x(construct_stdgbalg,remove_gbalg, print_gbalg,do_nothing,do_nothing); simpleString I("standardgbalgorithm"); d_type_info.insert(make_pair(I,x)); } };
void _TestMarker(Source & so,Sink & si) { so.shouldBeEnd(); si.noOutput(); };
void _setNumbersForHistory(Source & so,Sink & si) { numbersForHistory.clear(); GBInput(numbersForHistory,so); so.shouldBeEnd(); si.noOutput(); };
void _PrintAllCommands(Source & so,Sink & si) { so.shouldBeEnd(); printAllCommands(); si.noOutput(); };
void _CreateDisplay(Source & so,Sink & si) { DisplayPart::part()->perform(); so.shouldBeEnd(); si.noOutput(); };
void _NCGBComment(Source & so,Sink & si) { so.passString(); so.shouldBeEnd(); si.noOutput(); };
void _PrintOrder(Source & so,Sink & si) { so.shouldBeEnd(); AdmissibleOrder::s_getCurrent().PrintOrder(GBStream); si.noOutput(); };