[1a80b4] | 1 | //////////////////////////////////////////////////////////// |
---|
| 2 | // emacs edit mode for this file is -*- C++ -*- |
---|
| 3 | //////////////////////////////////////////////////////////// |
---|
| 4 | |
---|
| 5 | #ifndef INCL_CSUTIL_H |
---|
| 6 | #define INCL_CSUTIL_H |
---|
| 7 | |
---|
| 8 | #include <factory.h> |
---|
[639047e] | 9 | #include "algfactor.h" |
---|
[1a80b4] | 10 | #include <tmpl_inst.h> |
---|
| 11 | |
---|
| 12 | // inline function's: |
---|
| 13 | |
---|
| 14 | inline int |
---|
| 15 | cls ( const CanonicalForm & f ){ if ( getNumVars(f) == 0 ) {return 0;} else {return f.level();} } |
---|
| 16 | |
---|
| 17 | inline int |
---|
| 18 | rank ( const CanonicalForm & f ){ return cls(f); } |
---|
| 19 | |
---|
| 20 | inline CanonicalForm |
---|
| 21 | ini ( const CanonicalForm & f ){ return LC(f); } |
---|
| 22 | |
---|
| 23 | inline CanonicalForm |
---|
| 24 | ini ( const CanonicalForm & f , const Variable v ){ return LC(f,v); } |
---|
| 25 | |
---|
| 26 | inline Variable |
---|
| 27 | lvar ( const CanonicalForm & f ){ return f.mvar(); } |
---|
| 28 | |
---|
| 29 | /////////////////////////////////////////////////////////////// |
---|
| 30 | // a class definition needed in charset.cc for Prem |
---|
| 31 | /////////////////////////////////////////////////////////////// |
---|
| 32 | /*BEGINPUBLIC*/ |
---|
| 33 | |
---|
| 34 | class PremForm { |
---|
| 35 | public: |
---|
| 36 | CFList FS1; |
---|
| 37 | CFList FS2; |
---|
| 38 | inline PremForm& operator=( const PremForm& value ){ |
---|
| 39 | if ( this != &value ){ |
---|
| 40 | FS1 = value.FS1; |
---|
| 41 | FS2 = value.FS2; |
---|
| 42 | } |
---|
| 43 | return *this; |
---|
| 44 | } |
---|
| 45 | }; |
---|
| 46 | |
---|
| 47 | /*ENDPUBLIC*/ |
---|
| 48 | |
---|
| 49 | // functions from csutil.cc: |
---|
| 50 | /*BEGINPUBLIC*/ |
---|
| 51 | CanonicalForm Prem( const CanonicalForm &f, const CanonicalForm &g ); |
---|
| 52 | CanonicalForm Prem( const CanonicalForm &f, const CFList &L ); |
---|
| 53 | CFList Prem( const CFList &AS, const CFList &L ); |
---|
[639047e] | 54 | CanonicalForm alg_gcd(const CanonicalForm &, const CanonicalForm &, const CFList &); |
---|
[1a80b4] | 55 | /*ENDPUBLIC*/ |
---|
[4a81ec] | 56 | CanonicalForm divide( const CanonicalForm & ff, const CanonicalForm & f, const CFList & as); |
---|
| 57 | CFList remsetb( const CFList & ps, const CFList & as); |
---|
[1a80b4] | 58 | CanonicalForm lowestRank( const CFList & F ); |
---|
| 59 | |
---|
| 60 | CFList removecontent ( const CFList & PS, PremForm & Remembern ); |
---|
| 61 | void removefactor( CanonicalForm & r , PremForm & Remembern); |
---|
| 62 | CFList factorps( const CFList &ps ); |
---|
[9e131d] | 63 | //CFList initalset(const CFList & CSet); |
---|
| 64 | CFList initalset1(const CFList & CSet); |
---|
| 65 | CFList initalset2(const CFList & CSet, const CanonicalForm & reducible); |
---|
| 66 | int irreducible( const CFList & ASet); |
---|
| 67 | CFList select( const ListCFList & PSet); |
---|
[4a81ec] | 68 | void select( const ListCFList & ppi, int length, ListCFList & ppi1, |
---|
| 69 | ListCFList & ppi2); |
---|
| 70 | bool same( const CFList &A, const CFList &B ); |
---|
| 71 | bool member( const CFList & cs, const ListCFList & pi ); |
---|
[9e131d] | 72 | bool subset( const CFList &PSet, const CFList &CSet ); |
---|
[4a81ec] | 73 | ListCFList MyUnion( const ListCFList & a, const ListCFList &b ); |
---|
| 74 | ListCFList MyDifference( const ListCFList & a, const CFList &b); |
---|
| 75 | ListCFList Minus( const ListCFList & a, const ListCFList &b); |
---|
[1a80b4] | 76 | #endif /* INCL_CSUTIL_H */ |
---|
| 77 | |
---|