My Project
cf_algorithm.h
Go to the documentation of this file.
1 /* emacs edit mode for this file is -*- C++ -*- */
2 
3 /**
4  * @file cf_algorithm.h
5  * declarations of higher level algorithms.
6  *
7  * Header file corresponds to: cf_algorithm.cc, cf_chinese.cc,
8  * cf_factor.cc, cf_linsys.cc, cf_resultant.cc
9  *
10  * Hierarchy: mathematical algorithms on canonical forms
11  *
12  * Developers note:
13  * ----------------
14  * This header file collects declarations of most of the
15  * functions in Factory which implement higher level algorithms
16  * on canonical forms (factorization, gcd, etc.) and declarations
17  * of some low level mathematical functions, too (absolute value,
18  * euclidean norm, etc.).
19  *
20 **/
21 
22 #ifndef INCL_CF_ALGORITHM_H
23 #define INCL_CF_ALGORITHM_H
24 
25 // #include "config.h"
26 
27 #include "canonicalform.h"
28 #include "variable.h"
29 
30 /*BEGINPUBLIC*/
31 
32 //{{{ function declarations from cf_algorithm.cc
33 CanonicalForm psr ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
34 
35 CanonicalForm psq ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
36 
37 void psqr ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & q, CanonicalForm & r, const Variable & x );
38 
40 
41 bool fdivides ( const CanonicalForm & f, const CanonicalForm & g );
42 
43 bool fdivides ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm& quot );
44 
45 bool tryFdivides ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm& M, bool& fail );
46 
48 
50 //}}}
51 
52 //{{{ function declarations from cf_chinese.cc
53 void FACTORY_PUBLIC chineseRemainder ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew );
54 
55 void FACTORY_PUBLIC chineseRemainder ( const CFArray & x, const CFArray & q, CanonicalForm & xnew, CanonicalForm & qnew );
56 
57 void FACTORY_PUBLIC chineseRemainderCached ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew, CFArray &inv );
59 
60 
61 CanonicalForm Farey ( const CanonicalForm & f, const CanonicalForm & q );
62 //}}}
63 
64 //{{{ function declarations from cf_factor.cc
66 
67 bool isPurePoly(const CanonicalForm & f);
68 
69 bool isPurePoly_m(const CanonicalForm & f);
70 
71 CFFList FACTORY_PUBLIC factorize ( const CanonicalForm & f, bool issqrfree = false );
72 
74 
75 CFFList FACTORY_PUBLIC sqrFree ( const CanonicalForm & f, bool sort= false );
76 
79  const Variable & v1, const Variable & v2);
81 CFList get_Terms( const CanonicalForm & f );
82 void getTerms( const CanonicalForm & f, const CanonicalForm & t, CFList & result );
83 
84 
85 //}}}
86 
87 //{{{ function declarations from cf_linsys.cc
88 bool linearSystemSolve ( CFMatrix & M );
89 
91 //}}}
92 
93 //{{{ function declarations from cf_resultant.cc
94 CFArray subResChain ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
95 
97 //}}}
98 
99 /** inline CanonicalForm abs ( const CanonicalForm & f )
100  *
101  * abs() - return absolute value of `f'.
102  *
103  * The absolute value is defined in terms of the function
104  * `sign()'. If it reports negative sign for `f' than -`f' is
105  * returned, otherwise `f'.
106  *
107  * This behaviour is most useful for integers and rationals. But
108  * it may be used to sign-normalize the leading coefficient of
109  * arbitrary polynomials, too.
110  *
111  * Type info:
112  * ----------
113  * f: CurrentPP
114  *
115 **/
116 inline CanonicalForm
117 abs ( const CanonicalForm & f )
118 {
119  // it is not only more general to use `sign()' instead of a
120  // direct comparison `f < 0', it is faster, too
121  if ( sign( f ) < 0 )
122  return -f;
123  else
124  return f;
125 }
126 //}}}
127 
128 /*ENDPUBLIC*/
129 
130 #endif /* ! INCL_CF_ALGORITHM_H */
Header for factory's main class CanonicalForm.
Variable x
Definition: cfModGcd.cc:4084
g
Definition: cfModGcd.cc:4092
Variable get_max_degree_Variable(const CanonicalForm &f)
get_max_degree_Variable returns Variable with highest degree.
Definition: cf_factor.cc:260
bool isPurePoly(const CanonicalForm &f)
Definition: cf_factor.cc:244
bool isPurePoly_m(const CanonicalForm &f)
Definition: cf_factor.cc:234
void psqr(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &q, CanonicalForm &r, const Variable &x)
void psqr ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & q, CanonicalForm & r,...
CanonicalForm FACTORY_PUBLIC determinant(const CFMatrix &M, int n)
Definition: cf_linsys.cc:222
CanonicalForm Farey(const CanonicalForm &f, const CanonicalForm &q)
Farey rational reconstruction.
Definition: cf_chinese.cc:202
CFFList FACTORY_PUBLIC sqrFree(const CanonicalForm &f, bool sort=false)
squarefree factorization
Definition: cf_factor.cc:946
void getTerms(const CanonicalForm &f, const CanonicalForm &t, CFList &result)
get_Terms: Split the polynomial in the containing terms.
Definition: cf_factor.cc:279
CFList get_Terms(const CanonicalForm &f)
Definition: cf_factor.cc:289
CFArray subResChain(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CFArray subResChain ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x )
Definition: cf_resultant.cc:42
CanonicalForm maxNorm(const CanonicalForm &f)
CanonicalForm maxNorm ( const CanonicalForm & f )
CanonicalForm FACTORY_PUBLIC bCommonDen(const CanonicalForm &f)
CanonicalForm bCommonDen ( const CanonicalForm & f )
bool fdivides(const CanonicalForm &f, const CanonicalForm &g)
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g )
void FACTORY_PUBLIC chineseRemainder(const CanonicalForm &x1, const CanonicalForm &q1, const CanonicalForm &x2, const CanonicalForm &q2, CanonicalForm &xnew, CanonicalForm &qnew)
void chineseRemainder ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2,...
Definition: cf_chinese.cc:57
bool tryFdivides(const CanonicalForm &f, const CanonicalForm &g, const CanonicalForm &M, bool &fail)
same as fdivides but handles zero divisors in Z_p[t]/(f)[x1,...,xn] for reducible f
CanonicalForm abs(const CanonicalForm &f)
inline CanonicalForm abs ( const CanonicalForm & f )
Definition: cf_algorithm.h:117
CanonicalForm psr(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CanonicalForm psr ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x )
CanonicalForm homogenize(const CanonicalForm &f, const Variable &x)
homogenize homogenizes f with Variable x
Definition: cf_factor.cc:313
bool linearSystemSolve(CFMatrix &M)
Definition: cf_linsys.cc:78
CanonicalForm psq(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CanonicalForm psq ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x )
EXTERN_VAR int singular_homog_flag
Definition: cf_algorithm.h:65
CanonicalForm euclideanNorm(const CanonicalForm &f)
CanonicalForm euclideanNorm ( const CanonicalForm & f )
CFFList FACTORY_PUBLIC factorize(const CanonicalForm &f, bool issqrfree=false)
factorization over or
Definition: cf_factor.cc:405
void FACTORY_PUBLIC chineseRemainderCached(const CanonicalForm &x1, const CanonicalForm &q1, const CanonicalForm &x2, const CanonicalForm &q2, CanonicalForm &xnew, CanonicalForm &qnew, CFArray &inv)
Definition: cf_chinese.cc:308
CanonicalForm FACTORY_PUBLIC resultant(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CanonicalForm resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x )
FILE * f
Definition: checklibs.c:9
factory's main class
Definition: canonicalform.h:86
factory's class for variables
Definition: factory.h:134
Variable alpha
Definition: facAbsBiFact.cc:51
return result
Definition: facAbsBiFact.cc:75
fq_nmod_poly_t prod
Definition: facHensel.cc:100
void sort(CFArray &A, int l=0)
quick sort A
#define EXTERN_VAR
Definition: globaldefs.h:6
#define FACTORY_PUBLIC
Definition: globaldefs.h:25
static int sign(int x)
Definition: ring.cc:3380
#define M
Definition: sirandom.c:25
operations on variables