source: git/factory/cf_algorithm.h @ 6c5d86

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