#include #include using namespace std; using namespace GiNaC; class exless : public binary_function { public: bool operator()(const ex&,const ex&); }; class Restargs { friend ex rest_eval(const ex&x); public: void clear() { heap.clear(); } private: setheap; }; DECLARE_FUNCTION_1P(rest) struct splitrestrest : public map_function,public pair { public: splitrestrest(const ex&); private: ex operator()(const ex&); }; struct Restify : public map_function { ex operator()(const ex&,const symbol&); ex operator()(const ex&); private: ex s; }; class substitution { friend class exoutclass; enum kind{setfun,getfun,temp}; substitution(const ex&x,const ex&y,const kind&k_) :subssym(x),subsex(y),k(k_){} ex subssym; ex subsex; kind k; }; class exoutclass { public: exoutclass():varnum(0){} void getfunction(const symbol&,const ex&); void setfunction(const symbol&,const ex&); void writeoutbase(char*,char*,const print_context&); void writeouth(char*,char*,const print_context&,char*p=0); void writeoutC(char*,char*,const print_context&); void print(); private: typedef list::iterator slistit; listslist; mutable int varnum; friend struct Makerestexpr : public map_function { Makerestexpr(const exoutclass*eoc_){eoc=eoc_;} ex operator()(const ex&); mapm; private: const exoutclass*eoc; }; symbol newvar() const { char buffer[10]; sprintf(buffer,"var%d",varnum++); return symbol(buffer); } };