Loading...
Searching...
No Matches
pCoeff.h File Reference
`#include "misc/auxiliary.h"`
`#include "coeffs/coeffs.h"`
`#include "polys/monomials/p_polys.h"`
`#include "simpleideals.h"`

Go to the source code of this file.

## Functions

number | p_CoeffTerm (poly p, poly m, const ring r)
| find coeff of (polynomial) m in polynomial p find coeff of (vector) m in vector p
poly | p_CoeffTermV (poly v, poly m, const ring r)
| find vector of coeffs of (polynomial) m in vector v
ideal | id_CoeffTerm (ideal I, poly m, const ring r)
| find coeffs of (polynomial) m in all polynomials from I find coeffs of (vector) m in all vectors from I
ideal | id_CoeffTermV (ideal M, poly m, const ring r)
| find coeffs of (polynomial) m in all vectors from I
poly | p_CoeffTermId (poly v, ideal m, int n, const ring r)
| find coeffs of a vector of a list of given monomials, n>=max_comp(v)
poly | p_CoeffTermMo (poly v, ideal m, const ring r)
| find coeffs of a vector of a matrix(as module) of given monomials

## Function Documentation

## id_CoeffTerm()

ideal id_CoeffTerm | ( | ideal | I,
|  | poly | m,
|  | const ring | r )

find coeffs of (polynomial) m in all polynomials from I find coeffs of (vector) m in all vectors from I

Definition at line 63 of file pCoeff.cc.

{
ideal res=idInit(IDELEMS(I),I->rank);
for(int i=IDELEMS(I)-1;i>=0;i--)
{
number n=p_CoeffTerm(I->m[i],m,r);
res->m[i]=p_NSet(n,r);
}
return res;
}
m
int m
Definition cfEzgcd.cc:128
i
int i
Definition cfEzgcd.cc:132
res
CanonicalForm res
Definition facAbsFact.cc:60
p_CoeffTerm
number p_CoeffTerm(poly p, poly m, const ring r)
find coeff of (polynomial) m in polynomial p find coeff of (vector) m in vector p
Definition pCoeff.cc:22
p_NSet
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition p_polys.cc:1474
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition simpleideals.cc:35
IDELEMS
#define IDELEMS(i)
Definition simpleideals.h:23

## id_CoeffTermV()

ideal id_CoeffTermV | ( | ideal | M,
|  | poly | m,
|  | const ring | r )

find coeffs of (polynomial) m in all vectors from I

Definition at line 75 of file pCoeff.cc.

{
ideal res=idInit(IDELEMS(M),M->rank);
for(int i=IDELEMS(M)-1;i>=0;i--)
{
res->m[i]=p_CoeffTermV(M->m[i],m,r);
}
return res;
}
p_CoeffTermV
poly p_CoeffTermV(poly v, poly m, const ring r)
find vector of coeffs of (polynomial) m in vector v
Definition pCoeff.cc:39
M
#define M
Definition sirandom.c:25

## p_CoeffTerm()

number p_CoeffTerm | ( | poly | p,
|  | poly | m,
|  | const ring | r )

find coeff of (polynomial) m in polynomial p find coeff of (vector) m in vector p

Definition at line 22 of file pCoeff.cc.

{
if (m!=NULL)
{
while (p!=NULL)
{
if (p_LmCmp(p,m,r)==0)
{
return n_Copy(p_GetCoeff(p,r),r->cf);
}
pIter(p);
}
}
return n_Init(0,r->cf);
}
p
int p
Definition cfModGcd.cc:4086
n_Copy
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition coeffs.h:457
n_Init
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition coeffs.h:541
pIter
#define pIter(p)
Definition monomials.h:37
p_GetCoeff
#define p_GetCoeff(p, r)
Definition monomials.h:50
NULL
#define NULL
Definition omList.c:12
p_LmCmp
static int p_LmCmp(poly p, poly q, const ring r)
Definition p_polys.h:1601

## p_CoeffTermId()

poly p_CoeffTermId | ( | poly | v,
|  | ideal | m,
|  | int | n,
|  | const ring | r )

find coeffs of a vector of a list of given monomials, n>=max_comp(v)

Definition at line 86 of file pCoeff.cc.

{
if ((n<=0)||(v==NULL)) return NULL;
poly q;
poly u=NULL;
int dummy;
const int ncols_m=IDELEMS(m);
v=p_Copy(v,r);
for(int i=1;i<=n;i++)
{
p_TakeOutComp(&v,i,&q,&dummy,r);
for(int j=0;j<ncols_m;j++)
{
number n=p_CoeffTerm(q,m->m[j],r);
poly uu=p_NSet(n,r);
if (uu!=NULL)
{
p_SetComp(uu,(i-1)*ncols_m+j+1,r);
u=p_Add_q(u,uu,r);
}
}
if (v==NULL) break;
}
return u;
}
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
j
int j
Definition facHensel.cc:110
p_TakeOutComp
void p_TakeOutComp(poly *p, long comp, poly *q, int *lq, const ring r)
Definition p_polys.cc:3620
p_Add_q
static poly p_Add_q(poly p, poly q, const ring r)
Definition p_polys.h:938
p_SetComp
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition p_polys.h:249
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition p_polys.h:848

## p_CoeffTermMo()

poly p_CoeffTermMo | ( | poly | v,
|  | ideal | m,
|  | const ring | r )

find coeffs of a vector of a matrix(as module) of given monomials

find coeffs of a vector of a matrix(as module) of given monomials

Definition at line 113 of file pCoeff.cc.

{
poly res=NULL;
int to_shift=0;
poly q;
int dummy;
v=p_Copy(v,r);
for(int i=0;i<IDELEMS(m);i++)
{
if (v==NULL) break;
p_TakeOutComp(&v,i+1,&q,&dummy,r);
ideal mm=id_Vec2Ideal(m->m[i],r);
p_SetCompP(q,1,r);
poly tmp=p_CoeffTermId(q,mm,1,r);
if (i>0)
{
to_shift+=p_MaxComp(m->m[i-1],r);
p_Shift(&tmp,to_shift,r);
res=p_Add_q(res,tmp,r);
}
else
res=tmp;
}
return res;
}
p_CoeffTermId
poly p_CoeffTermId(poly v, ideal m, int n, const ring r)
find coeffs of a vector of a list of given monomials, n>=max_comp(v)
Definition pCoeff.cc:86
p_Shift
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
Definition p_polys.cc:4860
p_SetCompP
static void p_SetCompP(poly p, int i, ring r)
Definition p_polys.h:256
p_MaxComp
static long p_MaxComp(poly p, ring lmRing, ring tailRing)
Definition p_polys.h:294
id_Vec2Ideal
ideal id_Vec2Ideal(poly vec, const ring R)
Definition simpleideals.cc:1528

## p_CoeffTermV()

poly p_CoeffTermV | ( | poly | v,
|  | poly | m,
|  | const ring | r )

find vector of coeffs of (polynomial) m in vector v

Definition at line 39 of file pCoeff.cc.

{
poly res=NULL;
if (m!=NULL)
{
while (v!=NULL)
{
p_SetComp(m,p_GetComp(v,r),r);
if (p_LmCmp(v,m,r)==0)
{
p_SetComp(m,0,r);
poly p=p_Init(r);
p_SetCoeff0(p,p_GetCoeff(v,r),r);
p_SetComp(p,p_GetComp(v,r),r);
res=p_Add_q(res,p,r);
}
pIter(v);
}
}
return res;
}
p_SetCoeff0
#define p_SetCoeff0(p, n, r)
Definition monomials.h:60
p_GetComp
#define p_GetComp(p, r)
Definition monomials.h:64
p_Init
static poly p_Init(const ring r, omBin bin)
Definition p_polys.h:1341