source: git/factory/cf_algorithm.h @ 041dbdc

spielwiese
Last change on this file since 041dbdc was 041dbdc, checked in by Jens Schmidt <schmidt@…>, 26 years ago
* cf_algorithm.cc (cden, common_den): renamed to `internalBCommonDen()' and `bCommonDen()', resp. Declarations adapted. All references changed. * cf_algorithm.h (abs): function `abs()' moved from `canonicalform.h' to `cf_algorithm.h'. All referring files include `cf_algorithm.h'. * cf_algorithm.cc (maxNorm, euclideanNorm): new functions. Declarations added. git-svn-id: file:///usr/local/Singular/svn/trunk@1215 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.0 KB
Line 
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
32CanonicalForm psr ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
33
34CanonicalForm psq ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
35
36void psqr ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & q, CanonicalForm & r, const Variable & x );
37
38CanonicalForm bCommonDen ( const CanonicalForm & f );
39
40bool divides ( const CanonicalForm & f, const CanonicalForm & g );
41
42CanonicalForm maxNorm ( const CanonicalForm & f );
43
44CanonicalForm euclideanNorm ( const CanonicalForm & f );
45//}}}
46
47//{{{ function declarations from cf_chinese.cc
48void chineseRemainder ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew );
49
50void chineseRemainder ( const CFArray & x, const CFArray & q, CanonicalForm & xnew, CanonicalForm & qnew );
51//}}}
52
53//{{{ function declarations from cf_factor.cc
54CFFList factorize ( const CanonicalForm & f, bool issqrfree = false );
55
56CFFList factorize ( const CanonicalForm & f, const Variable & alpha );
57
58CFFList sqrFree ( const CanonicalForm & f, bool sort = false );
59
60bool isSqrFree ( const CanonicalForm & f );
61//}}}
62
63//{{{ function declarations from cf_linsys.cc
64bool linearSystemSolve ( CFMatrix & M );
65
66CanonicalForm determinant ( const CFMatrix & M, int n );
67//}}}
68
69//{{{ function declarations from cf_resultant.cc
70CFArray subResChain ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
71
72CanonicalForm 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//}}}
89inline CanonicalForm
90abs ( 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 */
Note: See TracBrowser for help on using the repository browser.