1 | /* Copyright 1996 Michael Messollen. All rights reserved. */ |
---|
2 | //////////////////////////////////////////////////////////// |
---|
3 | // emacs edit mode for this file is -*- C++ -*- |
---|
4 | // $Id: csutil.h,v 1.2 1997-06-09 15:55:55 Singular Exp $ |
---|
5 | //////////////////////////////////////////////////////////// |
---|
6 | |
---|
7 | #ifndef INCL_CSUTIL_H |
---|
8 | #define INCL_CSUTIL_H |
---|
9 | |
---|
10 | #include <factory.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 | /*ENDPUBLIC*/ |
---|
56 | CanonicalForm lowestRank( const CFList & F ); |
---|
57 | |
---|
58 | CFList removecontent ( const CFList & PS, PremForm & Remembern ); |
---|
59 | void removefactor( CanonicalForm & r , PremForm & Remembern); |
---|
60 | CFList factorps( const CFList &ps ); |
---|
61 | //CFList initalset(const CFList & CS); |
---|
62 | CFList initalset1(const CFList & CS); |
---|
63 | CFList initalset2(const CFList & CS, const CanonicalForm & reducible); |
---|
64 | int irreducible( const CFList & AS); |
---|
65 | CFList select( const ListCFList & PS); |
---|
66 | void select( const ListCFList & ppi, int length, ListCFList & ppi1, ListCFList & ppi2); |
---|
67 | bool same( const CFList &A, const CFList &B ); |
---|
68 | bool member( const CFList & cs, const ListCFList & pi ); |
---|
69 | bool subset( const CFList &PS, const CFList &CS ); |
---|
70 | ListCFList MyUnion( const ListCFList & a, const ListCFList &b ); |
---|
71 | ListCFList MyDifference( const ListCFList & a, const CFList &b); |
---|
72 | ListCFList Minus( const ListCFList & a, const ListCFList &b); |
---|
73 | #endif /* INCL_CSUTIL_H */ |
---|
74 | |
---|
75 | //////////////////////////////////////////////////////////// |
---|
76 | /* |
---|
77 | $Log: not supported by cvs2svn $ |
---|
78 | Revision 1.3 1997/04/25 22:51:48 michael |
---|
79 | Version for libfac-0.2.1 |
---|
80 | |
---|
81 | */ |
---|