My Project
Loading...
Searching...
No Matches
witness.cc File Reference

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.
 
matrix divisionDiscardingRemainder (const ideal F, const ideal G, const ring r)
 Computes a division discarding remainder of F with respect to G.
 
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.
 
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.
 

Function Documentation

◆ divisionDiscardingRemainder() [1/2]

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 TRUE
Definition auxiliary.h:101
#define FALSE
Definition auxiliary.h:97
int m
Definition cfEzgcd.cc:128
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit, GbVariant alg)
represents the generators of submod in terms of the generators of mod (Matrix(SM)*U-Matrix(rest)) = M...
Definition ideals.cc:1111
STATIC_VAR TreeM * G
Definition janet.cc:31
void mp_Delete(matrix *a, const ring r)
Definition matpol.cc:874
ip_smatrix * matrix
Definition matpol.h:43
void rChangeCurrRing(ring r)
Definition polys.cc:16
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
matrix id_Module2formatedMatrix(ideal mod, int rows, int cols, const ring R)
#define IDELEMS(i)
#define R
Definition sirandom.c:27
#define Q
Definition sirandom.c:26

◆ divisionDiscardingRemainder() [2/2]

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}
FILE * f
Definition checklibs.c:9
#define NULL
Definition omList.c:12
ideal idInit(int idsize, int rank)
initialise an ideal / module

◆ witness() [1/2]

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 = IDELEMS(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 assume(areIdealsEqual(I,r,J,r));
70
71 return I;
72}
int i
Definition cfEzgcd.cc:132
int k
Definition cfEzgcd.cc:99
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition kstd1.cc:3224
#define assume(x)
Definition mod2.h:389
static poly p_Neg(poly p, const ring r)
Definition p_polys.h:1109
static poly p_Add_q(poly p, poly q, const ring r)
Definition p_polys.h:938
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition p_polys.h:848
bool areIdealsEqual(ideal I, ring r, ideal J, ring s)

◆ witness() [2/2]

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(IDELEMS(I)==IDELEMS(inI));
38
39 int k = IDELEMS(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}
static poly p_Mult_q(poly p, poly q, const ring r)
Definition p_polys.h:1120
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