My Project
Macros | Functions
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.

Macros

#define PCOEFFH
 

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 More...
 
poly p_CoeffTermV (poly v, poly m, const ring r)
 find vector of coeffs of (polynomial) m in vector v More...
 
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 More...
 
ideal id_CoeffTermV (ideal M, poly m, const ring r)
 find coeffs of (polynomial) m in all vectors from I More...
 

Macro Definition Documentation

◆ PCOEFFH

#define PCOEFFH

Definition at line 3 of file pCoeff.h.

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.

64{
65 ideal res=idInit(IDELEMS(I),I->rank);
66 for(int i=IDELEMS(I)-1;i>=0;i--)
67 {
68 number n=p_CoeffTerm(I->m[i],m,r);
69 res->m[i]=p_NSet(n,r);
70 }
71 return res;
72}
int m
Definition: cfEzgcd.cc:128
int i
Definition: cfEzgcd.cc:132
CanonicalForm res
Definition: facAbsFact.cc:60
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
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition: p_polys.cc:1469
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:35
#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.

76{
77 ideal res=idInit(IDELEMS(M),M->rank);
78 for(int i=IDELEMS(M)-1;i>=0;i--)
79 {
80 res->m[i]=p_CoeffTermV(M->m[i],m,r);
81 }
82 return res;
83}
poly p_CoeffTermV(poly v, poly m, const ring r)
find vector of coeffs of (polynomial) m in vector v
Definition: pCoeff.cc:39
#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.

23{
24 if (m!=NULL)
25 {
26 while (p!=NULL)
27 {
28 if (p_LmCmp(p,m,r)==0)
29 {
30 return n_Copy(p_GetCoeff(p,r),r->cf);
31 }
32 pIter(p);
33 }
34 }
35 return n_Init(0,r->cf);
36}
int p
Definition: cfModGcd.cc:4078
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition: coeffs.h:451
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:538
#define pIter(p)
Definition: monomials.h:37
#define p_GetCoeff(p, r)
Definition: monomials.h:50
#define NULL
Definition: omList.c:12
static int p_LmCmp(poly p, poly q, const ring r)
Definition: p_polys.h:1582

◆ 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.

40{
41 poly res=NULL;
42 if (m!=NULL)
43 {
44 while (v!=NULL)
45 {
46 p_SetComp(m,p_GetComp(v,r),r);
47 if (p_LmCmp(v,m,r)==0)
48 {
49 p_SetComp(m,0,r);
50 poly p=p_Init(r);
52 p_SetComp(p,p_GetComp(v,r),r);
53 res=p_Add_q(res,p,r);
54 }
55 pIter(v);
56 }
57 }
58 return res;
59}
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:39
#define p_SetCoeff0(p, n, r)
Definition: monomials.h:60
#define p_GetComp(p, r)
Definition: monomials.h:64
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:938
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:249
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1322