Loading...
Searching...
No Matches
facFqFactorizeUtil.h
Go to the documentation of this file.
/*****************************************************************************\
* Computer Algebra System SINGULAR
\*****************************************************************************/
/** @file facFqFactorizeUtil.h
*
* This file provides utility functions for multivariate factorization
*
* @author Martin Lee
*
**/
/*****************************************************************************/
#ifndef FAC_FQ_FACTORIZE_UTIL_H
#define FAC_FQ_FACTORIZE_UTIL_H
// #include "config.h"
#include "canonicalform.h"
#include "cf_map.h"
/// append @a factors2 to @a factors1 and decompress
///
static inline
void decompressAppend (CFList& factors1, ///< [in,out] a list of polys,
///< returns @a factors2 appended
///< to it and everything is
///< decompressed
const CFList& factors2, ///< [in] a list of polys
const CFMap& N ///< [in] a map
)
{
for (CFListIterator i= factors1; i.hasItem(); i++)
i.getItem()= N (i.getItem());
for (CFListIterator i= factors2; i.hasItem(); i++)
factors1.append (N (i.getItem()));
}
/// swap elements in @a factors2 and append them to @a factors1
///
void appendSwap (CFList& factors1, ///< [in,out] a list of polys,
///< returns swapped elements of @a
///< factors2 appended to it
const CFList& factors2, ///< [in] a list of polys
const int swapLevel1, ///< [in] level of variable to be
///< swapped with x, 0 if no swapping
const int swapLevel2, ///< [in] level of variable to be
///< swapped with x, 0 if no swapping
const Variable& x ///< [in] a variable
);
/// swap elements in @a factors
void swap (CFList& factors, ///< [in] a list of polys, returns swapped
///< elements of factors
const int swapLevel1, ///< [in] level of variable to be
///< swapped with x, 0 if no swapping
const int swapLevel2, ///< [in] level of variable to be
///< swapped with x, 0 if no swapping
const Variable& x ///< [in] a variable
);
/// swap elements of @a factors2, append them to @a factors1 and decompress
void appendSwapDecompress (
CFList& factors1, ///< [in,out] a list of polys,
///< returns swapped elements of @a
///< factors2 appended to it and
///< everything is decompressed
const CFList& factors2, ///< [in] a list of polys
const CFMap& N, ///< [in] a map
const int swapLevel, ///< [in] level of variable to be
///< swapped with x, 0 if no swapping
const Variable& x ///< [in] a variable
);
/// swap elements of @a factors2, append them to @a factors1 and decompress
void appendSwapDecompress (
CFList& factors1, ///< [in,out] a list of polys,
///< returns swapped elements of @a
///< factors2 appended to it and
///< everything is decompressed
const CFList& factors2, ///< [in] a list of polys
const CFMap& N, ///< [in] a map
const int swapLevel1, ///< [in] level of variable to be
///< swapped with x, 0 if no swapping
const int swapLevel2, ///< [in] level of variable to be
///< swapped with x, 0 if no swapping
const Variable& x ///< [in] a variable
);
/// compute lifting bounds
///
/// @return @a liftingBounds returns an array containing the lift bounds for A
int* liftingBounds (const CanonicalForm& A, ///< [in] a compressed poly
const int& bivarLiftBound ///< [in] lift bound for
///< @a biFactorizer()
);
/// shift evaluation point to zero
/// @return @a shift2Zero returns @a F shifted by @a evaluation s.t. 0 is a
/// valid evaluation point
/// @sa evalPoints(), reverseShift()
CanonicalForm
shift2Zero (const CanonicalForm& F, ///< [in] a compressed poly
CFList& Feval, ///< [in,out] an empty list, returns
///< @a F successively evaluated
///< at 0
const CFList& evaluation,///< [in] a valid evaluation point
int l= 2 ///< [in] level at which the evaluation
///< starts
);
/// reverse shifting the evaluation point to zero
///
/// @return @a reverseShift returns a poly whose shift to zero is reversed
/// @sa shift2Zero(), evalPoints()
CanonicalForm reverseShift (const CanonicalForm& F, ///< [in] a compressed poly
const CFList& evaluation,///< [in] a valid
///< evaluation point
int l= 2 ///< [in] level at which
///< the evaluation starts
);
/// check if @a F consists of more than just the leading coeff wrt. Variable (1)
///
/// @return as described above
bool isOnlyLeadingCoeff (const CanonicalForm& F ///< [in] some poly
);
/// sort CFFList by the number variables in a factor
CFFList sortCFFListByNumOfVars (CFFList & F ///< [in,out] a list of factors
);
/// like getVars but each variable x occuring in @a F is raised to x^degree (F,x)
CanonicalForm myGetVars (const CanonicalForm& F ///< [in] a polynomial
);
/// evaluate @a F at @a evaluation
///
/// @return @a evaluateAtEval returns a list containing the successive
/// evaluations of @a F, last entry is @a F again
CFList
evaluateAtEval (const CanonicalForm& F, ///<[in] some poly
const CFArray& evaluation ///<[in] some evaluation point
);
/// evaluate @a F at @a evaluation
///
/// @return @a evaluateAtEval returns a list containing the successive
/// evaluations of @a F starting at level @a l, last entry is @a F again
CFList
evaluateAtEval (const CanonicalForm& F, ///<[in] some poly
const CFList& evaluation,///<[in] some evaluation point
int l ///<[in] level to start at
);
/// evaluate F successively n-2 at 0
///
/// @return returns a list of successive evaluations of F, ending with F
CFList evaluateAtZero (const CanonicalForm& F ///< [in] some poly
);
/// divides factors by their content wrt. Variable(1) and checks if these polys
/// divide F
///
/// @return returns factors of F
CFList recoverFactors (const CanonicalForm& F, ///< [in] some poly F
const CFList& factors ///< [in] some list of
///< factor candidates
);
/// divides factors shifted by evaluation by their content wrt. Variable(1) and
/// checks if these polys divide F
///
/// @return returns factors of F
CFList recoverFactors (const CanonicalForm& F, ///< [in] some poly F
const CFList& factors, ///< [in] some list of
///< factor candidates
const CFList& evaluation ///< [in] evaluation point
);
/// checks if factors divide F, if so F is divided by this factor and the factor
/// is divided by its content wrt. Variable(1) and the entry in index at the
/// position of the factor is set to 1, otherwise the entry in index is set to 0
///
/// @return returns factors of F
CFList recoverFactors (CanonicalForm& F, ///< [in,out] some poly F
const CFList& factors,///< [in] some list of
///< factor candidates
int* index ///< [in] position of real factors
);
#endif
/* FAC_FQ_FACTORIZE_UTIL_H */
swap
#define swap(_i, _j)
canonicalform.h
Header for factory's main class CanonicalForm.
CFArray
Array< CanonicalForm > CFArray
Definition canonicalform.h:397
CFListIterator
ListIterator< CanonicalForm > CFListIterator
Definition canonicalform.h:396
CFFList
List< CFFactor > CFFList
Definition canonicalform.h:393
CFList
List< CanonicalForm > CFList
Definition canonicalform.h:395
N
const CanonicalForm CFMap CFMap & N
Definition cfEzgcd.cc:56
l
int l
Definition cfEzgcd.cc:100
i
int i
Definition cfEzgcd.cc:132
x
Variable x
Definition cfModGcd.cc:4090
cf_map.h
map polynomials
CFMap
class CFMap
Definition cf_map.h:85
CanonicalForm
factory's main class
Definition canonicalform.h:86
List::append
void append(const T &)
Definition ftmpl_list.cc:256
Variable
factory's class for variables
Definition factory.h:127
evaluation
const CanonicalForm int const CFList & evaluation
Definition facAbsFact.cc:52
Feval
CanonicalForm Feval
Definition facAbsFact.cc:60
factors2
const CFList & factors2
Definition facFqBivarUtil.cc:42
recoverFactors
CFList recoverFactors(const CanonicalForm &F, const CFList &factors)
divides factors by their content wrt. Variable(1) and checks if these polys divide F
Definition facFqFactorizeUtil.cc:238
reverseShift
CanonicalForm reverseShift(const CanonicalForm &F, const CFList &evaluation, int l=2)
reverse shifting the evaluation point to zero
Definition facFqFactorizeUtil.cc:148
decompressAppend
static void decompressAppend(CFList &factors1, const CFList &factors2, const CFMap &N)
append factors2 to factors1 and decompress
Definition facFqFactorizeUtil.h:23
evaluateAtEval
CFList evaluateAtEval(const CanonicalForm &F, const CFArray &evaluation)
evaluate F at evaluation
Definition facFqFactorizeUtil.cc:206
shift2Zero
CanonicalForm shift2Zero(const CanonicalForm &F, CFList &Feval, const CFList &evaluation, int l=2)
shift evaluation point to zero
Definition facFqFactorizeUtil.cc:131
appendSwapDecompress
void appendSwapDecompress(CFList &factors1, const CFList &factors2, const CFMap &N, const int swapLevel, const Variable &x)
swap elements of factors2, append them to factors1 and decompress
Definition facFqFactorizeUtil.cc:69
liftingBounds
int * liftingBounds(const CanonicalForm &A, const int &bivarLiftBound)
compute lifting bounds
Definition facFqFactorizeUtil.cc:118
evaluateAtZero
CFList evaluateAtZero(const CanonicalForm &F)
evaluate F successively n-2 at 0
Definition facFqFactorizeUtil.cc:193
isOnlyLeadingCoeff
bool isOnlyLeadingCoeff(const CanonicalForm &F)
check if F consists of more than just the leading coeff wrt. Variable (1)
Definition facFqFactorizeUtil.cc:162
sortCFFListByNumOfVars
CFFList sortCFFListByNumOfVars(CFFList &F)
sort CFFList by the number variables in a factor
Definition facFqFactorizeUtil.cc:186
myGetVars
CanonicalForm myGetVars(const CanonicalForm &F)
like getVars but each variable x occuring in F is raised to x^degree (F,x)
Definition facFqFactorizeUtil.cc:168
appendSwap
void appendSwap(CFList &factors1, const CFList &factors2, const int swapLevel1, const int swapLevel2, const Variable &x)
swap elements in factors2 and append them to factors1
index
static int index(p_Length length, p_Ord ord)
Definition p_Procs_Impl.h:592
A
#define A
Definition sirandom.c:24