1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
2 | /* $Id: cf_algorithm.h,v 1.11 1998-06-30 16:31:24 schmidt Exp $ */ |
---|
3 | |
---|
4 | #ifndef INCL_CF_ALGORITHM_H |
---|
5 | #define INCL_CF_ALGORITHM_H |
---|
6 | |
---|
7 | //{{{ docu |
---|
8 | // |
---|
9 | // cf_algorithm.h - declarations of higher level algorithms. |
---|
10 | // |
---|
11 | // Header file corresponds to: cf_algorithms.cc, cf_chinese.cc, |
---|
12 | // cf_factor.cc, cf_linsys.cc, cf_resultant.cc |
---|
13 | // |
---|
14 | // Hierarchy: mathematical algorithms on canonical forms |
---|
15 | // |
---|
16 | // Developers note: |
---|
17 | // ---------------- |
---|
18 | // This header file collects declarations of most of the |
---|
19 | // functions in Factory which implement higher level algorithms |
---|
20 | // on canonical forms (factorization, gcd, etc.) and declarations |
---|
21 | // of some low level mathematical functions, too (absolute value, |
---|
22 | // euclidean norm, etc.). |
---|
23 | // |
---|
24 | //}}} |
---|
25 | |
---|
26 | #include <config.h> |
---|
27 | |
---|
28 | #include "canonicalform.h" |
---|
29 | #include "variable.h" |
---|
30 | |
---|
31 | /*BEGINPUBLIC*/ |
---|
32 | |
---|
33 | //{{{ function declarations from cf_algorithm.cc |
---|
34 | CanonicalForm psr ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ); |
---|
35 | |
---|
36 | CanonicalForm psq ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ); |
---|
37 | |
---|
38 | void psqr ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & q, CanonicalForm & r, const Variable & x ); |
---|
39 | |
---|
40 | CanonicalForm bCommonDen ( const CanonicalForm & f ); |
---|
41 | |
---|
42 | bool divides ( const CanonicalForm & f, const CanonicalForm & g ); |
---|
43 | |
---|
44 | CanonicalForm maxNorm ( const CanonicalForm & f ); |
---|
45 | |
---|
46 | CanonicalForm euclideanNorm ( const CanonicalForm & f ); |
---|
47 | //}}} |
---|
48 | |
---|
49 | //{{{ function declarations from cf_chinese.cc |
---|
50 | void chineseRemainder ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew ); |
---|
51 | |
---|
52 | void chineseRemainder ( const CFArray & x, const CFArray & q, CanonicalForm & xnew, CanonicalForm & qnew ); |
---|
53 | //}}} |
---|
54 | |
---|
55 | //{{{ function declarations from cf_factor.cc |
---|
56 | CFFList factorize ( const CanonicalForm & f, bool issqrfree = false ); |
---|
57 | |
---|
58 | CFFList factorize ( const CanonicalForm & f, const Variable & alpha ); |
---|
59 | |
---|
60 | CFFList sqrFree ( const CanonicalForm & f, bool sort = false ); |
---|
61 | |
---|
62 | bool isSqrFree ( const CanonicalForm & f ); |
---|
63 | //}}} |
---|
64 | |
---|
65 | //{{{ function declarations from cf_linsys.cc |
---|
66 | bool linearSystemSolve ( CFMatrix & M ); |
---|
67 | |
---|
68 | CanonicalForm determinant ( const CFMatrix & M, int n ); |
---|
69 | //}}} |
---|
70 | |
---|
71 | //{{{ function declarations from cf_resultant.cc |
---|
72 | CFArray subResChain ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ); |
---|
73 | |
---|
74 | CanonicalForm resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ); |
---|
75 | //}}} |
---|
76 | |
---|
77 | //{{{ inline CanonicalForm abs ( const CanonicalForm & f ) |
---|
78 | //{{{ docu |
---|
79 | // |
---|
80 | // abs() - return absolute value of `f'. |
---|
81 | // |
---|
82 | // The absolute value is defined in terms of the function |
---|
83 | // `sign()'. If it reports negative sign for `f' than -`f' is |
---|
84 | // returned, otherwise `f'. |
---|
85 | // |
---|
86 | // This behaviour is most useful for integers and rationals. But |
---|
87 | // it may be used to sign-normalize the leading coefficient of |
---|
88 | // arbitrary polynomials, too. |
---|
89 | // |
---|
90 | // Type info: |
---|
91 | // ---------- |
---|
92 | // f: CurrentPP |
---|
93 | // |
---|
94 | //}}} |
---|
95 | inline CanonicalForm |
---|
96 | abs ( const CanonicalForm & f ) |
---|
97 | { |
---|
98 | // it is not only more general to use `sign()' instead of a |
---|
99 | // direct comparison `f < 0', it is faster, too |
---|
100 | if ( sign( f ) < 0 ) |
---|
101 | return -f; |
---|
102 | else |
---|
103 | return f; |
---|
104 | } |
---|
105 | //}}} |
---|
106 | |
---|
107 | /*ENDPUBLIC*/ |
---|
108 | |
---|
109 | #endif /* ! INCL_CF_ALGORITHM_H */ |
---|