source: git/factory/cf_algorithm.h @ 3ace5b6

spielwiese
Last change on this file since 3ace5b6 was 362fc67, checked in by Martin Lee <martinlee84@…>, 12 years ago
chg: remove $Id$
  • Property mode set to 100644
File size: 3.9 KB
RevLine 
[8c8415]1/* emacs edit mode for this file is -*- C++ -*- */
2
3#ifndef INCL_CF_ALGORITHM_H
4#define INCL_CF_ALGORITHM_H
5
6//{{{ docu
7//
8// cf_algorithm.h - declarations of higher level algorithms.
9//
[b16644]10// Header file corresponds to: cf_algorithms.cc, cf_chinese.cc,
11//   cf_factor.cc, cf_linsys.cc, cf_resultant.cc
12//
13// Hierarchy: mathematical algorithms on canonical forms
14//
15// Developers note:
16// ----------------
[8c8415]17// This header file collects declarations of most of the
[b16644]18// functions in Factory which implement higher level algorithms
[041dbdc]19// on canonical forms (factorization, gcd, etc.) and declarations
[b16644]20// of some low level mathematical functions, too (absolute value,
[041dbdc]21// euclidean norm, etc.).
[8c8415]22//
23//}}}
24
[e4fe2b]25// #include "config.h"
[8c8415]26
27#include "canonicalform.h"
[e56537]28#include "variable.h"
[8c8415]29
30/*BEGINPUBLIC*/
31
[38eab60]32//{{{ function declarations from cf_algorithm.cc
[d482ee]33CanonicalForm psr ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
34
35CanonicalForm psq ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
36
37void psqr ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & q, CanonicalForm & r, const Variable & x );
38
[041dbdc]39CanonicalForm bCommonDen ( const CanonicalForm & f );
[0d1712]40
[ebc602]41bool fdivides ( const CanonicalForm & f, const CanonicalForm & g );
[041dbdc]42
[21b8f4c]43bool fdivides ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm& quot );
44
[42281d6]45bool tryFdivides ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm& M, bool& fail );
46
[041dbdc]47CanonicalForm maxNorm ( const CanonicalForm & f );
48
49CanonicalForm euclideanNorm ( const CanonicalForm & f );
[d482ee]50//}}}
51
[38eab60]52//{{{ function declarations from cf_chinese.cc
[c2b784]53void chineseRemainder ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew );
[8c8415]54
[d482ee]55void chineseRemainder ( const CFArray & x, const CFArray & q, CanonicalForm & xnew, CanonicalForm & qnew );
[6f62c3]56
57CanonicalForm Farey ( const CanonicalForm & f, const CanonicalForm & q );
[8c8415]58//}}}
59
[38eab60]60//{{{ function declarations from cf_factor.cc
[fbbb08]61extern int singular_homog_flag;
62
[e5102c]63bool isPurePoly(const CanonicalForm & f);
64
[6f62c3]65bool isPurePoly_m(const CanonicalForm & f);
66
[e56537]67CFFList factorize ( const CanonicalForm & f, bool issqrfree = false );
68
69CFFList factorize ( const CanonicalForm & f, const Variable & alpha );
70
[f78374]71CFFList sqrFree ( const CanonicalForm & f, bool sort= false );
[e56537]72
73bool isSqrFree ( const CanonicalForm & f );
[dad0bc5]74
75CanonicalForm homogenize( const CanonicalForm & f, const Variable & x);
[a38d45]76CanonicalForm homogenize( const CanonicalForm & f, const Variable & x,
77                                const Variable & v1, const Variable & v2);
[dad0bc5]78Variable get_max_degree_Variable(const CanonicalForm & f);
79CFList get_Terms( const CanonicalForm & f );
80void getTerms( const CanonicalForm & f, const CanonicalForm & t, CFList & result );
81
82
[e56537]83//}}}
84
[38eab60]85//{{{ function declarations from cf_linsys.cc
[d482ee]86bool linearSystemSolve ( CFMatrix & M );
[9fb70b]87
[d482ee]88CanonicalForm determinant ( const CFMatrix & M, int n );
[9fb70b]89//}}}
90
[38eab60]91//{{{ function declarations from cf_resultant.cc
[2a9b48]92CFArray subResChain ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
93
[d482ee]94CanonicalForm resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
[f42ba19]95//}}}
96
[041dbdc]97//{{{ inline CanonicalForm abs ( const CanonicalForm & f )
98//{{{ docu
99//
100// abs() - return absolute value of `f'.
101//
102// The absolute value is defined in terms of the function
103// `sign()'.  If it reports negative sign for `f' than -`f' is
104// returned, otherwise `f'.
105//
[b16644]106// This behaviour is most useful for integers and rationals.  But
107// it may be used to sign-normalize the leading coefficient of
108// arbitrary polynomials, too.
109//
110// Type info:
111// ----------
112// f: CurrentPP
[041dbdc]113//
114//}}}
115inline CanonicalForm
116abs ( const CanonicalForm & f )
117{
[b16644]118    // it is not only more general to use `sign()' instead of a
119    // direct comparison `f < 0', it is faster, too
[041dbdc]120    if ( sign( f ) < 0 )
[6918d65]121        return -f;
[041dbdc]122    else
[6918d65]123        return f;
[041dbdc]124}
125//}}}
126
[8c8415]127/*ENDPUBLIC*/
128
129#endif /* ! INCL_CF_ALGORITHM_H */
Note: See TracBrowser for help on using the repository browser.