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