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