source: git/factory/cf_algorithm.h @ b1dfaf

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