Loading...
Searching...
No Matches
cf_algorithm.h
Go to the documentation of this file.
/* emacs edit mode for this file is -*- C++ -*- */
/**
* @file cf_algorithm.h
* declarations of higher level algorithms.
*
* Header file corresponds to: cf_algorithm.cc, cf_chinese.cc,
* cf_factor.cc, cf_linsys.cc, cf_resultant.cc
*
* Hierarchy: mathematical algorithms on canonical forms
*
* Developers note:
* ----------------
* This header file collects declarations of most of the
* functions in Factory which implement higher level algorithms
* on canonical forms (factorization, gcd, etc.) and declarations
* of some low level mathematical functions, too (absolute value,
* euclidean norm, etc.).
*
**/
#ifndef INCL_CF_ALGORITHM_H
#define INCL_CF_ALGORITHM_H
// #include "config.h"
#include "canonicalform.h"
#include "variable.h"
/*BEGINPUBLIC*/
//{{{ function declarations from cf_algorithm.cc
CanonicalForm psr ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
CanonicalForm psq ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
void psqr ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & q, CanonicalForm & r, const Variable & x );
CanonicalForm FACTORY_PUBLIC bCommonDen ( const CanonicalForm & f );
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g );
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm& quot );
bool tryFdivides ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm& M, bool& fail );
CanonicalForm maxNorm ( const CanonicalForm & f );
CanonicalForm euclideanNorm ( const CanonicalForm & f );
//}}}
//{{{ function declarations from cf_chinese.cc
void FACTORY_PUBLIC chineseRemainder ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew );
void FACTORY_PUBLIC chineseRemainder ( const CFArray & x, const CFArray & q, CanonicalForm & xnew, CanonicalForm & qnew );
void FACTORY_PUBLIC chineseRemainderCached ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew, CFArray &inv );
void FACTORY_PUBLIC chineseRemainderCached(const CFArray &a, const CFArray &n, CanonicalForm &xnew, CanonicalForm &prod, CFArray &inv);
CanonicalForm Farey ( const CanonicalForm & f, const CanonicalForm & q );
//}}}
//{{{ function declarations from cf_factor.cc
EXTERN_VAR int singular_homog_flag;
bool isPurePoly(const CanonicalForm & f);
bool isPurePoly_m(const CanonicalForm & f);
CFFList FACTORY_PUBLIC factorize ( const CanonicalForm & f, bool issqrfree = false );
CFFList FACTORY_PUBLIC factorize ( const CanonicalForm & f, const Variable & alpha );
CFFList FACTORY_PUBLIC sqrFree ( const CanonicalForm & f, bool sort= false );
CanonicalForm homogenize( const CanonicalForm & f, const Variable & x);
CanonicalForm homogenize( const CanonicalForm & f, const Variable & x,
const Variable & v1, const Variable & v2);
Variable get_max_degree_Variable(const CanonicalForm & f);
CFList get_Terms( const CanonicalForm & f );
void getTerms( const CanonicalForm & f, const CanonicalForm & t, CFList & result );
//}}}
//{{{ function declarations from cf_linsys.cc
bool linearSystemSolve ( CFMatrix & M );
CanonicalForm FACTORY_PUBLIC determinant ( const CFMatrix & M, int n );
//}}}
//{{{ function declarations from cf_resultant.cc
CFArray subResChain ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
CanonicalForm FACTORY_PUBLIC resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
//}}}
/** inline CanonicalForm abs ( const CanonicalForm & f )
*
* abs() - return absolute value of `f'.
*
* The absolute value is defined in terms of the function
* `sign()'. If it reports negative sign for `f' than -`f' is
* returned, otherwise `f'.
*
* This behaviour is most useful for integers and rationals. But
* it may be used to sign-normalize the leading coefficient of
* arbitrary polynomials, too.
*
* Type info:
* ----------
* f: CurrentPP
*
**/
inline CanonicalForm
abs ( const CanonicalForm & f )
{
// it is not only more general to use `sign()' instead of a
// direct comparison `f < 0', it is faster, too
if ( sign( f ) < 0 )
return -f;
else
return f;
}
//}}}
/*ENDPUBLIC*/
#endif /* ! INCL_CF_ALGORITHM_H */
abs
Rational abs(const Rational &a)
Definition GMPrat.cc:436
canonicalform.h
Header for factory's main class CanonicalForm.
CFArray
Array< CanonicalForm > CFArray
Definition canonicalform.h:397
CFMatrix
Matrix< CanonicalForm > CFMatrix
Definition canonicalform.h:398
CFFList
List< CFFactor > CFFList
Definition canonicalform.h:393
CFList
List< CanonicalForm > CFList
Definition canonicalform.h:395
x
Variable x
Definition cfModGcd.cc:4090
g
g
Definition cfModGcd.cc:4098
sort
static void sort(int **points, int sizePoints)
Definition cfNewtonPolygon.cc:100
get_max_degree_Variable
Variable get_max_degree_Variable(const CanonicalForm &f)
get_max_degree_Variable returns Variable with highest degree.
Definition cf_factor.cc:264
isPurePoly
bool isPurePoly(const CanonicalForm &f)
Definition cf_factor.cc:248
isPurePoly_m
bool isPurePoly_m(const CanonicalForm &f)
Definition cf_factor.cc:238
psqr
void psqr(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &q, CanonicalForm &r, const Variable &x)
determinant
CanonicalForm FACTORY_PUBLIC determinant(const CFMatrix &M, int n)
Definition cf_linsys.cc:222
Farey
CanonicalForm Farey(const CanonicalForm &f, const CanonicalForm &q)
Farey rational reconstruction.
Definition cf_chinese.cc:202
sqrFree
CFFList FACTORY_PUBLIC sqrFree(const CanonicalForm &f, bool sort=false)
squarefree factorization
Definition cf_factor.cc:961
getTerms
void getTerms(const CanonicalForm &f, const CanonicalForm &t, CFList &result)
get_Terms: Split the polynomial in the containing terms.
Definition cf_factor.cc:283
get_Terms
CFList get_Terms(const CanonicalForm &f)
Definition cf_factor.cc:293
subResChain
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
maxNorm
CanonicalForm maxNorm(const CanonicalForm &f)
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g )
Definition cf_algorithm.cc:536
bCommonDen
CanonicalForm FACTORY_PUBLIC bCommonDen(const CanonicalForm &f)
void psqr ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & q, CanonicalForm & r,...
Definition cf_algorithm.cc:293
fdivides
bool fdivides(const CanonicalForm &f, const CanonicalForm &g)
chineseRemainder
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
tryFdivides
bool tryFdivides(const CanonicalForm &f, const CanonicalForm &g, const CanonicalForm &M, bool &fail)
psr
CanonicalForm psr(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
homogenize
CanonicalForm homogenize(const CanonicalForm &f, const Variable &x)
homogenize homogenizes f with Variable x
Definition cf_factor.cc:317
linearSystemSolve
bool linearSystemSolve(CFMatrix &M)
Definition cf_linsys.cc:78
psq
CanonicalForm psq(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
cf_algorithm.cc - simple mathematical algorithms.
Definition cf_algorithm.cc:172
singular_homog_flag
EXTERN_VAR int singular_homog_flag
Definition cf_algorithm.h:65
euclideanNorm
CanonicalForm euclideanNorm(const CanonicalForm &f)
factorize
CFFList FACTORY_PUBLIC factorize(const CanonicalForm &f, bool issqrfree=false)
factorization over or
Definition cf_factor.cc:409
chineseRemainderCached
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
resultant
CanonicalForm FACTORY_PUBLIC resultant(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CanonicalForm resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ).
Definition cf_resultant.cc:173
f
FILE * f
Definition checklibs.c:9
CanonicalForm
factory's main class
Definition canonicalform.h:86
Variable
factory's class for variables
Definition factory.h:127
alpha
Variable alpha
Definition facAbsBiFact.cc:52
result
return result
Definition facAbsBiFact.cc:76
prod
fq_nmod_poly_t prod
Definition facHensel.cc:100
EXTERN_VAR
#define EXTERN_VAR
Definition globaldefs.h:6
FACTORY_PUBLIC
#define FACTORY_PUBLIC
Definition globaldefs.h:25
sign
static int sign(int x)
Definition ring.cc:3504
M
#define M
Definition sirandom.c:25
variable.h
operations on variables