Loading...
Searching...
No Matches
witness.cc File Reference
`#include "kernel/GBEngine/kstd1.h"`
`#include "Singular/lists.h"`
`#include "polys/monomials/p_polys.h"`
`#include "callgfanlib_conversion.h"`
`#include "tropicalDebug.h"`
`#include "initial.h"`
`#include "tropicalStrategy.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.
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.

{
ring origin = currRing;
if (origin != r) rChangeCurrRing(r);
ideal R; matrix U;
ideal m = idLift(G,F,&R,FALSE,FALSE,TRUE,&U);
matrix Q = id_Module2formatedMatrix(m,IDELEMS(G),IDELEMS(F),currRing);
id_Delete(&R,r);
mp_Delete(&U,r);
if (origin != r) rChangeCurrRing(origin);
return Q;
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
m
int m
Definition cfEzgcd.cc:128
idLift
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
G
STATIC_VAR TreeM * G
Definition janet.cc:31
mp_Delete
void mp_Delete(matrix *a, const ring r)
Definition matpol.cc:874
matrix
ip_smatrix * matrix
Definition matpol.h:43
rChangeCurrRing
void rChangeCurrRing(ring r)
Definition polys.cc:16
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition simpleideals.cc:123
id_Module2formatedMatrix
matrix id_Module2formatedMatrix(ideal mod, int rows, int cols, const ring R)
Definition simpleideals.cc:1640
IDELEMS
#define IDELEMS(i)
Definition simpleideals.h:23
R
#define R
Definition sirandom.c:27
Q
#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.

{
ring origin = currRing;
if (origin != r) rChangeCurrRing(r);
ideal F = idInit(1); F->m[0]=f;
ideal m = idLift(G,F);
F->m[0]=NULL; id_Delete(&F, currRing);
matrix Q = id_Module2formatedMatrix(m,IDELEMS(G),1,currRing);
if (origin != r) rChangeCurrRing(origin);
return Q;
}
f
FILE * f
Definition checklibs.c:9
NULL
#define NULL
Definition omList.c:12
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition simpleideals.cc:35

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

{
ring origin = currRing;
if (origin!=r)
rChangeCurrRing(r);
ideal NFinI = kNF(J,r->qideal,inI);
if (origin!=r)
rChangeCurrRing(origin);
int k = IDELEMS(inI);
ideal I = idInit(k);
for (int i=0; i<k; i++)
{
I->m[i] = p_Add_q(p_Copy(inI->m[i],r),p_Neg(NFinI->m[i],r),r);
NFinI->m[i] = NULL;
}
assume(areIdealsEqual(I,r,J,r));
return I;
}
i
int i
Definition cfEzgcd.cc:132
k
int k
Definition cfEzgcd.cc:99
kNF
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition kstd1.cc:3229
assume
#define assume(x)
Definition mod2.h:389
p_Neg
static poly p_Neg(poly p, const ring r)
Definition p_polys.h:1114
p_Add_q
static poly p_Add_q(poly p, poly q, const ring r)
Definition p_polys.h:938
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition p_polys.h:848
areIdealsEqual
bool areIdealsEqual(ideal I, ring r, ideal J, ring s)
Definition tropicalDebug.cc:41

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

{
assume(IDELEMS(I)==IDELEMS(inI));
matrix Q = divisionDiscardingRemainder(m,inI,r);
int k = IDELEMS(I);
poly f = p_Mult_q(p_Copy(I->m[0],r),Q->m[0],r);
Q->m[0] = NULL;
for (int i=1; i<k; i++)
{
f = p_Add_q(f,p_Mult_q(p_Copy(I->m[i],r),Q->m[i],r),r);
Q->m[i] = NULL;
}
mp_Delete(&Q,r);
return f;
}
p_Mult_q
static poly p_Mult_q(poly p, poly q, const ring r)
Definition p_polys.h:1125
divisionDiscardingRemainder
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