 |
My Project
UNKNOWN_GIT_VERSION
|
Go to the source code of this file.
|
poly | singclap_gcd_r (poly f, poly g, const ring r) |
|
poly | singclap_gcd_and_divide (poly &f, poly &g, const ring r) |
| clears denominators of f and g, divides by gcd(f,g) More...
|
|
poly | singclap_resultant (poly f, poly g, poly x, const ring r) |
|
BOOLEAN | singclap_extgcd (poly f, poly g, poly &res, poly &pa, poly &pb, const ring r) |
|
poly | singclap_pmult (poly f, poly g, const ring r) |
|
poly | singclap_pdivide (poly f, poly g, const ring r) |
|
poly | singclap_pmod (poly f, poly g, const ring r) |
|
void | singclap_divide_content (poly f, const ring r) |
|
ideal | singclap_factorize (poly f, intvec **v, int with_exps, const ring r) |
|
ideal | singclap_sqrfree (poly f, intvec **v, int with_exps, const ring r) |
|
matrix | singntl_HNF (matrix A, const ring r) |
|
intvec * | singntl_HNF (intvec *A) |
|
bigintmat * | singntl_HNF (bigintmat *A) |
|
matrix | singntl_LLL (matrix A, const ring r) |
|
intvec * | singntl_LLL (intvec *A) |
|
ideal | singclap_absFactorize (poly f, ideal &mipos, intvec **exps, int &n, const ring r) |
|
matrix | singclap_irrCharSeries (ideal I, const ring r) |
|
char * | singclap_neworder (ideal I, const ring r) |
|
poly | singclap_det (const matrix m, const ring r) |
|
int | singclap_det_i (intvec *m, const ring r) |
|
number | singclap_det_bi (bigintmat *m, const coeffs cf) |
|
number | nChineseRemainder (number *x, number *q, int rl, const coeffs r) |
|
◆ nChineseRemainder()
number nChineseRemainder |
( |
number * |
x, |
|
|
number * |
q, |
|
|
int |
rl, |
|
|
const coeffs |
r |
|
) |
| |
◆ singclap_absFactorize()
ideal singclap_absFactorize |
( |
poly |
f, |
|
|
ideal & |
mipos, |
|
|
intvec ** |
exps, |
|
|
int & |
n, |
|
|
const ring |
r |
|
) |
| |
◆ singclap_det()
◆ singclap_det_bi()
◆ singclap_det_i()
◆ singclap_divide_content()
void singclap_divide_content |
( |
poly |
f, |
|
|
const ring |
r |
|
) |
| |
Definition at line 650 of file clapsing.cc.
680 int sz1=
n_Size(g1, r->cf);
681 int sz2=
n_Size(g2, r->cf);
714 while ( (
p !=
NULL) && (
g != 1) && (
g != 0))
723 if ((
g == 1 ) || (
g == 0))
◆ singclap_extgcd()
BOOLEAN singclap_extgcd |
( |
poly |
f, |
|
|
poly |
g, |
|
|
poly & |
res, |
|
|
poly & |
pa, |
|
|
poly & |
pb, |
|
|
const ring |
r |
|
) |
| |
Definition at line 421 of file clapsing.cc.
450 else if ( r->cf->extRing!=
NULL )
455 if (r->cf->extRing->qideal!=
NULL)
◆ singclap_factorize()
ideal singclap_factorize |
( |
poly |
f, |
|
|
intvec ** |
v, |
|
|
int |
with_exps, |
|
|
const ring |
r |
|
) |
| |
Definition at line 837 of file clapsing.cc.
842 #ifdef FACTORIZE2_DEBUG
870 if (with_exps==0) n++;
903 if (with_exps!=1) (**v)[n]=e;
968 else if ((r->cf->extRing!=
NULL)
973 if (r->cf->extRing->qideal!=
NULL)
1003 if ( ! L.
getFirst().factor().inCoeffDomain() )
1012 if ((with_exps==2)&&(n>1))
1022 if (with_exps!=1) (**v)[
j] = J.
getItem().exp();
1031 res->m[
j] = convFactoryGFSingGF( J.
getItem().factor() );
1033 else if (r->cf->extRing!=
NULL)
1039 if (r->cf->extRing->qideal==
NULL)
1067 if (r->cf->extRing!=
NULL)
1068 if (r->cf->extRing->qideal!=
NULL)
1077 #ifdef FACTORIZE2_DEBUG
1078 printf(
"factorize_retry\n");
1084 int l=(*v)->length();
1086 for(jj=0;jj<ww->
length();jj++)
1087 (**
v)[jj+
l]=(*ww)[jj];
1092 hh->m[jj]=
res->m[jj];
1108 WarnS(
"problem with factorize");
1172 (**v)[
j]=(*w)[
i];
j++;
1188 if (with_exps!=0) stop=0;
1194 else n_Delete(&old_lead_coeff,r->cf);
◆ singclap_gcd_and_divide()
poly singclap_gcd_and_divide |
( |
poly & |
f, |
|
|
poly & |
g, |
|
|
const ring |
r |
|
) |
| |
clears denominators of f and g, divides by gcd(f,g)
Definition at line 102 of file clapsing.cc.
181 else if ( r->cf->extRing )
185 if (r->cf->extRing->qideal!=
NULL)
◆ singclap_gcd_r()
poly singclap_gcd_r |
( |
poly |
f, |
|
|
poly |
g, |
|
|
const ring |
r |
|
) |
| |
Definition at line 42 of file clapsing.cc.
68 else if ( r->cf->extRing!=
NULL )
72 if (r->cf->extRing->qideal!=
NULL)
◆ singclap_irrCharSeries()
matrix singclap_irrCharSeries |
( |
ideal |
I, |
|
|
const ring |
r |
|
) |
| |
Definition at line 1448 of file clapsing.cc.
1509 for ( LLi = LL; LLi.
hasItem(); LLi++ )
1513 if ((
m!=0) && (n!=0))
break;
1515 if (tries>=5)
break;
1517 if ((
m==0) || (n==0))
1519 Warn(
"char_series returns %d x %d matrix from %d input polys (%d)",
1527 for (
m=1, LLi = LL; LLi.
hasItem(); LLi++,
m++ )
◆ singclap_neworder()
char* singclap_neworder |
( |
ideal |
I, |
|
|
const ring |
r |
|
) |
| |
Definition at line 1541 of file clapsing.cc.
1590 int cnt=
rVar(r)+offs;
1631 if (
s[strlen(
s)-1]==
',')
s[strlen(
s)-1]=
'\0';
◆ singclap_pdivide()
poly singclap_pdivide |
( |
poly |
f, |
|
|
poly |
g, |
|
|
const ring |
r |
|
) |
| |
Definition at line 556 of file clapsing.cc.
569 else if (r->cf->extRing!=
NULL)
573 if (r->cf->extRing->qideal!=
NULL)
589 #if 0 // not yet working
595 res = convFactoryGFSingGF( F /
G );
◆ singclap_pmod()
poly singclap_pmod |
( |
poly |
f, |
|
|
poly |
g, |
|
|
const ring |
r |
|
) |
| |
Definition at line 603 of file clapsing.cc.
616 else if (r->cf->extRing!=
NULL)
620 if (r->cf->extRing->qideal!=
NULL)
636 #if 0 // not yet working
642 res = convFactoryGFSingGF( F /
G );
◆ singclap_pmult()
poly singclap_pmult |
( |
poly |
f, |
|
|
poly |
g, |
|
|
const ring |
r |
|
) |
| |
Definition at line 509 of file clapsing.cc.
522 else if (r->cf->extRing!=
NULL)
526 if (r->cf->extRing->qideal!=
NULL)
542 #if 0 // not yet working
548 res = convFactoryGFSingGF( F *
G );
◆ singclap_resultant()
poly singclap_resultant |
( |
poly |
f, |
|
|
poly |
g, |
|
|
poly |
x, |
|
|
const ring |
r |
|
) |
| |
Definition at line 277 of file clapsing.cc.
284 WerrorS(
"3rd argument must be a ring variable");
285 goto resultant_returns_res;
288 goto resultant_returns_res;
299 goto resultant_returns_res;
302 else if (r->cf->extRing!=
NULL)
307 if (r->cf->extRing->qideal!=
NULL)
352 goto resultant_returns_res;
356 resultant_returns_res:
◆ singclap_sqrfree()
ideal singclap_sqrfree |
( |
poly |
f, |
|
|
intvec ** |
v, |
|
|
int |
with_exps, |
|
|
const ring |
r |
|
) |
| |
Definition at line 1215 of file clapsing.cc.
1219 #ifdef FACTORIZE2_DEBUG
1233 if (with_exps!=1 && with_exps!=3)
1247 if (with_exps==0 || with_exps==3) n++;
1272 if (with_exps!=1) (**v)[n]=e;
1293 if (with_exps==0 || with_exps==3)
1300 if (with_exps==0 || with_exps==3)
1312 if (with_exps==0 || with_exps==3)
1318 if (with_exps==0 || with_exps==3)
1332 else if (r->cf->extRing!=
NULL)
1336 if (r->cf->extRing->qideal!=
NULL)
1356 if (F.isUnivariate())
1378 if ((with_exps==2)&&(n>1))
1385 else if (L.
getFirst().factor().inCoeffDomain() && with_exps!=3)
1393 if (with_exps!=1 && with_exps!=3) (**v)[
j] = J.
getItem().exp();
1397 else if (r->cf->extRing!=
NULL)
1399 if (r->cf->extRing->qideal==
NULL)
1416 if (r->cf->extRing!=
NULL)
1417 if (r->cf->extRing->qideal!=
NULL)
1423 if (with_exps!=0 || with_exps==3) stop=0;
1428 if (with_exps==0 || with_exps==3)
p_SetCoeff(
res->m[0],old_lead_coeff,r);
1429 else n_Delete(&old_lead_coeff,r->cf);
◆ singntl_HNF() [1/3]
◆ singntl_HNF() [2/3]
◆ singntl_HNF() [3/3]
◆ singntl_LLL() [1/2]
◆ singntl_LLL() [2/2]
static int si_min(const int a, const int b)
static BOOLEAN rField_is_Zn(const ring r)
static const int SW_RATIONAL
set to 1 for computations over Q
void StringAppendS(const char *st)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
CFMatrix * cf_HNF(CFMatrix &A)
The input matrix A is an n x m matrix of rank m (so n >= m), and D is a multiple of the determinant o...
void p_Write0(poly p, ring lmRing, ring tailRing)
#define MATELEM(mat, i, j)
ideal singclap_factorize(poly f, intvec **v, int with_exps, const ring r)
CFAFList absFactorize(const CanonicalForm &G)
absolute factorization of a multivariate poly over Q
bigintmat * bimCopy(const bigintmat *b)
same as copy constructor - apart from it being able to accept NULL as input
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
poly convFactoryAPSingAP(const CanonicalForm &f, const ring r)
Variable rootOf(const CanonicalForm &, char name='@')
returns a symbolic root of polynomial with name name Use it to define algebraic variables
const CanonicalForm CFMap CFMap & N
static BOOLEAN rField_is_Zp_a(const ring r)
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define __p_Mult_nn(p, n, r)
CanonicalForm convSingAPFactoryAP(poly p, const Variable &a, const ring r)
CanonicalForm extgcd(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &a, CanonicalForm &b)
CanonicalForm extgcd ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & a,...
void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces)
set spaces to zero by default
static long pTotaldegree(poly p)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
static poly p_Copy(poly p, const ring r)
returns a copy of p
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static short rVar(const ring r)
#define rVar(r) (r->N)
intvec * ivCopy(const intvec *o)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
poly p_Sub(poly p1, poly p2, const ring r)
static BOOLEAN rField_is_Q_a(const ring r)
void idShow(const ideal id, const ring lmRing, const ring tailRing, const int debugPrint)
number n_convFactoryNSingN(const CanonicalForm n, const coeffs r)
void PrintS(const char *s)
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
CanonicalForm convSingTrPFactoryP(poly p, const ring r)
int convFactoryISingI(const CanonicalForm &f)
BOOLEAN count_Factors(ideal I, intvec *v, int j, poly &f, poly fac, const ring r)
static matrix mp_New(int r, int c)
poly p_Div_mm(poly p, const poly m, const ring r)
divide polynomial by monomial
static poly pp_Mult_qq(poly p, poly q, const ring r)
void prune(Variable &alpha)
void p_Write(poly p, ring lmRing, ring tailRing)
poly p_Cleardenom(poly p, const ring r)
CanonicalForm determinant(const CFMatrix &M, int n)
static int rPar(const ring r)
(r->cf->P)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
CFFList factorize(const CanonicalForm &f, bool issqrfree=false)
factorization over or
poly p_GcdMon(poly f, poly g, const ring r)
polynomial gcd for f=mon
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
matrix mpNew(int r, int c)
create a r x c zero-matrix
CanonicalForm n_convSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
CanonicalForm convSingPFactoryP(poly p, const ring r)
int p_IsPurePower(const poly p, const ring r)
return i, if head depends only on var(i)
#define IMATELEM(M, I, J)
CanonicalForm bCommonDen(const CanonicalForm &f)
CanonicalForm bCommonDen ( const CanonicalForm & f )
static void p_Delete(poly *p, const ring r)
static poly p_Add_q(poly p, poly q, const ring r)
static BOOLEAN rField_is_GF(const ring r)
static FORCE_INLINE number n_Invers(number a, const coeffs r)
return the multiplicative inverse of 'a'; raise an error if 'a' is not invertible
void StringSetS(const char *st)
factory's class for variables
static int si_max(const int a, const int b)
static const int SW_USE_EZGCD_P
set to 1 to use EZGCD over F_q
int pGetExp_Var(poly p, int i, const ring r)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
void Werror(const char *fmt,...)
ideal idInit(int idsize, int rank)
initialise an ideal / module
static number p_SetCoeff(poly p, number n, ring r)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
void WerrorS(const char *s)
CanonicalForm resultant(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CanonicalForm resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x )
static const int SW_SYMMETRIC_FF
set to 1 for symmetric representation over F_q
CFFList sqrFree(const CanonicalForm &f, bool sort=false)
squarefree factorization
#define BIMATELEM(M, I, J)
IntList neworderint(const CFList &PolyList)
const char feNotImplemented[]
std::pair< int, int > mark
static void p_Setm(poly p, const ring r)
poly convFactoryPSingTrP(const CanonicalForm &f, const ring r)
const Variable & v
< [in] a sqrfree bivariate poly
static long p_Totaldegree(poly p, const ring r)
static BOOLEAN p_IsConstantPoly(const poly p, const ring r)
static BOOLEAN p_IsConstant(const poly p, const ring r)
const CanonicalForm int s
CanonicalForm ndConvSingNFactoryN(number, BOOLEAN, const coeffs)
int status int void size_t count
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
static const int SW_USE_QGCD
set to 1 to use Encarnacion GCD over Q(a)
void p_Norm(poly p1, const ring r)
static poly p_Mult_q(poly p, poly q, const ring r)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
static FORCE_INLINE int n_Size(number n, const coeffs r)
return a non-negative measure for the complexity of n; return 0 only when n represents zero; (used fo...
static BOOLEAN rField_is_Z(const ring r)
ListCFList irrCharSeries(const CFList &PS)
irreducible characteristic series
static BOOLEAN rField_is_Zp(const ring r)
int singclap_factorize_retry
CFMatrix * cf_LLL(CFMatrix &A)
performs LLL reduction.
poly convFactoryPSingP(const CanonicalForm &f, const ring r)
static BOOLEAN rField_is_Q(const ring r)
void p_Cleardenom_n(poly ph, const ring r, number &c)