source: git/factory/cf_algorithm.h @ e5102c

spielwiese
Last change on this file since e5102c was e5102c, checked in by Hans Schönemann <hannes@…>, 18 years ago
*hannes: isPurePoly git-svn-id: file:///usr/local/Singular/svn/trunk@9133 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.5 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id: cf_algorithm.h,v 1.13 2006-05-15 08:17:36 Singular 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
56bool isPurePoly(const CanonicalForm & f);
57
58CFFList factorize ( const CanonicalForm & f, bool issqrfree = false );
59
60CFFList factorize ( const CanonicalForm & f, const Variable & alpha );
61
62CFFList sqrFree ( const CanonicalForm & f, bool sort = false );
63
64bool isSqrFree ( const CanonicalForm & f );
65
66CanonicalForm homogenize( const CanonicalForm & f, const Variable & x);
67Variable get_max_degree_Variable(const CanonicalForm & f);
68CFList get_Terms( const CanonicalForm & f );
69void getTerms( const CanonicalForm & f, const CanonicalForm & t, CFList & result );
70
71
72//}}}
73
74//{{{ function declarations from cf_linsys.cc
75bool linearSystemSolve ( CFMatrix & M );
76
77CanonicalForm determinant ( const CFMatrix & M, int n );
78//}}}
79
80//{{{ function declarations from cf_resultant.cc
81CFArray subResChain ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
82
83CanonicalForm resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
84//}}}
85
86//{{{ inline CanonicalForm abs ( const CanonicalForm & f )
87//{{{ docu
88//
89// abs() - return absolute value of `f'.
90//
91// The absolute value is defined in terms of the function
92// `sign()'.  If it reports negative sign for `f' than -`f' is
93// returned, otherwise `f'.
94//
95// This behaviour is most useful for integers and rationals.  But
96// it may be used to sign-normalize the leading coefficient of
97// arbitrary polynomials, too.
98//
99// Type info:
100// ----------
101// f: CurrentPP
102//
103//}}}
104inline CanonicalForm
105abs ( const CanonicalForm & f )
106{
107    // it is not only more general to use `sign()' instead of a
108    // direct comparison `f < 0', it is faster, too
109    if ( sign( f ) < 0 )
110        return -f;
111    else
112        return f;
113}
114//}}}
115
116/*ENDPUBLIC*/
117
118#endif /* ! INCL_CF_ALGORITHM_H */
Note: See TracBrowser for help on using the repository browser.