Functions
witness.h File Reference
#include <polys/monomials/monomials.h>
#include <polys/simpleideals.h>
#include <Singular/ipid.h>

Go to the source code of this file.

Functions

matrix divisionDiscardingRemainder (const poly f, const ideal G, const ring r)
 Computes a division discarding remainder of f with respect to G. More...
 
matrix divisionDiscardingRemainder (const ideal F, const ideal G, const ring r)
 Computes a division discarding remainder of F with respect to G. More...
 
poly witness (const poly m, const ideal I, const ideal inI, const ring r)
 Let w be the uppermost weight vector in the matrix defining the ordering on r. More...
 
ideal witness (const ideal inI, const ideal J, const ring r)
 Computes witnesses in J for inI Given inI={h1,...,hl} and J={g1,...,gk} two sets of polynomials in r, returns a set I={f1,...,fl} of <g1,...,gk> such that in_w(fj)=hj for all j=1,...,l, where w denotes the uppoermost weight vector in the matrix defining the ordering on r. More...
 
BOOLEAN dwrDebug (leftv res, leftv args)
 
BOOLEAN witnessDebug (leftv res, leftv args)
 

Function Documentation

matrix divisionDiscardingRemainder ( const poly  f,
const ideal  G,
const ring  r 
)

Computes a division discarding remainder of f with respect to G.

Given f a polynomial and G={g1,...,gk} a set of polynomials in r, returns a matrix Q=(q1,...,qk) over r such that f = q1*g1+...+qk*gk+s is a determinate division with remainder s.

Definition at line 9 of file witness.cc.

10 {
11  ring origin = currRing;
12  if (origin != r) rChangeCurrRing(r);
13  ideal F = idInit(1); F->m[0]=f;
14  ideal m = idLift(G,F);
15  F->m[0]=NULL; id_Delete(&F, currRing);
17  if (origin != r) rChangeCurrRing(origin);
18  return Q;
19 }
f
Definition: cfModGcd.cc:4022
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define Q
Definition: sirandom.c:25
static TreeM * G
Definition: janet.cc:38
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
int m
Definition: cfEzgcd.cc:119
#define IDELEMS(i)
Definition: simpleideals.h:24
void rChangeCurrRing(ring r)
Definition: polys.cc:14
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
matrix id_Module2formatedMatrix(ideal mod, int rows, int cols, const ring R)
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit)
Definition: ideals.cc:935
matrix divisionDiscardingRemainder ( const ideal  F,
const ideal  G,
const ring  r 
)

Computes a division discarding remainder of F with respect to G.

Given F={f1,...,fl} and G={g1,...,gk} two sets of polynomials in r, returns a matrix Q=(qij) i=1,..,k j=1,...,l over r such that fj = q1j*g1+...+qkj*gk+sj is a determinate division with remainder sj for all j=1,...,l.

Definition at line 21 of file witness.cc.

22 {
23  ring origin = currRing;
24  if (origin != r) rChangeCurrRing(r);
25  ideal R; matrix U;
26  ideal m = idLift(G,F,&R,FALSE,FALSE,TRUE,&U);
28  id_Delete(&R,r);
29  mp_Delete(&U,r);
30  if (origin != r) rChangeCurrRing(origin);
31  return Q;
32 }
#define FALSE
Definition: auxiliary.h:140
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:144
#define Q
Definition: sirandom.c:25
static TreeM * G
Definition: janet.cc:38
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
const ring R
Definition: DebugPrint.cc:36
int m
Definition: cfEzgcd.cc:119
#define IDELEMS(i)
Definition: simpleideals.h:24
void mp_Delete(matrix *a, const ring r)
Definition: matpol.cc:785
void rChangeCurrRing(ring r)
Definition: polys.cc:14
matrix id_Module2formatedMatrix(ideal mod, int rows, int cols, const ring R)
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit)
Definition: ideals.cc:935
BOOLEAN dwrDebug ( leftv  res,
leftv  args 
)

Definition at line 73 of file witness.cc.

74 {
75  leftv u = args;
76  leftv v = u->next;
77  ideal F = (ideal) u->CopyD();
78  ideal G = (ideal) v->CopyD();
79  omUpdateInfo();
80  Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
82  id_Delete(&F,currRing);
83  id_Delete(&G,currRing);
84  res->rtyp = MATRIX_CMD;
85  res->data = (char*) Q;
86  return FALSE;
87 }
matrix divisionDiscardingRemainder(const poly f, const ideal G, const ring r)
Computes a division discarding remainder of f with respect to G.
Definition: witness.cc:9
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:140
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define Q
Definition: sirandom.c:25
static TreeM * G
Definition: janet.cc:38
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
omInfo_t om_Info
Definition: omStats.c:13
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
void omUpdateInfo()
Definition: omStats.c:24
int rtyp
Definition: subexpr.h:92
void * CopyD(int t)
Definition: subexpr.cc:676
poly witness ( const poly  m,
const ideal  I,
const ideal  inI,
const ring  r 
)

Let w be the uppermost weight vector in the matrix defining the ordering on r.

Let I be a Groebner basis of an ideal in r, inI its initial form with respect w. Given an w-homogeneous element m of inI, computes a witness g of m in I, i.e. g in I such that in_w(g)=m.

Definition at line 34 of file witness.cc.

35 {
36  assume(idSize(I)==idSize(inI));
38 
39  int k = idSize(I);
40  poly f = p_Mult_q(p_Copy(I->m[0],r),Q->m[0],r);
41  Q->m[0] = NULL;
42  for (int i=1; i<k; i++)
43  {
44  f = p_Add_q(f,p_Mult_q(p_Copy(I->m[i],r),Q->m[i],r),r);
45  Q->m[i] = NULL;
46  }
47  mp_Delete(&Q,r);
48 
49  return f;
50 }
matrix divisionDiscardingRemainder(const poly f, const ideal G, const ring r)
Computes a division discarding remainder of f with respect to G.
Definition: witness.cc:9
f
Definition: cfModGcd.cc:4022
int k
Definition: cfEzgcd.cc:93
#define Q
Definition: sirandom.c:25
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
poly * m
Definition: matpol.h:19
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
void mp_Delete(matrix *a, const ring r)
Definition: matpol.cc:785
#define NULL
Definition: omList.c:10
static int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:43
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1025
ideal witness ( const ideal  inI,
const ideal  J,
const ring  r 
)

Computes witnesses in J for inI Given inI={h1,...,hl} and J={g1,...,gk} two sets of polynomials in r, returns a set I={f1,...,fl} of <g1,...,gk> such that in_w(fj)=hj for all j=1,...,l, where w denotes the uppoermost weight vector in the matrix defining the ordering on r.

Assumes that hj is an element of <in_w(g1),...,in_w(gk)>

Definition at line 52 of file witness.cc.

53 {
54  ring origin = currRing;
55  if (origin!=r)
57  ideal NFinI = kNF(J,r->qideal,inI);
58  if (origin!=r)
59  rChangeCurrRing(origin);
60 
61  int k = idSize(inI);
62  ideal I = idInit(k);
63  for (int i=0; i<k; i++)
64  {
65  I->m[i] = p_Add_q(p_Copy(inI->m[i],r),p_Neg(NFinI->m[i],r),r);
66  NFinI->m[i] = NULL;
67  }
68 
69  return I;
70 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2815
int k
Definition: cfEzgcd.cc:93
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
void rChangeCurrRing(ring r)
Definition: polys.cc:14
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
static int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:43
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
BOOLEAN witnessDebug ( leftv  res,
leftv  args 
)

Definition at line 89 of file witness.cc.

90 {
91  leftv u = args;
92  if ((u != NULL) && (u->Typ() == IDEAL_CMD))
93  {
94  leftv v = u->next;
95  if ((v!=NULL) && (v->Typ()==IDEAL_CMD))
96  {
97  omUpdateInfo();
98  Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
99  ideal inI = (ideal) u->CopyD();
100  ideal J = (ideal) v->CopyD();
101  ideal I = witness(inI,J,currRing);
102  id_Delete(&inI,currRing);
103  id_Delete(&J,currRing);
104  res->rtyp = IDEAL_CMD;
105  res->data = (char*) I;
106  return FALSE;
107  }
108  }
109  return TRUE;
110 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:140
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:144
int Typ()
Definition: subexpr.cc:969
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
omInfo_t om_Info
Definition: omStats.c:13
leftv next
Definition: subexpr.h:87
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
poly witness(const poly m, const ideal I, const ideal inI, const ring r)
Let w be the uppermost weight vector in the matrix defining the ordering on r.
Definition: witness.cc:34
void omUpdateInfo()
Definition: omStats.c:24
int rtyp
Definition: subexpr.h:92
void * CopyD(int t)
Definition: subexpr.cc:676