Loading...
Searching...
No Matches
cohomo.cc File Reference
`#include "kernel/mod2.h"`
`#include "omalloc/omalloc.h"`
`#include "misc/mylimits.h"`
`#include "libpolys/misc/intvec.h"`
`#include <assert.h>`
`#include <unistd.h>`
`#include "kernel/combinatorics/hilb.h"`
`#include "kernel/combinatorics/stairc.h"`
`#include "kernel/combinatorics/hutil.h"`
`#include "kernel/GBEngine/tgb.h"`
`#include "Singular/ipid.h"`
`#include "polys/monomials/ring.h"`
`#include "polys/monomials/p_polys.h"`
`#include "polys/simpleideals.h"`
`#include "Singular/lists.h"`
`#include "kernel/linear_algebra/linearAlgebra.h"`
`#include "kernel/GBEngine/kstd1.h"`
`#include <kernel/ideals.h>`
`#include <libpolys/polys/ext_fields/transext.h>`
`#include <libpolys/coeffs/coeffs.h>`
`#include <coeffs/numbers.h>`
`#include <vector>`
`#include <Singular/ipshell.h>`
`#include <Singular/libsingular.h>`
`#include <time.h>`

Go to the source code of this file.

## Functions

static bool | IsinL (int a, std::vector< int > vec)
static std::vector< int > | vecIntersection (std::vector< int > p, std::vector< int > q)
static bool | vsubset (std::vector< int > vec1, std::vector< int > vec2)
static bool | vEvl (std::vector< int > vec1, std::vector< int > vec2)
static bool | vInvsl (std::vector< int > vec, std::vector< std::vector< int > > vecs)
static std::vector< int > | vecUnion (std::vector< int > vec1, std::vector< int > vec2)
static std::vector< int > | vecMinus (std::vector< int > vec1, std::vector< int > vec2)
static std::vector< std::vector< int > > | vsMinusv (std::vector< std::vector< int > > vecs, std::vector< int > vec)
static std::vector< std::vector< int > > | vsUnion (std::vector< std::vector< int > > vs1, std::vector< std::vector< int > > vs2)
static std::vector< std::vector< int > > | vsIntersection (std::vector< std::vector< int > > vs1, std::vector< std::vector< int > > vs2)
static std::vector< int > | support1 (poly p)
static std::vector< std::vector< int > > | supports (ideal h)
static std::vector< int > | support2 (poly p)
static std::vector< std::vector< int > > | supports2 (ideal h)
static poly | pMake (std::vector< int > vbase)
static ideal | idMake (std::vector< std::vector< int > > vecs)
static ideal | idmodulo (ideal h1, ideal h2)
static int | pcoef (poly p, int m)
static bool | vInp (int m, poly p)
static std::vector< int > | vMake (poly p)
static std::vector< std::vector< int > > | vsMake (ideal h)
static std::vector< std::vector< int > > | vecqring (std::vector< std::vector< int > > vec1, std::vector< std::vector< int > > vec2)
static poly | pMaken (std::vector< int > vbase)
static ideal | idMaken (std::vector< std::vector< int > > vecs)
static std::vector< std::vector< int > > | b_subsets (std::vector< int > vec)
static int | idvert (ideal h)
static int | pvert (poly p)
static ideal | idMinus (ideal h1, ideal h2)
static bool | p_Ifsfree (poly P)
static ideal | sfreemon (ideal h, int deg)
static ideal | id_sfmon (ideal h)
static ideal | id_complement (ideal h)
static bool | IsInX (poly p, ideal X)
static ideal | qringadd (ideal h1, ideal h2, int deg)
static int | id_maxdeg (ideal h)
static ideal | idsrRing (ideal h)
static ideal | SimFacset (poly p)
static ideal | idadda (ideal h1, ideal h2)
static ideal | IsSimplex (ideal h)
static ideal | complementsimplex (ideal h)
static int | dim_sim (ideal h)
static int | num4dim (ideal h, int n)
static ideal | findb (ideal h)
static ideal | finda (ideal h, poly S, int ddeg)
static bool | mabconditionv (std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > av, std::vector< int > bv)
static std::vector< std::vector< int > > | Mabv (ideal h, poly a, poly b)
static std::vector< int > | eli1 (std::vector< int > eq1, std::vector< int > eq2)
static std::vector< int > | keeporder (std::vector< int > vec)
static std::vector< std::vector< int > > | soleli1 (std::vector< std::vector< int > > eqs)
static std::vector< int > | freevars (int n, std::vector< int > bset, std::vector< std::vector< int > > gset)
static std::vector< int > | fvarsvalue (int vnum, std::vector< int > fvars)
static std::vector< std::vector< int > > | vAbsorb (std::vector< int > bset, std::vector< std::vector< int > > gset)
static std::vector< int > | vecbase1 (int num, std::vector< int > oset)
static std::vector< int > | make0 (int n)
static std::vector< int > | make1 (int n)
static std::vector< int > | ofindbases1 (int num, int vnum, std::vector< int > bset, std::vector< std::vector< int > > gset)
static std::vector< std::vector< int > > | ofindbases (int num, std::vector< int > bset, std::vector< std::vector< int > > gset)
static std::vector< std::vector< int > > | eli2 (int num, std::vector< int > bset, std::vector< std::vector< int > > gset)
static std::vector< std::vector< int > > | links (poly a, ideal h)
static int | redefinedeg (poly p, int num)
static ideal | p_a (ideal h)
static std::vector< int > | vertset (std::vector< std::vector< int > > vecs)
static ideal | p_b (ideal h, poly a)
static ideal | psubset (poly p)
static std::vector< std::vector< int > > | listsinsertlist (std::vector< std::vector< int > > gset, int a, int b)
static std::vector< int > | makeequation (int i, int j, int t)
static poly | pMake3 (std::vector< int > vbase)
static ideal | idMake3 (std::vector< std::vector< int > > vecs)
static void | equmab (int num)
static std::vector< poly > | pMakei (std::vector< std::vector< int > > mv, std::vector< int > vbase)
static std::vector< std::vector< poly > > | idMakei (std::vector< std::vector< int > > mv, std::vector< std::vector< int > > vecs)
static ideal | getpresolve (ideal h)
static std::vector< int > | numfree (ideal h)
static std::vector< std::vector< int > > | canonicalbase (int n)
static std::vector< std::vector< int > > | getvector (ideal h, int n)
static std::vector< int > | subspacet1 (int num, std::vector< std::vector< int > > ntvs)
static std::vector< std::vector< int > > | mabtv (std::vector< std::vector< int > > hvs, std::vector< std::vector< int > > Mv, std::vector< int > av, std::vector< int > bv)
static bool | nabconditionv (std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > av, std::vector< int > bv)
static std::vector< std::vector< int > > | Nabv (std::vector< std::vector< int > > hvs, std::vector< int > av, std::vector< int > bv)
static bool | nabtconditionv (std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > qv)
static std::vector< std::vector< int > > | nabtv (std::vector< std::vector< int > > hvs, std::vector< std::vector< int > > Nv, std::vector< int > av, std::vector< int > bv)
static bool | tNab (std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< std::vector< int > > bvs)
static std::vector< int > | tnab (std::vector< std::vector< int > > hvs, std::vector< std::vector< int > > nvs, std::vector< std::vector< int > > bvs)
static std::vector< int > | phimage (std::vector< int > pv, std::vector< int > av, std::vector< int > bv)
static std::vector< std::vector< int > > | value1 (std::vector< std::vector< int > > mvs, std::vector< std::vector< int > > nvs, std::vector< std::vector< int > > vecs, std::vector< int > av, std::vector< int > bv)
static intvec * | Tmat (std::vector< std::vector< int > > vecs)
static std::vector< int > | gensindex (ideal M, ideal ids)
static ideal | mingens (ideal h, poly a, poly b)
static std::vector< std::vector< int > > | minisolve (std::vector< std::vector< int > > solve, std::vector< int > index)
static intvec * | gradedpiece1n (ideal h, poly a, poly b)
static bool | condition2for2nv (std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > qv, std::vector< int > fv)
static std::vector< int > | findalphan (std::vector< std::vector< int > > N, std::vector< int > tN)
static std::vector< std::vector< int > > | subspacetn (std::vector< std::vector< int > > N, std::vector< int > tN, std::vector< std::vector< int > > ntvs)
static std::vector< std::vector< int > > | value2 (std::vector< std::vector< int > > mvs, std::vector< std::vector< int > > nvs, std::vector< std::vector< int > > mts, std::vector< std::vector< int > > nts, std::vector< std::vector< int > > vecs, std::vector< int > av, std::vector< int > bv)
static ideal | genst (ideal h, poly a, poly b)
static intvec * | gradedpiece2n (ideal h, poly a, poly b)
static std::vector< int > | phimagel (std::vector< int > fv, std::vector< int > av, std::vector< int > bv)
static std::vector< std::vector< int > > | value1l (std::vector< std::vector< int > > mvs, std::vector< std::vector< int > > lks, std::vector< std::vector< int > > vecs, std::vector< int > av, std::vector< int > bv)
static void | TimeShow (clock_t t_construct, clock_t t_solve, clock_t t_value, clock_t t_total)
static std::vector< std::vector< int > > | gpl (ideal h, poly a, poly b)
static intvec * | gradedpiece1nl (ideal h, poly a, poly b, int set)
static std::vector< std::vector< int > > | value2l (std::vector< std::vector< int > > mvs, std::vector< std::vector< int > > lks, std::vector< std::vector< int > > mts, std::vector< std::vector< int > > lkts, std::vector< std::vector< int > > vecs, std::vector< int > av, std::vector< int > bv)
static std::vector< std::vector< int > > | gpl2 (ideal h, poly a, poly b)
static intvec * | gradedpiece2nl (ideal h, poly a, poly b)
static ideal | trisets (ideal h)
static std::vector< std::vector< int > > | triface (poly p, int vert)
static ideal | triangulations1 (ideal h, poly p, int vert)
static std::vector< int > | commonedge (poly p, poly q)
static intvec * | edgemat (poly p, poly q)
static std::vector< std::vector< int > > | tetraface (poly p, poly q, int vert)
static ideal | triangulations2 (ideal h, poly p, poly q, int vert)
static std::vector< std::vector< int > > | penface (poly p, poly q, poly g, int vert)
static ideal | triangulations3 (ideal h, poly p, poly q, poly g, int vert)
static int | valency (ideal h, poly p)
static std::vector< std::vector< int > > | vsMinusvs (std::vector< std::vector< int > > vs1, std::vector< std::vector< int > > vs2)
static std::vector< std::vector< int > > | vs_subsets (std::vector< std::vector< int > > vs)
static std::vector< std::vector< int > > | p_constant (ideal Xo, ideal Sigma)
static std::vector< std::vector< int > > | p_change (ideal Sigma)
static std::vector< std::vector< int > > | p_new (ideal Xo, ideal Sigma)
static ideal | c_New (ideal Io, ideal sig)
static std::vector< std::vector< int > > | phi1 (poly a, ideal Sigma)
static std::vector< std::vector< int > > | phi2 (poly a, ideal Xo, ideal Sigma)
static std::vector< std::vector< int > > | links_new (poly a, ideal Xo, ideal Sigma, int vert, int ord)
static int | existIn (poly b, ideal Xs)
static int | isoNum (poly p, ideal I, poly a, poly b)
static int | ifIso (poly p, poly q, poly f, poly g, poly a, poly b)
static ideal | idMinusp (ideal I, poly p)
static std::vector< int > | v_minus (std::vector< int > v1, std::vector< int > v2)
static std::vector< int > | gdegree (poly a, poly b)
static std::vector< std::vector< int > > | star (poly a, ideal h)
static std::vector< std::vector< int > > | boundary (poly a)
static std::vector< std::vector< int > > | stellarsub (poly a, ideal h)
static std::vector< std::vector< int > > | bsubsets_1 (poly b)
static ideal | T_1h (ideal h)
static BOOLEAN | SRideal (leftv res, leftv args)
static BOOLEAN | idcomplement (leftv res, leftv args)
static BOOLEAN | t1h (leftv res, leftv args)
static BOOLEAN | idsr (leftv res, leftv args)
static intvec * | dmat (poly a, poly b)
static BOOLEAN | gd (leftv res, leftv args)
static BOOLEAN | comedg (leftv res, leftv args)
static BOOLEAN | fb (leftv res, leftv args)
static BOOLEAN | pa (leftv res, leftv args)
static BOOLEAN | makeSimplex (leftv res, leftv args)
static BOOLEAN | pb (leftv res, leftv args)
static BOOLEAN | fa (leftv res, leftv args)
static BOOLEAN | fgp (leftv res, leftv args)
static BOOLEAN | fgpl (leftv res, leftv args)
static BOOLEAN | genstt (leftv res, leftv args)
static BOOLEAN | sgp (leftv res, leftv args)
static BOOLEAN | sgpl (leftv res, leftv args)
static BOOLEAN | Links (leftv res, leftv args)
static BOOLEAN | isSim (leftv res, leftv args)
BOOLEAN | nfaces1 (leftv res, leftv args)
static BOOLEAN | nfaces2 (leftv res, leftv args)
static BOOLEAN | nfaces3 (leftv res, leftv args)
static BOOLEAN | eqsolve1 (leftv res, leftv args)
static BOOLEAN | tsets (leftv res, leftv args)
static BOOLEAN | Valency (leftv res, leftv args)
static BOOLEAN | nabvl (leftv res, leftv args)
static BOOLEAN | tnabvl (leftv res, leftv args)
static BOOLEAN | vsIntersec (leftv res, leftv args)
static BOOLEAN | mabvl (leftv res, leftv args)
static BOOLEAN | nabtvl (leftv res, leftv args)
static BOOLEAN | linkn (leftv res, leftv args)
static BOOLEAN | existsub (leftv res, leftv args)
static BOOLEAN | pConstant (leftv res, leftv args)
static BOOLEAN | pChange (leftv res, leftv args)
static BOOLEAN | p_New (leftv res, leftv args)
static BOOLEAN | support (leftv res, leftv args)
static BOOLEAN | bprime (leftv res, leftv args)
static BOOLEAN | psMinusp (leftv res, leftv args)
static BOOLEAN | stellarremain (leftv res, leftv args)
static BOOLEAN | cNew (leftv res, leftv args)
static BOOLEAN | stars (leftv res, leftv args)
static BOOLEAN | stellarsubdivision (leftv res, leftv args)
static BOOLEAN | idModulo (leftv res, leftv args)
static BOOLEAN | idminus (leftv res, leftv args)
static BOOLEAN | isoNumber (leftv res, leftv args)
static BOOLEAN | ifIsomorphism (leftv res, leftv args)
static BOOLEAN | newDegree (leftv res, leftv args)
static BOOLEAN | nonf2f (leftv res, leftv args)
static BOOLEAN | dimsim (leftv res, leftv args)
static BOOLEAN | numdim (leftv res, leftv args)
static void | firstorderdef_setup (SModulFunctions *p)
int SI_MOD_INIT | cohomo (SModulFunctions *p)

## Variables

VAR clock_t | t_begin
VAR clock_t | t_mark
VAR clock_t | t_start
VAR clock_t | t_construct =0
VAR clock_t | t_solve =0
VAR clock_t | t_value =0
VAR clock_t | t_total =0

## Function Documentation

## b_subsets()

std::vector< std::vector< int > > b_subsets | ( | std::vector< int > | vec | ) |

static

Definition at line 493 of file cohomo.cc.

{
std::vector<int> bv;
std::vector<std::vector<int> > vecs;
for(int i=0;i<vec.size();i++)
{
bv.push_back(vec[i]);
vecs.push_back(bv);
bv.clear();
}
//listsprint(vecs);
for(int i=0;i<vecs.size();i++)
{
for(int j=i+1;j<vecs.size();j++)
{
bv=vecUnion(vecs[i], vecs[j]);
if(!vInvsl(bv,vecs))
vecs.push_back(bv);
}
}
//listsprint(vecs);
return(vecs);
}
i
int i
Definition cfEzgcd.cc:132
vInvsl
static bool vInvsl(std::vector< int > vec, std::vector< std::vector< int > > vecs)
Definition cohomo.cc:188
vecUnion
static std::vector< int > vecUnion(std::vector< int > vec1, std::vector< int > vec2)
Definition cohomo.cc:201
vec
fq_nmod_poly_t * vec
Definition facHensel.cc:108
j
int j
Definition facHensel.cc:110

## boundary()

std::vector< std::vector< int > > boundary | ( | poly | a | ) |

static

Definition at line 3529 of file cohomo.cc.

{
std::vector<int> av=support1(a), vec;
std::vector<std::vector<int> > vecs;
vecs=b_subsets(av);
vecs.push_back(vec);
vecs=vsMinusv(vecs, av);
return vecs;
}
vsMinusv
static std::vector< std::vector< int > > vsMinusv(std::vector< std::vector< int > > vecs, std::vector< int > vec)
Definition cohomo.cc:225
support1
static std::vector< int > support1(poly p)
Definition cohomo.cc:268
b_subsets
static std::vector< std::vector< int > > b_subsets(std::vector< int > vec)
Definition cohomo.cc:493

## bprime()

BOOLEAN bprime | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4394 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
res->rtyp =IDEAL_CMD;
res->data =idMaken(bsubsets_1(p));
return FALSE;
}
return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
p
int p
Definition cfModGcd.cc:4086
idMaken
static ideal idMaken(std::vector< std::vector< int > > vecs)
Definition cohomo.cc:476
bsubsets_1
static std::vector< std::vector< int > > bsubsets_1(poly b)
Definition cohomo.cc:3572
res
CanonicalForm res
Definition facAbsFact.cc:60
IDEAL_CMD
@ IDEAL_CMD
Definition grammar.cc:285
POLY_CMD
@ POLY_CMD
Definition grammar.cc:290
h
STATIC_VAR Poly * h
Definition janet.cc:971
NULL
#define NULL
Definition omList.c:12
leftv
sleftv * leftv
Definition structs.h:53

## bsubsets_1()

std::vector< std::vector< int > > bsubsets_1 | ( | poly | b | ) |

static

Definition at line 3572 of file cohomo.cc.

{
std::vector<int> bvs=support1(b), vs;
std::vector<std::vector<int> > bset;
for(unsigned i=0;i<bvs.size();i++)
{
for(unsigned j=0;j!=i; j++)
{
vs.push_back(bvs[j]);
}
bset.push_back(vs);
vs.resize(0);
}
return bset;
}
b
CanonicalForm b
Definition cfModGcd.cc:4111

## c_New()

ideal c_New | ( | ideal | Io,
|  | ideal | sig )

static

Definition at line 3334 of file cohomo.cc.

{
std::vector<std::vector<int> > vs1=p_constant(Io, sig), vs2=p_change(sig), vs3=p_new(Io, sig), vsig=supports(sig), vs;
std::vector<int> ev;
int ednum=vsig.size();
if(ednum==2)
{
vsig.push_back(commonedge(sig->m[0], sig->m[1]));
}
else if(ednum==3)
{
for(int i=0;i<IDELEMS(sig);i++)
{
for(int j=i+1;j<IDELEMS(sig);j++)
{
ev=commonedge(sig->m[i], sig->m[j]);
if(ev.size()==2)
{
vsig.push_back(ev);
}
}
}
}
//PrintS("the first part is:\n");id_print(idMaken(vs1));
//PrintS("the second part is:\n");id_print(idMaken(vsig));
//PrintS("the third part is:\n");id_print(idMaken(vs3));
vs2=vsMinusvs(vs2, vsig);
//PrintS("the constant part2 is:\n");id_print(idMaken(vs2));
vs=vsUnion(vs2, vs1);
//PrintS("the constant part is:\n");id_print(idMaken(vs));
vs=vsUnion(vs, vs3);
//PrintS("the whole part is:\n");id_print(idMaken(vs));
return(idMaken(vs));
}
commonedge
static std::vector< int > commonedge(poly p, poly q)
Definition cohomo.cc:3083
vsMinusvs
static std::vector< std::vector< int > > vsMinusvs(std::vector< std::vector< int > > vs1, std::vector< std::vector< int > > vs2)
Definition cohomo.cc:3267
p_new
static std::vector< std::vector< int > > p_new(ideal Xo, ideal Sigma)
Definition cohomo.cc:3303
vsUnion
static std::vector< std::vector< int > > vsUnion(std::vector< std::vector< int > > vs1, std::vector< std::vector< int > > vs2)
Definition cohomo.cc:238
p_change
static std::vector< std::vector< int > > p_change(ideal Sigma)
Definition cohomo.cc:3296
supports
static std::vector< std::vector< int > > supports(ideal h)
Definition cohomo.cc:283
p_constant
static std::vector< std::vector< int > > p_constant(ideal Xo, ideal Sigma)
Definition cohomo.cc:3288
IDELEMS
#define IDELEMS(i)
Definition simpleideals.h:23

## canonicalbase()

std::vector< std::vector< int > > canonicalbase | ( | int | n | ) |

static

Definition at line 1875 of file cohomo.cc.

{
std::vector<std::vector<int> > vecs;
std::vector<int> vec;
int i,j;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(i==j)
vec.push_back(1);
else
vec.push_back(0);
}
vecs.push_back(vec);
vec.clear();
}
return vecs;
}

## cNew()

BOOLEAN cNew | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4446 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h2= (ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =c_New(h1, h2);
return FALSE;
}
}
return TRUE;
}
c_New
static ideal c_New(ideal Io, ideal sig)
Definition cohomo.cc:3334

## cohomo()

int SI_MOD_INIT cohomo | ( | SModulFunctions * | p | ) |

Definition at line 4719 of file cohomo.cc.

{
firstorderdef_setup(p);
return MAX_TOK;
}
firstorderdef_setup
static void firstorderdef_setup(SModulFunctions *p)
Definition cohomo.cc:4666
MAX_TOK
@ MAX_TOK
Definition tok.h:220

## comedg()

BOOLEAN comedg | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3739 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
res->rtyp =INTVEC_CMD;
res->data =edgemat(p,q);
return FALSE;
}
}
return TRUE;
}
edgemat
static intvec * edgemat(poly p, poly q)
Definition cohomo.cc:3094
INTVEC_CMD
@ INTVEC_CMD
Definition tok.h:101

## commonedge()

std::vector< int > commonedge | ( | poly | p,
|  | poly | q )

static

Definition at line 3083 of file cohomo.cc.

{
std::vector<int> ev, fv1= support1(p), fv2= support2(q);
for(unsigned i=0;i<fv1.size();i++)
{
if(IsinL(fv1[i], fv2))
ev.push_back(fv1[i]);
}
return ev;
}
IsinL
static bool IsinL(int a, std::vector< int > vec)
Definition cohomo.cc:137
support2
static std::vector< int > support2(poly p)
Definition cohomo.cc:300

## complementsimplex()

ideal complementsimplex | ( | ideal | h | ) |

static

Definition at line 863 of file cohomo.cc.

{
poly p,e=pOne();
ideal h1=idInit(1,1), pp, h3;
for(int i=1;i<=rVar(currRing);i++)
{
p = pOne(); pSetExp(p, i, 2); pSetm(p);
idInsertPoly(h1, p);
}
idSkipZeroes(h1);
ideal h2=idAdd(h,h1);
idDelete(&h1);
pp=scKBase(1,h2);
h3=pp;
for(int j=2;j<=rVar(currRing);j++)
{
pp=scKBase(j,h2);
ideal old_h3=h3;
h3=idAdd(h3,pp);
idDelete(&old_h3);
idDelete(&pp);
}
idInsertPoly(h3, e);
idSkipZeroes(h3);
return (h3);
}
pp
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f ).
Definition cf_gcd.cc:676
scKBase
ideal scKBase(int deg, ideal s, ideal Q, intvec *mv)
Definition hdegree.cc:1414
idDelete
#define idDelete(H)
delete an ideal
Definition ideals.h:29
idInsertPoly
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted
Definition simpleideals.cc:832
idAdd
ideal idAdd(ideal h1, ideal h2)
h1 + h2
Definition ideals.h:68
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
pSetm
#define pSetm(p)
Definition polys.h:272
pSetExp
#define pSetExp(p, i, v)
Definition polys.h:43
pOne
#define pOne()
Definition polys.h:316
rVar
static short rVar(const ring r)
define rVar(r) (r->N)
Definition ring.h:598
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition simpleideals.cc:35
idSkipZeroes
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
Definition simpleideals.cc:201

## condition2for2nv()

bool condition2for2nv | ( | std::vector< std::vector< int > > | hvs,
|  | std::vector< int > | pv,
|  | std::vector< int > | qv,
|  | std::vector< int > | fv )

static

Definition at line 2450 of file cohomo.cc.

{
std::vector<int> vec=vecUnion(pv,qv);
vec=vecUnion(vec,fv);
if(vInvsl(vec,hvs))
{
//PrintS("condition2for2 yes\n");
return (true);
}
//PrintS("condition2for2 no\n");
return (false);
}

## dim_sim()

int dim_sim | ( | ideal | h | ) |

static

Definition at line 890 of file cohomo.cc.

{
int dim=pTotaldegree(h->m[0]);
for(int i=1; i<IDELEMS(h);i++)
{
if(dim<pTotaldegree(h->m[i]))
{
dim=pTotaldegree(h->m[i]);
}
}
return dim;
}
pTotaldegree
static long pTotaldegree(poly p)
Definition polys.h:283
dim
int dim(ideal I, ring r)
Definition tropicalStrategy.cc:23

## dimsim()

BOOLEAN dimsim | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4633 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
res->rtyp =INT_CMD;
res->data =(void *)(long)dim_sim(h1);
return FALSE;
}
return TRUE;
}
dim_sim
static int dim_sim(ideal h)
Definition cohomo.cc:890
INT_CMD
@ INT_CMD
Definition tok.h:96

## dmat()

intvec * dmat | ( | poly | a,
|  | poly | b )

static

Definition at line 3703 of file cohomo.cc.

{
intvec *m;
int i;
std::vector<int> dg=gdegree(a,b);
int lg=dg.size();
m=new intvec(lg);
if(lg!=0)
{
m=new intvec(lg);
for(i=0;i<lg;i++)
{
(*m)[i]=dg[i];
}
}
return (m);
}
m
int m
Definition cfEzgcd.cc:128
intvec
Definition intvec.h:24
gdegree
static std::vector< int > gdegree(poly a, poly b)
Definition cohomo.cc:3497

## edgemat()

intvec * edgemat | ( | poly | p,
|  | poly | q )

static

Definition at line 3094 of file cohomo.cc.

{
intvec *m;
int i;
std::vector<int> dg=commonedge(p, q);
int lg=dg.size();
m=new intvec(lg);
if(lg!=0)
{
m=new intvec(lg);
for(i=0;i<lg;i++)
{
(*m)[i]=dg[i];
}
}
return (m);
}

## eli1()

std::vector< int > eli1 | ( | std::vector< int > | eq1,
|  | std::vector< int > | eq2 )

static

Definition at line 1018 of file cohomo.cc.

{
int i,j;
std::vector<int> eq;
if(eq1[0]==eq2[0])
{
i=eq1[1];j=eq2[1];
eq.push_back(i);
eq.push_back(j);
}
else
{
eq=eq2;
}
return(eq);
}

## eli2()

std::vector< std::vector< int > > eli2 | ( | int | num,
|  | std::vector< int > | bset,
|  | std::vector< std::vector< int > > | gset )

static

Definition at line 1271 of file cohomo.cc.

{
std::vector<int> badset;
std::vector<std::vector<int> > goodset, solve;
//PrintS("This is the input bset\n");listprint(bset);
//PrintS("This is the input gset\n");listsprint(gset);
if(gset.size()!=0)//gset is not empty
{
//find all the variables which are zeroes
if(bset.size()!=0)//bset is not empty
{
goodset=vAbsorb(bset, gset);//e.g. x_1=0, put x_i into the badset if x_i-x_1=0 or x_1-x_i=0
int m=goodset.size();
badset=goodset[m-1];
goodset.pop_back();
}
else //bset is empty
{
goodset=gset;//badset is empty
}//goodset is already the set which doesn't contain zero variables
//PrintS("This is the badset after absorb \n");listprint(badset);
//PrintS("This is the goodset after absorb \n");listsprint(goodset);
goodset=soleli1(goodset);//get the triangular form of goodset
//PrintS("This is the goodset after triangulization \n");listsprint(goodset);
solve=ofindbases(num,badset,goodset);
}
else
{
solve=ofindbases(num,bset,gset);
}
//PrintS("This is the solution\n");listsprint(solve);
return solve;
}
num
CanonicalForm num(const CanonicalForm &f)
Definition canonicalform.h:337
solve
bool solve(int **extmat, int nrows, int ncols)
Definition cf_linsys.cc:504
ofindbases
static std::vector< std::vector< int > > ofindbases(int num, std::vector< int > bset, std::vector< std::vector< int > > gset)
Definition cohomo.cc:1245
vAbsorb
static std::vector< std::vector< int > > vAbsorb(std::vector< int > bset, std::vector< std::vector< int > > gset)
Definition cohomo.cc:1146
soleli1
static std::vector< std::vector< int > > soleli1(std::vector< std::vector< int > > eqs)
Definition cohomo.cc:1074

## eqsolve1()

BOOLEAN eqsolve1 | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4073 of file cohomo.cc.

{
leftv h=args;int i;
std::vector<int> bset,bs;
std::vector<std::vector<int> > gset;
if((h != NULL)&&(h->Typ() == INT_CMD))
{
int n= (int)(long)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal bi= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal gi= (ideal)h->Data();
for(i=0;i<IDELEMS(bi);i++)
{
bs=support1(bi->m[i]);
if(bs.size()==1)
bset.push_back(bs[0]);
else if(bs.size()==0)
;
else
{
WerrorS("Errors in T^1 Equations Solving!");
usleep(1000000);
assert(false);
}
}
gset=supports2(gi);
res->rtyp =INTVEC_CMD;
std::vector<std::vector<int> > vecs=eli2(n,bset,gset);
res->data =Tmat(vecs);
return FALSE;
}
}
}
return TRUE;
}
eli2
static std::vector< std::vector< int > > eli2(int num, std::vector< int > bset, std::vector< std::vector< int > > gset)
Definition cohomo.cc:1271
Tmat
static intvec * Tmat(std::vector< std::vector< int > > vecs)
Definition cohomo.cc:2271
supports2
static std::vector< std::vector< int > > supports2(ideal h)
Definition cohomo.cc:321
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
assert
#define assert(A)
Definition svd_si.h:3

## equmab()

void equmab | ( | int | num | ) |

static

Definition at line 1641 of file cohomo.cc.

{
int i;
//Print("There are %d new variables for equations solving.\n",num);
ring r=currRing;
char** tt;
coeffs cf=nCopyCoeff(r->cf);
tt=(char**)omAlloc(num*sizeof(char *));
for(i=0; i <num; i++)
{
tt[i] = (char*)omalloc(16);
snprintf (tt[i],16, "t(%d)", i+1);
}
ring R=rDefault(cf,num,tt,ringorder_lp);
idhdl h=enterid(omStrDup("Re"),0,RING_CMD,&IDROOT,FALSE);
IDRING(h)=rCopy(R);
rSetHdl(h);
}
cf
CanonicalForm cf
Definition cfModGcd.cc:4091
nCopyCoeff
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
Definition coeffs.h:439
RING_CMD
@ RING_CMD
Definition grammar.cc:282
enterid
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition ipid.cc:279
IDROOT
#define IDROOT
Definition ipid.h:19
IDRING
#define IDRING(a)
Definition ipid.h:127
rSetHdl
void rSetHdl(idhdl h)
Definition ipshell.cc:5129
coeffs
The main handler for Singular numbers which are suitable for Singular polynomials.
omStrDup
#define omStrDup(s)
Definition omAllocDecl.h:263
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210
omalloc
#define omalloc(size)
Definition omAllocDecl.h:228
rDefault
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
Definition ring.cc:103
rCopy
ring rCopy(ring r)
Definition ring.cc:1737
ringorder_lp
@ ringorder_lp
Definition ring.h:78
idhdl
idrec * idhdl
Definition ring.h:22
R
#define R
Definition sirandom.c:27

## existIn()

int existIn | ( | poly | b,
|  | ideal | Xs )

static

Definition at line 3427 of file cohomo.cc.

{
std::vector<int> bv=support1(pCopy(b));
std::vector<std::vector<int> > xvs=supports(idCopy(Xs)), bs=b_subsets(bv);
bs=vsMinusv(bs, bv);
for(unsigned i=0;i<bs.size();i++)
{
if(!vInvsl(bs[i], xvs))
{
return 1;
}
}
return 0;
}
idCopy
ideal idCopy(ideal A)
Definition ideals.h:60
pCopy
#define pCopy(p)
return a copy of the poly
Definition polys.h:186

## existsub()

BOOLEAN existsub | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4314 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
res->rtyp =INT_CMD;
res->data =(void *)(long)existIn(p, h1);
return FALSE;
}
}
return TRUE;
}
existIn
static int existIn(poly b, ideal Xs)
Definition cohomo.cc:3427

## fa()

BOOLEAN fa | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3814 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == INT_CMD))
{
int d= (int)(long)h->Data();
res->rtyp =IDEAL_CMD;
res->data =finda(h1,q,d);
return FALSE;
}
}
}
return TRUE;
}
finda
static ideal finda(ideal h, poly S, int ddeg)
Definition cohomo.cc:950

## fb()

BOOLEAN fb | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3757 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =findb(h1);
return FALSE;
}
return TRUE;
}
findb
static ideal findb(ideal h)
Definition cohomo.cc:922

## fgp()

BOOLEAN fgp | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3837 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
res->rtyp =INTVEC_CMD;
res->data =gradedpiece1n(h1,p,q);
return FALSE;
}
}
}
return TRUE;
}
gradedpiece1n
static intvec * gradedpiece1n(ideal h, poly a, poly b)
Definition cohomo.cc:2351

## fgpl()

BOOLEAN fgpl | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3860 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == INT_CMD))
{
int d= (int)(long)h->Data();
res->rtyp =INTVEC_CMD;
res->data =gradedpiece1nl(h1,p,q,d);
return FALSE;
}
}
}
}
return TRUE;
}
gradedpiece1nl
static intvec * gradedpiece1nl(ideal h, poly a, poly b, int set)
Definition cohomo.cc:2809

## finda()

ideal finda | ( | ideal | h,
|  | poly | S,
|  | int | ddeg )

static

Definition at line 950 of file cohomo.cc.

{
ideal aset=idInit(1,1);
int deg1=pTotaldegree(S);
int tdeg=deg1+ddeg;
if(tdeg!=0)
{
std::vector<int> v,bv=support1(S),in;
std::vector<std::vector<int> > hvs=supports(h);
ideal ia=id_MaxIdeal(tdeg, currRing);
for(int i=0;i<IDELEMS(ia);i++)
{
v=support1(ia->m[i]);
in=vecIntersection(v,bv);
if(vInvsl(v,hvs)&&in.size()==0)
{
idInsertPoly(aset, ia->m[i]);
ia->m[i]=NULL;
}
}
idSkipZeroes(aset);
idDelete(&ia);
}
else
{
poly e=pOne();
idInsertPoly(aset,e);
}
return(aset);
}
vecIntersection
static std::vector< int > vecIntersection(std::vector< int > p, std::vector< int > q)
Definition cohomo.cc:151
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
id_MaxIdeal
ideal id_MaxIdeal(const ring r)
initialise the maximal ideal (at 0)
Definition simpleideals.cc:98
tdeg
int tdeg(poly p)
Definition walkSupport.cc:35

## findalphan()

std::vector< int > findalphan | ( | std::vector< std::vector< int > > | N,
|  | std::vector< int > | tN )

static

Definition at line 2464 of file cohomo.cc.

{
int i;std::vector<int> alset,vec;
for(i=0;i<N.size();i++)
{
// vec=N[i];
if(!IsinL(i,tN))
{
alset.push_back(i);
}
}
//listprint(alset);
return alset;
}
N
const CanonicalForm CFMap CFMap & N
Definition cfEzgcd.cc:56

## findb()

ideal findb | ( | ideal | h | ) |

static

Definition at line 922 of file cohomo.cc.

{
ideal ib=id_sfmon(h), nonf=id_complement(h), bset=idInit(1,1);
poly e=pOne();
for(int i=0;i<IDELEMS(ib);i++)
{
for(int j=0;j<IDELEMS(nonf);j++)
{
if(p_DivisibleBy(ib->m[i],nonf->m[j],currRing))
{
idInsertPoly(bset, ib->m[i]);
ib->m[i]=NULL;
break;
}
}
}
idInsertPoly(bset,e);
idSkipZeroes(bset);
idDelete(&ib);
idDelete(&nonf);
return bset;
}
id_sfmon
static ideal id_sfmon(ideal h)
Definition cohomo.cc:669
id_complement
static ideal id_complement(ideal h)
Definition cohomo.cc:692
p_DivisibleBy
static BOOLEAN p_DivisibleBy(poly a, poly b, const ring r)
Definition p_polys.h:1921

## firstorderdef_setup()

void firstorderdef_setup | ( | SModulFunctions * | p | ) |

static

Definition at line 4666 of file cohomo.cc.

{
p->iiAddCproc("","mg",FALSE,idsr);
p->iiAddCproc("","gd",FALSE,gd);
p->iiAddCproc("","findbset",FALSE,fb);
p->iiAddCproc("","findaset",FALSE,fa);
p->iiAddCproc("","fgp",FALSE,fgp);
p->iiAddCproc("","fgpl",FALSE,fgpl);
p->iiAddCproc("","idcomplement",FALSE,idcomplement);
p->iiAddCproc("","genst",FALSE,genstt);
p->iiAddCproc("","sgp",FALSE,sgp);
p->iiAddCproc("","sgpl",FALSE,sgpl);
p->iiAddCproc("","Links",FALSE,Links);
p->iiAddCproc("","eqsolve1",FALSE,eqsolve1);
p->iiAddCproc("","pb",FALSE,pb);
p->iiAddCproc("","pa",FALSE,pa);
p->iiAddCproc("","makeSimplex",FALSE,makeSimplex);
p->iiAddCproc("","isSim",FALSE,isSim);
p->iiAddCproc("","nfaces1",FALSE,nfaces1);
p->iiAddCproc("","nfaces2",FALSE,nfaces2);
p->iiAddCproc("","nfaces3",FALSE,nfaces3);
p->iiAddCproc("","comedg",FALSE,comedg);
p->iiAddCproc("","tsets",FALSE,tsets);
p->iiAddCproc("","valency",FALSE,Valency);
p->iiAddCproc("","nab",FALSE,nabvl);
p->iiAddCproc("","tnab",FALSE,tnabvl);
p->iiAddCproc("","mab",FALSE,mabvl);
p->iiAddCproc("","SRideal",FALSE,SRideal);
p->iiAddCproc("","Linkn",FALSE,linkn);
p->iiAddCproc("","Existb",FALSE,existsub);
p->iiAddCproc("","pConstant",FALSE,pConstant);
p->iiAddCproc("","pChange",FALSE,pChange);
p->iiAddCproc("","pNew",FALSE,p_New);
p->iiAddCproc("","pSupport",FALSE,support);
p->iiAddCproc("","psMinusp",FALSE,psMinusp);
p->iiAddCproc("","cNew",FALSE,cNew);
p->iiAddCproc("","isoNumber",FALSE,isoNumber);
p->iiAddCproc("","vsInsec",FALSE,vsIntersec);
p->iiAddCproc("","getnabt",FALSE,nabtvl);
p->iiAddCproc("","idmodulo",FALSE,idModulo);
p->iiAddCproc("","ndegree",FALSE,newDegree);
p->iiAddCproc("","nonf2f",FALSE,nonf2f);
p->iiAddCproc("","ifIsom",FALSE,ifIsomorphism);
p->iiAddCproc("","stellarsubdivision",FALSE,stellarsubdivision);
p->iiAddCproc("","star",FALSE,stars);
p->iiAddCproc("","numdim",FALSE,numdim);
p->iiAddCproc("","dimsim",FALSE,dimsim);
p->iiAddCproc("","bprime",FALSE,bprime);
p->iiAddCproc("","remainpart",FALSE,stellarremain);
p->iiAddCproc("","idminus",FALSE,idminus);
p->iiAddCproc("","time1",FALSE,t1h);
}
fa
static BOOLEAN fa(leftv res, leftv args)
Definition cohomo.cc:3814
pa
static BOOLEAN pa(leftv res, leftv args)
Definition cohomo.cc:3770
tsets
static BOOLEAN tsets(leftv res, leftv args)
Definition cohomo.cc:4115
tnabvl
static BOOLEAN tnabvl(leftv res, leftv args)
Definition cohomo.cc:4171
nfaces1
BOOLEAN nfaces1(leftv res, leftv args)
Definition cohomo.cc:3989
cNew
static BOOLEAN cNew(leftv res, leftv args)
Definition cohomo.cc:4446
comedg
static BOOLEAN comedg(leftv res, leftv args)
Definition cohomo.cc:3739
isoNumber
static BOOLEAN isoNumber(leftv res, leftv args)
Definition cohomo.cc:4536
makeSimplex
static BOOLEAN makeSimplex(leftv res, leftv args)
Definition cohomo.cc:3783
fgp
static BOOLEAN fgp(leftv res, leftv args)
Definition cohomo.cc:3837
stars
static BOOLEAN stars(leftv res, leftv args)
Definition cohomo.cc:4464
newDegree
static BOOLEAN newDegree(leftv res, leftv args)
Definition cohomo.cc:4602
bprime
static BOOLEAN bprime(leftv res, leftv args)
Definition cohomo.cc:4394
pConstant
static BOOLEAN pConstant(leftv res, leftv args)
Definition cohomo.cc:4332
dimsim
static BOOLEAN dimsim(leftv res, leftv args)
Definition cohomo.cc:4633
fgpl
static BOOLEAN fgpl(leftv res, leftv args)
Definition cohomo.cc:3860
psMinusp
static BOOLEAN psMinusp(leftv res, leftv args)
Definition cohomo.cc:4407
SRideal
static BOOLEAN SRideal(leftv res, leftv args)
Definition cohomo.cc:3640
stellarsubdivision
static BOOLEAN stellarsubdivision(leftv res, leftv args)
Definition cohomo.cc:4482
idcomplement
static BOOLEAN idcomplement(leftv res, leftv args)
Definition cohomo.cc:3653
isSim
static BOOLEAN isSim(leftv res, leftv args)
Definition cohomo.cc:3976
gd
static BOOLEAN gd(leftv res, leftv args)
Definition cohomo.cc:3721
nabvl
static BOOLEAN nabvl(leftv res, leftv args)
Definition cohomo.cc:4146
fb
static BOOLEAN fb(leftv res, leftv args)
Definition cohomo.cc:3757
eqsolve1
static BOOLEAN eqsolve1(leftv res, leftv args)
Definition cohomo.cc:4073
numdim
static BOOLEAN numdim(leftv res, leftv args)
Definition cohomo.cc:4646
vsIntersec
static BOOLEAN vsIntersec(leftv res, leftv args)
Definition cohomo.cc:4204
support
static BOOLEAN support(leftv res, leftv args)
Definition cohomo.cc:4381
genstt
static BOOLEAN genstt(leftv res, leftv args)
Definition cohomo.cc:3888
nonf2f
static BOOLEAN nonf2f(leftv res, leftv args)
Definition cohomo.cc:4620
sgpl
static BOOLEAN sgpl(leftv res, leftv args)
Definition cohomo.cc:3934
sgp
static BOOLEAN sgp(leftv res, leftv args)
Definition cohomo.cc:3911
idsr
static BOOLEAN idsr(leftv res, leftv args)
Definition cohomo.cc:3680
linkn
static BOOLEAN linkn(leftv res, leftv args)
Definition cohomo.cc:4281
Valency
static BOOLEAN Valency(leftv res, leftv args)
Definition cohomo.cc:4128
stellarremain
static BOOLEAN stellarremain(leftv res, leftv args)
Definition cohomo.cc:4425
nabtvl
static BOOLEAN nabtvl(leftv res, leftv args)
Definition cohomo.cc:4246
nfaces3
static BOOLEAN nfaces3(leftv res, leftv args)
Definition cohomo.cc:4040
Links
static BOOLEAN Links(leftv res, leftv args)
Definition cohomo.cc:3957
nfaces2
static BOOLEAN nfaces2(leftv res, leftv args)
Definition cohomo.cc:4012
pb
static BOOLEAN pb(leftv res, leftv args)
Definition cohomo.cc:3796
pChange
static BOOLEAN pChange(leftv res, leftv args)
Definition cohomo.cc:4350
idminus
static BOOLEAN idminus(leftv res, leftv args)
Definition cohomo.cc:4518
mabvl
static BOOLEAN mabvl(leftv res, leftv args)
Definition cohomo.cc:4223
ifIsomorphism
static BOOLEAN ifIsomorphism(leftv res, leftv args)
Definition cohomo.cc:4564
existsub
static BOOLEAN existsub(leftv res, leftv args)
Definition cohomo.cc:4314
t1h
static BOOLEAN t1h(leftv res, leftv args)
Definition cohomo.cc:3667
idModulo
ideal idModulo(ideal h2, ideal h1, tHomog hom, intvec **w, matrix *T, GbVariant alg)
Definition ideals.cc:2463
p_New
static poly p_New(const ring, omBin bin)
Definition p_polys.h:666

## freevars()

std::vector< int > freevars | ( | int | n,
|  | std::vector< int > | bset,
|  | std::vector< std::vector< int > > | gset )

static

Definition at line 1107 of file cohomo.cc.

{
int ql=gset.size(), bl=bset.size();
std::vector<int> mvar, fvar;
for(int i=0;i<bl;i++)
{
mvar.push_back(bset[i]);
}
for(int i=0;i<ql;i++)
{
mvar.push_back(gset[i][0]);
}
for(int i=1;i<=n;i++)
{
if(!IsinL(i,mvar))
{
fvar.push_back(i);
}
}
return fvar;
}
mvar
Variable mvar(const CanonicalForm &f)
Definition canonicalform.h:334

## fvarsvalue()

std::vector< int > fvarsvalue | ( | int | vnum,
|  | std::vector< int > | fvars )

static

Definition at line 1130 of file cohomo.cc.

{
std::vector<int> fset=fvars;
for(int i=0;i<fset.size();i++)
{
if(fset[i]==vnum)
{
fset.erase(fset.begin()+i);
break;
}
}
return fset;
}

## gd()

BOOLEAN gd | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3721 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
res->rtyp =INTVEC_CMD;
res->data =dmat(p,q);
return FALSE;
}
}
return TRUE;
}
dmat
static intvec * dmat(poly a, poly b)
Definition cohomo.cc:3703

## gdegree()

std::vector< int > gdegree | ( | poly | a,
|  | poly | b )

static

Definition at line 3497 of file cohomo.cc.

{
int i;
std::vector<int> av,bv;
for(i=1;i<=currRing->N;i++)
{
av.push_back(pGetExp(a,i));
bv.push_back(pGetExp(b,i));
}
std::vector<int> vec=v_minus(av,bv);
//PrintS("The degree is:\n");
//listprint(vec);
return vec;
}
v_minus
static std::vector< int > v_minus(std::vector< int > v1, std::vector< int > v2)
Definition cohomo.cc:3487
pGetExp
#define pGetExp(p, i)
Exponent.
Definition polys.h:42

## gensindex()

std::vector< int > gensindex | ( | ideal | M,
|  | ideal | ids )

static

Definition at line 2298 of file cohomo.cc.

{
int i;
std::vector<int> vec,index;
if(!idIs0(M))
{
std::vector<std::vector<int> > vecs=supports(ids);
for(i=0;i<IDELEMS(M);i++)
{
vec=support1(M->m[i]);
if(vInvsl(vec,vecs))
index.push_back(i);
}
}
return (index);
}
idIs0
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
Definition simpleideals.cc:960
index
static int index(p_Length length, p_Ord ord)
Definition p_Procs_Impl.h:592
M
#define M
Definition sirandom.c:25

## genst()

ideal genst | ( | ideal | h,
|  | poly | a,
|  | poly | b )

static

Definition at line 2551 of file cohomo.cc.

{
std::vector<std::vector<int> > hvs=supports(h),mv,mts;
std::vector<int> av=support1(a), bv=support1(b);
mv=Mabv(h,a,b);
mts=mabtv(hvs,mv,av,bv);
std::vector<std::vector<poly> > pvs=idMakei(mv,mts);
ideal gens=idInit(1,1);
for(unsigned i=0;i<pvs.size();i++)
{
idInsertPoly(gens,pvs[i][0]);
idInsertPoly(gens,pvs[i][1]);
}
idSkipZeroes(gens);
return (gens);
}
mabtv
static std::vector< std::vector< int > > mabtv(std::vector< std::vector< int > > hvs, std::vector< std::vector< int > > Mv, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:2019
idMakei
static std::vector< std::vector< poly > > idMakei(std::vector< std::vector< int > > mv, std::vector< std::vector< int > > vecs)
Definition cohomo.cc:1695
Mabv
static std::vector< std::vector< int > > Mabv(ideal h, poly a, poly b)
Definition cohomo.cc:996

## genstt()

BOOLEAN genstt | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3888 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
res->rtyp =IDEAL_CMD;
res->data =genst(h1,p,q);
return FALSE;
}
}
}
return TRUE;
}
genst
static ideal genst(ideal h, poly a, poly b)
Definition cohomo.cc:2551

## getpresolve()

ideal getpresolve | ( | ideal | h | ) |

static

Definition at line 1828 of file cohomo.cc.

{
//ring r=currRing;
//assume (LIB "presolve.lib");
sleftv a;a.Init();
a.rtyp=IDEAL_CMD;a.data=(void*)h;
idhdl solve=ggetid("elimlinearpart");
if(solve==NULL)
{
WerrorS("presolve.lib are not loaded!");
return NULL;
}
BOOLEAN sl=iiMake_proc(solve,NULL,&a);
//PrintS("no errors here\n");
if(sl)
{
WerrorS("error in solve!");
}
lists L=(lists) iiRETURNEXPR.Data();
ideal re=(ideal)L->m[4].CopyD();
//iiRETURNEXPR.CleanUp();
iiRETURNEXPR.Init();
//PrintS("no errors here\n");
//idSkipZeroes(re);
//id_print(re);
return re;
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
sleftv
Class used for (list of) interpreter objects.
Definition subexpr.h:83
sleftv::CopyD
void * CopyD(int t)
Definition subexpr.cc:714
sleftv::rtyp
int rtyp
Definition subexpr.h:91
sleftv::Init
void Init()
Definition subexpr.h:107
sleftv::data
void * data
Definition subexpr.h:88
slists::m
sleftv * m
Definition lists.h:46
ggetid
idhdl ggetid(const char *n)
Definition ipid.cc:581
iiMake_proc
BOOLEAN iiMake_proc(idhdl pn, package pack, leftv args)
Definition iplib.cc:513
iiRETURNEXPR
INST_VAR sleftv iiRETURNEXPR
Definition iplib.cc:483
lists
slists * lists
Definition mpr_numeric.h:146

## getvector()

std::vector< std::vector< int > > getvector | ( | ideal | h,
|  | int | n )

static

Definition at line 1895 of file cohomo.cc.

{
std::vector<int> vec;
std::vector<std::vector<int> > vecs;
ideal h2=idCopy(h);
if(!idIs0(h))
{
ideal h1=getpresolve(h2);
poly q,e=pOne();
int lg=IDELEMS(h1),n,i,j,t;
std::vector<int> fvar=numfree(h1);
n=fvar.size();
if(n==0)
{
vec=make0(IDELEMS(h1));vecs.push_back(vec);//listsprint(vecs);
}
else
{
for(t=0;t<n;t++)
{
vec.clear();
for(i=0;i<lg;i++)
{
q=pCopy(h1->m[i]);
//pWrite(q);
if(q==0)
{
vec.push_back(0);
}
else
{
q=p_Subst(q, fvar[t], e,currRing);
//Print("the %dth variable was substituted by 1:\n",fvar[t]);
//pWrite(q);
for(j=0;j<n;j++)
{
//Print("the %dth variable was substituted by 0:\n",fvar[j]);
q=p_Subst(q, fvar[j],0,currRing);
//pWrite(q);
}
if(q==0)
{
vec.push_back(0);
}
else
{
vec.push_back(n_Int(pGetCoeff(q),currRing->cf));
}
}
}
//listprint(vec);
vecs.push_back(vec);
}
}
}
else
{vecs=canonicalbase(n);}
//listsprint(vecs);
return vecs;
}
n_Int
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ....
Definition coeffs.h:550
canonicalbase
static std::vector< std::vector< int > > canonicalbase(int n)
Definition cohomo.cc:1875
getpresolve
static ideal getpresolve(ideal h)
Definition cohomo.cc:1828
make0
static std::vector< int > make0(int n)
Definition cohomo.cc:1205
numfree
static std::vector< int > numfree(ideal h)
Definition cohomo.cc:1856
pGetCoeff
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition monomials.h:44
p_Subst
poly p_Subst(poly p, int n, poly e, const ring r)
Definition p_polys.cc:4084

## gpl()

std::vector< std::vector< int > > gpl | ( | ideal | h,
|  | poly | a,
|  | poly | b )

static

Definition at line 2745 of file cohomo.cc.

{
int co;
std::vector<std::vector<int> > hvs=supports(h),sbv,nv,mv,good,solve;
std::vector<int> av=support1(a), bv=support1(b),index,bad,tnv;
ideal sub=psubset(b);
sbv=supports(sub);
nv=Nabv(hvs,av,bv);
mv=Mabv(h,a,b);
ideal M=idMaken(mv);
index = gensindex(M, idsrRing(h));
unsigned n=nv.size();
ring r=currRing;
t_begin=clock();
if(n > 0)
{
tnv=tnab(hvs,nv,sbv);
for(unsigned i=0;i<tnv.size();i++)
{
co=tnv[i];
bad.push_back(co+1);
}
for(unsigned i=0;i<n;i++)
{
for(unsigned j=i+1;j<n;j++)
{
if(nabtconditionv(hvs,nv[i],nv[j]))
{
good=listsinsertlist(good,i+1,j+1);
}
else
{
;
}
}
}
t_construct=t_construct+clock()-t_begin;
t_begin=clock();
solve=eli2(n,bad,good);
t_solve=t_solve+clock()-t_begin;
if(bv.size()!=1)
{;
}
else
{
std::vector<int> su=make1(n);
std::vector<std::vector<int> > suu;
suu.push_back(su);
equmab(n);
solve=vecqring(solve,suu);
rChangeCurrRing(r);
}
}
else
{
solve.clear();
}
//listsprint(solve);
//sl->show(0,0);
return solve;
}
t_construct
VAR clock_t t_construct
Definition cohomo.cc:2733
tnab
static std::vector< int > tnab(std::vector< std::vector< int > > hvs, std::vector< std::vector< int > > nvs, std::vector< std::vector< int > > bvs)
Definition cohomo.cc:2210
listsinsertlist
static std::vector< std::vector< int > > listsinsertlist(std::vector< std::vector< int > > gset, int a, int b)
Definition cohomo.cc:1585
Nabv
static std::vector< std::vector< int > > Nabv(std::vector< std::vector< int > > hvs, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:2144
psubset
static ideal psubset(poly p)
Definition cohomo.cc:1558
nabtconditionv
static bool nabtconditionv(std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > qv)
Definition cohomo.cc:2161
t_begin
VAR clock_t t_begin
Definition cohomo.cc:2733
make1
static std::vector< int > make1(int n)
Definition cohomo.cc:1217
equmab
static void equmab(int num)
Definition cohomo.cc:1641
vecqring
static std::vector< std::vector< int > > vecqring(std::vector< std::vector< int > > vec1, std::vector< std::vector< int > > vec2)
Definition cohomo.cc:449
gensindex
static std::vector< int > gensindex(ideal M, ideal ids)
Definition cohomo.cc:2298
t_solve
VAR clock_t t_solve
Definition cohomo.cc:2733
idsrRing
static ideal idsrRing(ideal h)
Definition cohomo.cc:753
bad
bool bad
Definition facFactorize.cc:64
rChangeCurrRing
void rChangeCurrRing(ring r)
Definition polys.cc:16

## gpl2()

std::vector< std::vector< int > > gpl2 | ( | ideal | h,
|  | poly | a,
|  | poly | b )

static

Definition at line 2886 of file cohomo.cc.

{
int i,j,t,n;
std::vector<std::vector<int> > hvs=supports(h),sbv,nv,mv,mts,vecs,vars,ntvs,solve;
std::vector<int> av=support1(a), bv=support1(b),vec,var,tnv;
ideal sub=psubset(b);
sbv=supports(sub);
nv=Nabv(hvs,av,bv);
n=nv.size();
tnv=tnab(hvs,nv,sbv);
ring r=currRing;
mv=Mabv(h,a,b);
mts=mabtv(hvs,mv,av,bv);
if(n>0)
{
ntvs=nabtv( hvs, nv, av, bv);
int l=ntvs.size();
if(l>0)
{
for(int t0=0;t0<l;t0++)
{
i=ntvs[t0][0];
j=ntvs[t0][1];
if(tNab(hvs,nv[i],sbv)&&tNab(hvs,nv[j],sbv))//condition 1
{
vec=makeequation(t0+1,0,0);
vecs.push_back(vec);
vec.clear();
}
for(unsigned t1=t0+1;t1<ntvs.size();t1++)
{
for(unsigned t2=t1+1;t2<ntvs.size();t2++)
{
if(ntvs[t0][0]==ntvs[t1][0]&&ntvs[t1][1]==ntvs[t2][1]&&ntvs[t0][1]==ntvs[t2][0])
{
i=ntvs[t0][0];
j=ntvs[t0][1];
t=ntvs[t1][1];
if(condition2for2nv(hvs,nv[i],nv[j],nv[t]))
{
vec=makeequation(t0+1,t1+1,t2+1);
vecs.push_back(vec);
vec.clear();
}
}
}
}
}
if(n==1) {l=1;}
equmab(l);
ideal id_re=idMake3(vecs);
std::vector<std::vector<int> > re=getvector(id_re,l);
rChangeCurrRing(r);
std::vector<std::vector<int> > sub=subspacetn(nv, tnv,ntvs);
equmab(l);
solve=vecqring(re, sub);
rChangeCurrRing(r);
}
else
{
solve.clear();
}
}
else
solve.clear();
return solve;
}
l
int l
Definition cfEzgcd.cc:100
tNab
static bool tNab(std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< std::vector< int > > bvs)
Definition cohomo.cc:2195
condition2for2nv
static bool condition2for2nv(std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > qv, std::vector< int > fv)
Definition cohomo.cc:2450
idMake3
static ideal idMake3(std::vector< std::vector< int > > vecs)
Definition cohomo.cc:1624
makeequation
static std::vector< int > makeequation(int i, int j, int t)
Definition cohomo.cc:1594
subspacetn
static std::vector< std::vector< int > > subspacetn(std::vector< std::vector< int > > N, std::vector< int > tN, std::vector< std::vector< int > > ntvs)
Definition cohomo.cc:2480
getvector
static std::vector< std::vector< int > > getvector(ideal h, int n)
Definition cohomo.cc:1895
nabtv
static std::vector< std::vector< int > > nabtv(std::vector< std::vector< int > > hvs, std::vector< std::vector< int > > Nv, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:2173

## gradedpiece1n()

intvec * gradedpiece1n | ( | ideal | h,
|  | poly | a,
|  | poly | b )

static

Definition at line 2351 of file cohomo.cc.

{
int co;
std::vector<std::vector<int> > hvs=supports(h),mv=Mabv(h,a,b),sbv,nv,good,solve;
std::vector<int> av=support1(a), bv=support1(b), bad, tnv, index;
ideal sub=psubset(b),M;
sbv=supports(sub);
nv=Nabv(hvs,av,bv);
M=idMaken(mv);
index = gensindex(M, idsrRing(h));
unsigned n=nv.size();
ring r=currRing;
if(n > 0)
{
tnv=tnab(hvs,nv,sbv);
for(unsigned i=0;i<tnv.size();i++)
{
co=tnv[i];
bad.push_back(co+1);
}
for(unsigned i=0;i<n;i++)
{
for(unsigned j=i+1;j<n;j++)
{
if(nabtconditionv(hvs,nv[i],nv[j]))
{
good=listsinsertlist(good,i+1,j+1);
}
else
{
;
}
}
}
solve=eli2(n,bad,good);
if(bv.size()!=1)
{;
//PrintS("This is the solution of coefficients:\n");
//listsprint(solve);
}
else
{
std::vector<int> su=make1(n);
std::vector<std::vector<int> > suu;
suu.push_back(su);
equmab(n);
solve=vecqring(solve,suu);
//PrintS("This is the solution of coefficients:\n");
//listsprint(solve);
rChangeCurrRing(r);
}
solve=value1(mv,nv,solve,av,bv);
}
else
{
//PrintS("No element considered here!\n");
solve.clear();
}
//PrintS("This is the solution of final coefficients:\n");
//listsprint(solve);
solve=minisolve(solve,index);
intvec *sl=Tmat(solve);
//sl->show(0,0);
return sl;
}
minisolve
static std::vector< std::vector< int > > minisolve(std::vector< std::vector< int > > solve, std::vector< int > index)
Definition cohomo.cc:2329
value1
static std::vector< std::vector< int > > value1(std::vector< std::vector< int > > mvs, std::vector< std::vector< int > > nvs, std::vector< std::vector< int > > vecs, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:2234

## gradedpiece1nl()

intvec * gradedpiece1nl | ( | ideal | h,
|  | poly | a,
|  | poly | b,
|  | int | set )

static

Definition at line 2809 of file cohomo.cc.

{
t_start=clock();
poly e=pOne();
std::vector<int> av=support1(a),bv=support1(b),index, em;
std::vector<std::vector<int> > solve, hvs=supports(h), lks=links(a,h), mv=Mabv(h,a,b), nvl;
ideal id_links=idMaken(lks);
ideal M=idMaken(mv);
index = gensindex(M, idsrRing(h));
solve=gpl(id_links,e,b);
t_mark=clock();
nvl=Nabv(lks,em,bv);
solve=value1l(mv, nvl , solve, av, bv);
if(set==1)
{
solve=minisolve(solve,index);
}
intvec *sl=Tmat(solve);
t_value=t_value+clock()-t_mark;
t_total=t_total+clock()-t_start;
return sl;
}
value1l
static std::vector< std::vector< int > > value1l(std::vector< std::vector< int > > mvs, std::vector< std::vector< int > > lks, std::vector< std::vector< int > > vecs, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:2701
t_start
VAR clock_t t_start
Definition cohomo.cc:2733
t_mark
VAR clock_t t_mark
Definition cohomo.cc:2733
t_value
VAR clock_t t_value
Definition cohomo.cc:2733
t_total
VAR clock_t t_total
Definition cohomo.cc:2733
gpl
static std::vector< std::vector< int > > gpl(ideal h, poly a, poly b)
Definition cohomo.cc:2745
links
static std::vector< std::vector< int > > links(poly a, ideal h)
Definition cohomo.cc:1310

## gradedpiece2n()

intvec * gradedpiece2n | ( | ideal | h,
|  | poly | a,
|  | poly | b )

static

Definition at line 2568 of file cohomo.cc.

{
int i,j,t,n;
std::vector<std::vector<int> > hvs=supports(h),nv,mv,mts,sbv,vecs,vars,ntvs,solve;
std::vector<int> av=support1(a), bv=support1(b),tnv,vec,var;
ideal sub=psubset(b);
sbv=supports(sub);
nv=Nabv(hvs,av,bv);
n=nv.size();
tnv=tnab(hvs,nv,sbv);
ring r=currRing;
mv=Mabv(h,a,b);
mts=mabtv(hvs,mv,av,bv);
//PrintS("The relations are:\n");
//listsprint(mts);
//PrintS("The homomorphism should map onto:\n");
//lpsprint(idMakei(mv,mts));
if(n>0)
{
ntvs=nabtv( hvs, nv, av, bv);
//PrintS("The current homomorphism map onto###:\n");
//lpsprint(idMakei(nv,ntvs));
int l=ntvs.size();
for(int t0=0;t0<l;t0++)
{
i=ntvs[t0][0];
j=ntvs[t0][1];
if(tNab(hvs,nv[i],sbv)&&tNab(hvs,nv[j],sbv))//condition 1
{
vec=makeequation(t0+1,0,0);
vecs.push_back(vec);
vec.clear();
}
for(unsigned t1=t0+1;t1<ntvs.size();t1++)
{
for(unsigned t2=t1+1;t2<ntvs.size();t2++)
{
if(ntvs[t0][0]==ntvs[t1][0]&&ntvs[t1][1]==ntvs[t2][1]&&ntvs[t0][1]==ntvs[t2][0])
{
i=ntvs[t0][0];
j=ntvs[t0][1];
t=ntvs[t1][1];
if(condition2for2nv(hvs,nv[i],nv[j],nv[t]))
{
vec=makeequation(t0+1,t1+1,t2+1);
vecs.push_back(vec);
vec.clear();
}
}
}
}
}
//PrintS("this is EQUATIONS:\n");
//listsprint(vecs);
if(n==1) l=1;
equmab(l);
ideal id_re=idMake3(vecs);
//id_print(id_re);
std::vector<std::vector<int> > re=getvector(id_re,l);
//PrintS("this is the solution for ideal :\n");
//listsprint(re);
rChangeCurrRing(r);
std::vector<std::vector<int> > sub=subspacetn(nv, tnv,ntvs);
//PrintS("this is the solution for subspace:\n");
//listsprint(sub);
equmab(l);
solve=vecqring(re, sub);
//PrintS("This is the solution of coefficients:\n");
//listsprint(solve);
rChangeCurrRing(r);
solve=value2(mv,nv,mts,ntvs,solve,av,bv);
}
else
solve.clear();
intvec *sl=Tmat(solve);
return sl;
}
value2
static std::vector< std::vector< int > > value2(std::vector< std::vector< int > > mvs, std::vector< std::vector< int > > nvs, std::vector< std::vector< int > > mts, std::vector< std::vector< int > > nts, std::vector< std::vector< int > > vecs, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:2499

## gradedpiece2nl()

intvec * gradedpiece2nl | ( | ideal | h,
|  | poly | a,
|  | poly | b )

static

Definition at line 2954 of file cohomo.cc.

{
poly e=pOne();
std::vector<int> av=support1(a), bv=support1(b), em;
std::vector<std::vector<int> > hvs=supports(h), mv=Mabv(h,a,b),mts,solve,lks,nvl,ntsl;
mts=mabtv(hvs,mv,av,bv);
lks=links(a,h);
ideal id_links=idMaken(lks);
//PrintS("This is the links of a:\n"); id_print(id_links);
nvl=Nabv(lks,em,bv);
//PrintS("This is the N set:\n"); id_print(idMaken(nvl));
ntsl=nabtv(lks,nvl,em,bv);
//PrintS("This is N^2:\n"); listsprint(ntsl);
solve=gpl2(id_links,e,b);
//PrintS("This is pre solution of N:\n"); listsprint(solve);
if(solve.size() > 0)
{
solve=value2l(mv, nvl, mts, ntsl, solve, av, bv);
}
//PrintS("This is solution of N:\n"); listsprint(solve);
intvec *sl=Tmat(solve);
return sl;
}
value2l
static std::vector< std::vector< int > > value2l(std::vector< std::vector< int > > mvs, std::vector< std::vector< int > > lks, std::vector< std::vector< int > > mts, std::vector< std::vector< int > > lkts, std::vector< std::vector< int > > vecs, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:2833
gpl2
static std::vector< std::vector< int > > gpl2(ideal h, poly a, poly b)
Definition cohomo.cc:2886

## id_complement()

ideal id_complement | ( | ideal | h | ) |

static

Definition at line 692 of file cohomo.cc.

{
int vert=idvert(h);
ideal i1=id_sfmon(h);
ideal i3=idInit(1,1);
poly p;
for(int j=0;j<IDELEMS(i1);j++)
{
p=i1->m[j];
if(pvert(p)<=vert)
{
idInsertPoly(i3, pCopy(p));
}
}
ideal i2=idMinus(i3,h);
idDelete(&i3);
idDelete(&i1);
idSkipZeroes(i2);
return (i2);
}
pvert
static int pvert(poly p)
Definition cohomo.cc:535
idvert
static int idvert(ideal h)
Definition cohomo.cc:518
idMinus
static ideal idMinus(ideal h1, ideal h2)
Definition cohomo.cc:609

## id_maxdeg()

int id_maxdeg | ( | ideal | h | ) |

static

Definition at line 740 of file cohomo.cc.

{
int max=pTotaldegree(h->m[0]);
for(int i=1;i<IDELEMS(h);i++)
{
if(pTotaldegree(h->m[i]) > max)
max=pTotaldegree(h->m[i]);
}
return (max);
}
max
static int max(int a, int b)
Definition fast_mult.cc:264

## id_sfmon()

ideal id_sfmon | ( | ideal | h | ) |

static

Definition at line 669 of file cohomo.cc.

{
ideal asfmons,sfmons,mons;
int vert=idvert(h);
mons=id_MaxIdeal(1, currRing);
asfmons=sfreemon(mons,1);
for(int j=2;j<=vert;j++)
{
mons=id_MaxIdeal(j, currRing);
sfmons=sfreemon(mons,j);
idDelete(&mons);
ideal old_asfmons=asfmons;
asfmons=id_Add(asfmons,sfmons,currRing);
idDelete(&sfmons);
idDelete(&old_asfmons);
}
return asfmons;
}
sfreemon
static ideal sfreemon(ideal h, int deg)
Definition cohomo.cc:650
id_Add
ideal id_Add(ideal h1, ideal h2, const ring r)
h1 + h2
Definition simpleideals.cc:906

## idadda()

ideal idadda | ( | ideal | h1,
|  | ideal | h2 )

static

Definition at line 813 of file cohomo.cc.

{
ideal h=idInit(1,1);
for(int i=0;i<IDELEMS(h1);i++)
{
if(!IsInX(h1->m[i],h))
{
idInsertPoly(h, pCopy(h1->m[i]));
}
}
for(int i=0;i<IDELEMS(h2);i++)
{
if(!IsInX(h2->m[i],h))
{
idInsertPoly(h, pCopy(h2->m[i]));
}
}
idSkipZeroes(h);
return h;
}
IsInX
static bool IsInX(poly p, ideal X)
Definition cohomo.cc:715

## idcomplement()

BOOLEAN idcomplement | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3653 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal hh=(ideal)h->Data();
ideal h2= id_complement(hh);
res->rtyp =IDEAL_CMD;
res->data =h2;
return FALSE;
}
return TRUE;
}

## idMake()

ideal idMake | ( | std::vector< std::vector< int > > | vecs | ) |

static

Definition at line 354 of file cohomo.cc.

{
int lv=vecs.size();
poly p;
ideal id_re=idInit(1,1);
for(int i=0;i<lv;i++)
{
p=pMake(vecs[i]);
idInsertPoly(id_re, p);
}
idSkipZeroes(id_re);
return id_re;
}
pMake
static poly pMake(std::vector< int > vbase)
Definition cohomo.cc:338

## idMake3()

ideal idMake3 | ( | std::vector< std::vector< int > > | vecs | ) |

static

Definition at line 1624 of file cohomo.cc.

{
ideal id_re=idInit(1,1);
poly p;
unsigned lv=vecs.size();
for(unsigned i=0;i<lv;i++)
{
p=pMake3(vecs[i]);
idInsertPoly(id_re, p);
}
idSkipZeroes(id_re);
return id_re;
}
pMake3
static poly pMake3(std::vector< int > vbase)
Definition cohomo.cc:1607

## idMakei()

std::vector< std::vector< poly > > idMakei | ( | std::vector< std::vector< int > > | mv,
|  | std::vector< std::vector< int > > | vecs )

static

Definition at line 1695 of file cohomo.cc.

{
int i,lv=vecs.size();
std::vector<std::vector<poly> > re;
std::vector<poly> h;
for(i=0;i<lv;i++)
{
h=pMakei(mv,vecs[i]);
re.push_back(h);
}
//PrintS("This is the metrix M:\n");
//listsprint(vecs);
//PrintS("the ideal according to metrix M is:\n");
return re;
}
pMakei
static std::vector< poly > pMakei(std::vector< std::vector< int > > mv, std::vector< int > vbase)
Definition cohomo.cc:1681

## idMaken()

ideal idMaken | ( | std::vector< std::vector< int > > | vecs | ) |

static

Definition at line 476 of file cohomo.cc.

{
ideal id_re=idInit(1,1);
poly p;
int lv=vecs.size();
for(int i=0;i<lv;i++)
{
p=pMaken(vecs[i]);
idInsertPoly(id_re, p);
}
idSkipZeroes(id_re);
//id_print(id_re);
return id_re;
}
pMaken
static poly pMaken(std::vector< int > vbase)
Definition cohomo.cc:462

## idMinus()

ideal idMinus | ( | ideal | h1,
|  | ideal | h2 )

static

Definition at line 609 of file cohomo.cc.

{
ideal h=idInit(1,1);
int eq=0;
for(int i=0;i<IDELEMS(h1);i++)
{
eq=0;
for(int j=0;j<IDELEMS(h2);j++)
{
if(p_EqualPolys(h1->m[i],h2->m[j], currRing))
{
eq=1;
break;
}
}
if(eq==0)
{
idInsertPoly(h, pCopy(h1->m[i]));
}
}
idSkipZeroes(h);
return h;
}
p_EqualPolys
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition p_polys.cc:4666

## idminus()

BOOLEAN idminus | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4518 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h2= (ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =idMinus(h1, h2);
return FALSE;
}
}
return TRUE;
}

## idMinusp()

ideal idMinusp | ( | ideal | I,
|  | poly | p )

static

Definition at line 3470 of file cohomo.cc.

{
ideal h=idInit(1,1);
int i;
for(i=0;i<IDELEMS(I);i++)
{
if(!p_EqualPolys(I->m[i], p, currRing))
{
idInsertPoly(h, pCopy(I->m[i]));
}
}
idSkipZeroes(h);
return h;
}

## idModulo()

BOOLEAN idModulo | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4500 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h2= (ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =idmodulo(h1, h2);
return FALSE;
}
}
return TRUE;
}
idmodulo
static ideal idmodulo(ideal h1, ideal h2)
Definition cohomo.cc:371

## idmodulo()

ideal idmodulo | ( | ideal | h1,
|  | ideal | h2 )

static

Definition at line 371 of file cohomo.cc.

{
ideal gb=kStd2(h2,NULL,testHomog,NULL,(bigintmat*)NULL,0,0,NULL);
idSkipZeroes(gb);
ideal idq=kNF(gb,NULL,h1);
idSkipZeroes(idq);
idDelete(&gb);
return idq;
}
bigintmat
Matrices of numbers.
Definition bigintmat.h:51
kStd2
ideal kStd2(ideal F, ideal Q, tHomog h, intvec **w, bigintmat *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
generic interface to GB/SB computations, large hilbert vectors
Definition kstd1.cc:2607
kNF
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition kstd1.cc:3229
testHomog
@ testHomog
Definition structs.h:34

## idsr()

BOOLEAN idsr | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3680 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
res->rtyp =IDEAL_CMD;
res->data =mingens(h1,p,q);
return FALSE;
}
}
}
return TRUE;
}
mingens
static ideal mingens(ideal h, poly a, poly b)
Definition cohomo.cc:2315

## idsrRing()

ideal idsrRing | ( | ideal | h | ) |

static

Definition at line 753 of file cohomo.cc.

{
ideal pp,qq,rsr,ppp,hc=idCopy(h);
int i;
for(i=1;i<=rVar(currRing);i++)
{
pp=sfreemon(hc,i);
ideal old_pp=pp;
pp=scKBase(i,pp);//quotient ring (R/I_i)_i
idDelete(&old_pp);
if(!idIs0(pp))
{
old_pp=pp;
pp=sfreemon(pp,i);
idDelete(&old_pp);
rsr=pp;
//Print("This is the first quotient generators %d:\n",i);
//id_print(rsr);
break;
}
}
for(int n=i+1;n<=rVar(currRing);n++)
{
qq=sfreemon(hc,n);
pp=qringadd(qq,rsr,n);
ppp=sfreemon(pp,n);
ideal old_rsr=rsr;
rsr=idAdd(rsr,ppp);
idDelete(&old_rsr);
idDelete(&ppp);
}
idSkipZeroes(rsr);
return rsr;
}
qringadd
static ideal qringadd(ideal h1, ideal h2, int deg)
Definition cohomo.cc:730

## idvert()

int idvert | ( | ideal | h | ) |

static

Definition at line 518 of file cohomo.cc.

{
if(idIs0(h))
return 0;
for(int i=currRing->N;i>0;i--)
{
for(int j=0;j<IDELEMS(h);j++)
{
if(pGetExp(h->m[j],i)>0)
{
return i;
}
}
}
return 0;
}

## ifIso()

int ifIso | ( | poly | p,
|  | poly | q,
|  | poly | f,
|  | poly | g,
|  | poly | a,
|  | poly | b )

static

Definition at line 3459 of file cohomo.cc.

{
std::vector<int> va=support1(a), vb=support1(b), vp=support1(p), vq=support1(q), vf=support1(f), vg=support1(g);
std::vector<int> v1=phimagel(vp, va, vb), v2=phimagel(vq, va, vb), v3=phimagel(vf, va, vb), v4=phimagel(vg, va, vb);
if((vEvl(v1, v3)&& vEvl(v2,v4))||(vEvl(v1, v4)&& vEvl(v2,v3)) )
{
return (1);
}
return (0);
}
g
g
Definition cfModGcd.cc:4098
f
FILE * f
Definition checklibs.c:9
phimagel
static std::vector< int > phimagel(std::vector< int > fv, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:2691
vEvl
static bool vEvl(std::vector< int > vec1, std::vector< int > vec2)
Definition cohomo.cc:176

## ifIsomorphism()

BOOLEAN ifIsomorphism | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4564 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly f= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly g= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly a= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly b= (poly)h->Data();
res->rtyp =INT_CMD;
res->data =(void *)(long)ifIso(p,q,f,g, a, b);
return FALSE;
}
}
}
}
}
}
return TRUE;
}
ifIso
static int ifIso(poly p, poly q, poly f, poly g, poly a, poly b)
Definition cohomo.cc:3459

## IsinL()

bool IsinL | ( | int | a,
|  | std::vector< int > | vec )

static

Definition at line 137 of file cohomo.cc.

{
for(unsigned i=0;i<vec.size();i++)
{
if(a==vec[i])
{
return true;
}
}
return false;
}

## IsInX()

bool IsInX | ( | poly | p,
|  | ideal | X )

static

Definition at line 715 of file cohomo.cc.

{
for(int i=0;i<IDELEMS(X);i++)
{
if(pEqualPolys(p,X->m[i]))
{
//PrintS("yes\n");
return(true);
}
}
//PrintS("no\n");
return(false);
}
pEqualPolys
#define pEqualPolys(p1, p2)
Definition polys.h:400

## isoNum()

int isoNum | ( | poly | p,
|  | ideal | I,
|  | poly | a,
|  | poly | b )

static

Definition at line 3442 of file cohomo.cc.

{
int i;
std::vector<std::vector<int> > vs=supports(idCopy(I));
std::vector<int> v1=support1(a), v2=support1(b), v=support1(p);
std::vector<int> vp, iv=phimagel(v, v1, v2);
for(i=0;i<IDELEMS(I);i++)
{
vp=support1(pCopy(I->m[i]));
if(vEvl(iv, phimagel(vp, v1, v2)))
{
return (i+1);
}
}
return (0);
}

## isoNumber()

BOOLEAN isoNumber | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4536 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly a= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly b= (poly)h->Data();
res->rtyp =INT_CMD;
res->data =(void *)(long)isoNum(p, h1, a, b);
return FALSE;
}
}
}
}
return TRUE;
}
isoNum
static int isoNum(poly p, ideal I, poly a, poly b)
Definition cohomo.cc:3442

## isSim()

BOOLEAN isSim | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3976 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =IsSimplex(h1);
return FALSE;
}
return TRUE;
}
IsSimplex
static ideal IsSimplex(ideal h)
Definition cohomo.cc:837

## IsSimplex()

ideal IsSimplex | ( | ideal | h | ) |

static

Definition at line 837 of file cohomo.cc.

{
int max=id_maxdeg(h);
poly e=pOne();
ideal id_re, id_so=idCopy(h);
for(int i=0;i<IDELEMS(h);i++)
{
id_re=SimFacset(h->m[i]);
if(!idIs0(id_re))
{
ideal old_id_so=id_so;
id_so=idadda(id_so, id_re);//idAdd(id_so,id_re);
idDelete(&old_id_so);
}
idDelete(&id_re);
}
idInsertPoly(id_so,e);
idSkipZeroes(id_so);
ideal res=idMinus(id_so,h);
idDelete(&id_so);
return res;
}
SimFacset
static ideal SimFacset(poly p)
Definition cohomo.cc:789
idadda
static ideal idadda(ideal h1, ideal h2)
Definition cohomo.cc:813
id_maxdeg
static int id_maxdeg(ideal h)
Definition cohomo.cc:740

## keeporder()

std::vector< int > keeporder | ( | std::vector< int > | vec | ) |

static

Definition at line 1061 of file cohomo.cc.

{
std::vector<int> yaya;
int n;
if(vec[0]>vec[1])
{
n=vec[0];
vec[0]=vec[1];
vec[1]=n;
}
return vec;
}

## linkn()

BOOLEAN linkn | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4281 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly a= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal Xo= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal Sigma= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == INT_CMD))
{
int vert= (int)(long)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == INT_CMD))
{
int ord= (int)(long)h->Data();
res->rtyp =IDEAL_CMD;
res->data =idMaken(links_new(a, Xo, Sigma, vert, ord));
return FALSE;
}
}
}
}
}
return TRUE;
}
links_new
static std::vector< std::vector< int > > links_new(poly a, ideal Xo, ideal Sigma, int vert, int ord)
Definition cohomo.cc:3402

## Links()

BOOLEAN Links | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3957 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
res->rtyp =IDEAL_CMD;
std::vector<std::vector<int> > vecs=links(p,h1);
res->data =idMaken(vecs);
return FALSE;
}
}
return TRUE;
}

## links()

std::vector< std::vector< int > > links | ( | poly | a,
|  | ideal | h )

static

Definition at line 1310 of file cohomo.cc.

{
std::vector<std::vector<int> > lk,X=supports(h);
std::vector<int> U,In,av=support1(a);
for(int i=0;i<X.size();i++)
{
U=vecUnion(av,X[i]);
In=vecIntersection(av,X[i]);
if( In.size()==0 && vInvsl(U,X))
{
//PrintS("The union of them is FACE and intersection is EMPTY!\n");
lk.push_back(X[i]);
}
else
{
;
}
}
return lk;
}

## links_new()

std::vector< std::vector< int > > links_new | ( | poly | a,
|  | ideal | Xo,
|  | ideal | Sigma,
|  | int | vert,
|  | int | ord )

static

Definition at line 3402 of file cohomo.cc.

{
std::vector<int> av=support1(a);
std::vector<std::vector<int> > lko, lkn, lk1, lk2;
lko=links(a, Xo);
if(ord==1)
return lko;
if(ord==2)
{
lk1=phi1(a, Sigma);
lk2=phi2(a, Xo, Sigma);
lkn=vsMinusvs(lko, lk1);
lkn=vsUnion(lkn, lk2);
return lkn;
}
if(ord==3)
{
lkn=phi2(a, Xo, Sigma);
return lkn;
}
WerrorS("Cannot find the links smartly!");
return lko;
}
phi1
static std::vector< std::vector< int > > phi1(poly a, ideal Sigma)
Definition cohomo.cc:3369
phi2
static std::vector< std::vector< int > > phi2(poly a, ideal Xo, ideal Sigma)
Definition cohomo.cc:3385

## listsinsertlist()

std::vector< std::vector< int > > listsinsertlist | ( | std::vector< std::vector< int > > | gset,
|  | int | a,
|  | int | b )

static

Definition at line 1585 of file cohomo.cc.

{
std::vector<int> eq;
eq.push_back(a);
eq.push_back(b);
gset.push_back(eq);
return gset;
}

## mabconditionv()

bool mabconditionv | ( | std::vector< std::vector< int > > | hvs,
|  | std::vector< int > | pv,
|  | std::vector< int > | av,
|  | std::vector< int > | bv )

static

Definition at line 984 of file cohomo.cc.

{
std::vector<int> uv=vecUnion(pv,av);
uv=vecMinus(uv,bv);
if(vInvsl(uv,hvs))
{
return(true);
}
return(false);
}
vecMinus
static std::vector< int > vecMinus(std::vector< int > vec1, std::vector< int > vec2)
Definition cohomo.cc:212

## mabtv()

std::vector< std::vector< int > > mabtv | ( | std::vector< std::vector< int > > | hvs,
|  | std::vector< std::vector< int > > | Mv,
|  | std::vector< int > | av,
|  | std::vector< int > | bv )

static

Definition at line 2019 of file cohomo.cc.

{
std::vector<int> v1,var;
std::vector<std::vector<int> > vars;
for(unsigned i=0;i<Mv.size();i++)
{
for(unsigned j=i+1;j<Mv.size();j++)
{
var.clear();
v1=vecUnion(Mv[i],Mv[j]);
if(mabconditionv(hvs, v1, av, bv))
{
var.push_back(i);
var.push_back(j);
vars.push_back(var);
}
}
}
return vars;
}
mabconditionv
static bool mabconditionv(std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:984

## Mabv()

std::vector< std::vector< int > > Mabv | ( | ideal | h,
|  | poly | a,
|  | poly | b )

static

Definition at line 996 of file cohomo.cc.

{
std::vector<int> av=support1(a), bv=support1(b), pv, vec;
ideal h2=id_complement(h);
std::vector<std::vector<int> > hvs=supports(h), h2v=supports(h2), vecs;
for(unsigned i=0;i<h2v.size();i++)
{
pv=h2v[i];
if(mabconditionv(hvs,pv,av,bv))
{
vecs.push_back(pv);
}
}
idDelete(&h2);
return vecs;
}

## mabvl()

BOOLEAN mabvl | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4223 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
res->rtyp =IDEAL_CMD;
res->data =idMaken(Mabv(h1,p,q));
return FALSE;
}
}
}
return TRUE;
}

## make0()

std::vector< int > make0 | ( | int | n | ) |

static

Definition at line 1205 of file cohomo.cc.

{
std::vector<int> vec;
for(int i=0;i<n;i++)
{
vec.push_back(0);
}
return vec;
}

## make1()

std::vector< int > make1 | ( | int | n | ) |

static

Definition at line 1217 of file cohomo.cc.

{
std::vector<int> vec;
for(int i=0;i<n;i++)
{
vec.push_back(1);
}
return vec;
}

## makeequation()

std::vector< int > makeequation | ( | int | i,
|  | int | j,
|  | int | t )

static

Definition at line 1594 of file cohomo.cc.

{
std::vector<int> equation;
equation.push_back(i);
equation.push_back(j);
equation.push_back(t);
//listprint(equation);
return equation;
}

## makeSimplex()

BOOLEAN makeSimplex | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3783 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =complementsimplex(h1);
return FALSE;
}
return TRUE;
}
complementsimplex
static ideal complementsimplex(ideal h)
Definition cohomo.cc:863

## mingens()

ideal mingens | ( | ideal | h,
|  | poly | a,
|  | poly | b )

static

Definition at line 2315 of file cohomo.cc.

{
int i;
std::vector<std::vector<int> > mv=Mabv(h,a,b);
ideal M=idMaken(mv), hi=idInit(1,1);
std::vector<int> index = gensindex(M, idsrRing(h));
for(i=0;i<index.size();i++)
{
idInsertPoly(hi,M->m[index[i]]);
}
idSkipZeroes(hi);
return (hi);
}

## minisolve()

std::vector< std::vector< int > > minisolve | ( | std::vector< std::vector< int > > | solve,
|  | std::vector< int > | index )

static

Definition at line 2329 of file cohomo.cc.

{
int i,j;
std::vector<int> vec,solm;
std::vector<std::vector<int> > solsm;
for(i=0;i<solve.size();i++)
{
vec=solve[i];
for(j=0;j<vec.size();j++)
{
if(IsinL(j,index))
solm.push_back(vec[j]);
}
solsm.push_back(solm);
solm.clear();
}
return (solsm);
}

## nabconditionv()

bool nabconditionv | ( | std::vector< std::vector< int > > | hvs,
|  | std::vector< int > | pv,
|  | std::vector< int > | av,
|  | std::vector< int > | bv )

static

Definition at line 2130 of file cohomo.cc.

{
std::vector<int> vec1=vecIntersection(pv,bv), vec2=vecUnion(pv,bv);
int s1=vec1.size();
if(!vInvsl(vec2,hvs) && s1==0 && vsubset(av,pv))
{
//PrintS("nab condition satisfied\n");
return(true);
}
//PrintS("nab condition not satisfied\n");
return(false);
}
vsubset
static bool vsubset(std::vector< int > vec1, std::vector< int > vec2)
Definition cohomo.cc:163

## nabtconditionv()

bool nabtconditionv | ( | std::vector< std::vector< int > > | hvs,
|  | std::vector< int > | pv,
|  | std::vector< int > | qv )

static

Definition at line 2161 of file cohomo.cc.

{
std::vector<int> v1;
v1=vecUnion(pv,qv);
if(vInvsl(v1,hvs))
{
return (true);
}
return (false);
}

## nabtv()

std::vector< std::vector< int > > nabtv | ( | std::vector< std::vector< int > > | hvs,
|  | std::vector< std::vector< int > > | Nv,
|  | std::vector< int > | av,
|  | std::vector< int > | bv )

static

Definition at line 2173 of file cohomo.cc.

{
std::vector<int> v1,var;
std::vector<std::vector<int> > vars;
for(unsigned i=0;i<Nv.size();i++)
{
for(unsigned j=i+1;j<Nv.size();j++)
{
var.clear();
if(nabtconditionv(hvs, Nv[i], Nv[j]))
{
var.push_back(i);
var.push_back(j);
vars.push_back(var);
}
}
}
return vars;
}

## nabtvl()

BOOLEAN nabtvl | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4246 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
std::vector<std::vector<int> > hvs=supports(h1), nv, ntvs;
std::vector<int> av=support1(p), bv=support1(q);
nv=Nabv(hvs,av,bv);
ntvs=nabtv( hvs, nv, av, bv);
std::vector<std::vector<poly> > pvs=idMakei(nv,ntvs);
ideal gens=idInit(1,1);
for(unsigned i=0;i<pvs.size();i++)
{
idInsertPoly(gens,pvs[i][0]);
idInsertPoly(gens,pvs[i][1]);
}
idSkipZeroes(gens);
res->rtyp =IDEAL_CMD;
res->data =gens;
return FALSE;
}
}
}
return TRUE;
}

## Nabv()

std::vector< std::vector< int > > Nabv | ( | std::vector< std::vector< int > > | hvs,
|  | std::vector< int > | av,
|  | std::vector< int > | bv )

static

Definition at line 2144 of file cohomo.cc.

{
std::vector<std::vector<int> > vecs;
int num=hvs.size();
for(int i=0;i<num;i++)
{
if(nabconditionv(hvs,hvs[i],av,bv))
{
//PrintS("satisfy:\n");
vecs.push_back(hvs[i]);
}
}
return vecs;
}
nabconditionv
static bool nabconditionv(std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:2130

## nabvl()

BOOLEAN nabvl | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4146 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
res->rtyp =IDEAL_CMD;
std::vector<std::vector<int> > vecs=supports(h1);
std::vector<int> pv=support1(p), qv=support1(q);
res->data =idMaken(Nabv(vecs,pv,qv));
return FALSE;
}
}
}
return TRUE;
}

## newDegree()

BOOLEAN newDegree | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4602 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == INT_CMD))
{
int num= (int)(long)h->Data();
res->rtyp =INT_CMD;
res->data =(void *)(long)redefinedeg( p, num);
return FALSE;
}
}
return TRUE;
}
redefinedeg
static int redefinedeg(poly p, int num)
Definition cohomo.cc:1331

## nfaces1()

BOOLEAN nfaces1 | ( | leftv | res,
|  | leftv | args )

Definition at line 3989 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == INT_CMD))
{
int d= (int)(long)h->Data();
res->rtyp =IDEAL_CMD;
res->data =triangulations1(h1, p, d);
return FALSE;
}
}
}
return TRUE;
}
triangulations1
static ideal triangulations1(ideal h, poly p, int vert)
Definition cohomo.cc:3045

## nfaces2()

BOOLEAN nfaces2 | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4012 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == INT_CMD))
{
int d= (int)(long)h->Data();
res->rtyp =IDEAL_CMD;
res->data =triangulations2(h1,p,q,d);
return FALSE;
}
}
}
}
return TRUE;
}
triangulations2
static ideal triangulations2(ideal h, poly p, poly q, int vert)
Definition cohomo.cc:3135

## nfaces3()

BOOLEAN nfaces3 | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4040 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly g= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == INT_CMD))
{
int d= (int)(long)h->Data();
res->rtyp =IDEAL_CMD;
res->data =triangulations3(h1,p,q,g,d);
return FALSE;
}
}
}
}
}
return TRUE;
}
triangulations3
static ideal triangulations3(ideal h, poly p, poly q, poly g, int vert)
Definition cohomo.cc:3194

## nonf2f()

BOOLEAN nonf2f | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4620 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =complementsimplex(h1);
return FALSE;
}
return TRUE;
}

## num4dim()

int num4dim | ( | ideal | h,
|  | int | n )

static

Definition at line 903 of file cohomo.cc.

{
int num=0;
for(int i=0; i<IDELEMS(h); i++)
{
if(pTotaldegree(h->m[i])==n)
{
num++;
}
}
return num;
}

## numdim()

BOOLEAN numdim | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4646 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == INT_CMD))
{
int num= (int)(long)h->Data();
res->rtyp =INT_CMD;
res->data =(void *)(long)num4dim( h1, num);
return FALSE;
}
}
return TRUE;
}
num4dim
static int num4dim(ideal h, int n)
Definition cohomo.cc:903

## numfree()

std::vector< int > numfree | ( | ideal | h | ) |

static

Definition at line 1856 of file cohomo.cc.

{
int i,j;
std::vector<int> fvar;
for(j=1;j<=currRing->N;j++)
{
for(i=0;i<IDELEMS(h);i++)
{
if(vInp(j,h->m[i]))
{
fvar.push_back(j);
break;
}
}
}
//Print("There are %d free variables in total\n",num);
return fvar;
}
vInp
static bool vInp(int m, poly p)
Definition cohomo.cc:402

## ofindbases()

std::vector< std::vector< int > > ofindbases | ( | int | num,
|  | std::vector< int > | bset,
|  | std::vector< std::vector< int > > | gset )

static

Definition at line 1245 of file cohomo.cc.

{
std::vector<std::vector<int> > bases;
std::vector<int> fvars=freevars(num, bset, gset), base1;
if (fvars.size()==0)
{
base1=make0(num);
bases.push_back(base1);
}
else
{
for(unsigned i=0;i<fvars.size();i++)
{
int m=fvars[i];
base1=ofindbases1(num, m, bset, gset);
bases.push_back(base1);
}
}
//PrintS("They are the bases for the solution space:\n");
//listsprint(bases);
return bases;
}
freevars
static std::vector< int > freevars(int n, std::vector< int > bset, std::vector< std::vector< int > > gset)
Definition cohomo.cc:1107
ofindbases1
static std::vector< int > ofindbases1(int num, int vnum, std::vector< int > bset, std::vector< std::vector< int > > gset)
Definition cohomo.cc:1229

## ofindbases1()

std::vector< int > ofindbases1 | ( | int | num,
|  | int | vnum,
|  | std::vector< int > | bset,
|  | std::vector< std::vector< int > > | gset )

static

Definition at line 1229 of file cohomo.cc.

{
std::vector<std::vector<int> > goodset;
std::vector<int> fvars=freevars(num, bset, gset), oset, base;
std::vector<int> zset=fvarsvalue(vnum, fvars);
zset=vecUnion(zset,bset);
oset.push_back(vnum);
goodset=vAbsorb(oset, gset);
oset=goodset[goodset.size()-1];
goodset.pop_back();
base= vecbase1(num, oset);
return base;
}
vecbase1
static std::vector< int > vecbase1(int num, std::vector< int > oset)
Definition cohomo.cc:1190
fvarsvalue
static std::vector< int > fvarsvalue(int vnum, std::vector< int > fvars)
Definition cohomo.cc:1130
CxxTest::base
char N base
Definition ValueTraits.h:144

## p_a()

ideal p_a | ( | ideal | h | ) |

static

Definition at line 1351 of file cohomo.cc.

{
poly p;
int deg=0,deg0;
ideal aset=idCopy(h),ia,h1=idsrRing(h);
//PrintS("idsrRing is:\n");id_print(h1);
std::vector<int> as;
std::vector<std::vector<int> > hvs=supports(h);
for(int i=0;i<IDELEMS(h1);i++)
{
deg0=pTotaldegree(h1->m[i]);
if(deg < deg0)
deg=deg0;
}
idDelete(&h1);
for(int i=2;i<=deg;i++)
{
ia=id_MaxIdeal(i, currRing);
for(int j=0;j<IDELEMS(ia);j++)
{
p=ia->m[j];
if(!IsInX(p,h))
{
as=support1(p);
if(vInvsl(as,hvs))
{
idInsertPoly(aset, p);
ia->m[j]=NULL;
}
}
}
idDelete(&ia);
}
idSkipZeroes(aset);
return(aset);
}

## p_b()

ideal p_b | ( | ideal | h,
|  | poly | a )

static

Definition at line 1445 of file cohomo.cc.

{
std::vector<std::vector<int> > pbv,lk=links(a,h), res;
std::vector<int> vert=vertset(lk), bv;
res=b_subsets(vert);
int adg=pTotaldegree(a);
poly e=pOne();
ideal idd=idInit(1,1);
for(unsigned i=0;i<res.size();i++)
{
if(res[i].size()==adg)
pbv.push_back(res[i]);
}
if(pEqualPolys(a,e))
{
idInsertPoly(idd, e);
idSkipZeroes(idd);
return (idd);
}
pDelete(&e);
idd=idMaken(pbv);
return(idd);
}
size
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition cf_ops.cc:600
vertset
static std::vector< int > vertset(std::vector< std::vector< int > > vecs)
Definition cohomo.cc:1423
pDelete
#define pDelete(p_ptr)
Definition polys.h:187

## p_change()

std::vector< std::vector< int > > p_change | ( | ideal | Sigma | ) |

static

Definition at line 3296 of file cohomo.cc.

{
std::vector<std::vector<int> > ss=supports(idCopy(Sigma)), fvs;
fvs=vs_subsets(ss);
return (fvs);
}
vs_subsets
static std::vector< std::vector< int > > vs_subsets(std::vector< std::vector< int > > vs)
Definition cohomo.cc:3277

## p_constant()

std::vector< std::vector< int > > p_constant | ( | ideal | Xo,
|  | ideal | Sigma )

static

Definition at line 3288 of file cohomo.cc.

{
std::vector<std::vector<int> > xs=supports(idCopy(Xo)), ss=supports(idCopy(Sigma)), fvs1;
fvs1=vs_subsets(ss);
fvs1=vsMinusvs(xs, fvs1);
return fvs1;
}

## p_Ifsfree()

bool p_Ifsfree | ( | poly | P | ) |

static

Definition at line 635 of file cohomo.cc.

{
int sf=1;
for(int i=1;i<=rVar(currRing);i++)
{
if (pGetExp(P,i)>1)
{
sf=0;
break;
}
}
return sf;
}

## p_New()

BOOLEAN p_New | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4363 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h2= (ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =idMaken(p_new(h1,h2));
return FALSE;
}
}
return TRUE;
}

## p_new()

std::vector< std::vector< int > > p_new | ( | ideal | Xo,
|  | ideal | Sigma )

static

Definition at line 3303 of file cohomo.cc.

{
int vert=0;
std::vector<std::vector<int> > ss=supports(idCopy(Sigma)), fvs;
for(int i=1;i<=currRing->N;i++)
{
for(int j=0;j<IDELEMS(Xo);j++)
{
if(pGetExp(Xo->m[j],i)>0)
{
vert=i+1;
break;
}
}
}
int typ=ss.size();
if(typ==1)
{
fvs=triface(Sigma->m[0], vert);
}
else if(typ==2)
{
fvs=tetraface(Sigma->m[0], Sigma->m[1], vert);
}
else
{
fvs=penface(Sigma->m[0], Sigma->m[1], Sigma->m[2], vert);
}
return (fvs);
}
penface
static std::vector< std::vector< int > > penface(poly p, poly q, poly g, int vert)
Definition cohomo.cc:3150
tetraface
static std::vector< std::vector< int > > tetraface(poly p, poly q, int vert)
Definition cohomo.cc:3113
triface
static std::vector< std::vector< int > > triface(poly p, int vert)
Definition cohomo.cc:3026

## pa()

BOOLEAN pa | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3770 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =p_a(h1);
return FALSE;
}
return TRUE;
}
p_a
static ideal p_a(ideal h)
Definition cohomo.cc:1351

## pb()

BOOLEAN pb | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3796 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
res->rtyp =IDEAL_CMD;
res->data =p_b(h1,p);
return FALSE;
}
}
return TRUE;
}
p_b
static ideal p_b(ideal h, poly a)
Definition cohomo.cc:1445

## pChange()

BOOLEAN pChange | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4350 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =idMaken(p_change(h1));
return FALSE;
}
return TRUE;
}

## pcoef()

int pcoef | ( | poly | p,
|  | int | m )

static

Definition at line 383 of file cohomo.cc.

{
int co; poly q=p;
for(int i=1;i<=currRing->N;i++)
{
if(p_GetExp(q,m,currRing)!=0)
{
co=n_Int(pGetCoeff(q),currRing->cf);
return co;
}
else
q=pNext(q);
}
if(q!=NULL)
co=0;
return co;
}
pNext
#define pNext(p)
Definition monomials.h:36
p_GetExp
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition p_polys.h:471

## pConstant()

BOOLEAN pConstant | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4332 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h2= (ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =idMaken(p_constant(h1,h2));
return FALSE;
}
}
return TRUE;
}

## penface()

std::vector< std::vector< int > > penface | ( | poly | p,
|  | poly | q,
|  | poly | g,
|  | int | vert )

static

Definition at line 3150 of file cohomo.cc.

{
int en=0;
std::vector<int> ev1=commonedge(p, q), ev2=commonedge(p, g), ev3=commonedge(q, g), ind, vec, fv1=support1(p), fv2=support1(q), fv3=support1(g);
std::vector<std::vector<int> > fvs1, fvs2, fvs3, fvs, evec;
evec.push_back(ev1);
evec.push_back(ev2);
evec.push_back(ev3);
for(unsigned i=0;i<evec.size();i++)
{
if(evec[i].size()==2)
{
en++;
}
}
if(en==2)
{
vec.push_back(vert);
fvs.push_back(vec);
fvs1=b_subsets(fv1);
fvs2=b_subsets(fv2);
fvs3=b_subsets(fv3);
fvs1=vsMinusv(fvs1, fv1);
fvs2=vsMinusv(fvs2, fv2);
fvs3=vsMinusv(fvs3, fv3);
fvs3=vsUnion(fvs3, fvs2);
fvs3=vsUnion(fvs3, fvs1);
for(unsigned i=0;i<evec.size();i++)
{
if(evec[i].size()==2)
{
fvs3=vsMinusv(fvs3, evec[i]);
}
}
for(unsigned i=0;i<fvs3.size();i++)
{
vec=fvs3[i];
vec.push_back(vert);
fvs.push_back(vec);
}
}
return (fvs);
}

## phi1()

std::vector< std::vector< int > > phi1 | ( | poly | a,
|  | ideal | Sigma )

static

Definition at line 3369 of file cohomo.cc.

{
std::vector<std::vector<int> > ss=supports(idCopy(Sigma)), fvs;
std::vector<int> av=support1(a), intvec, vv;
for(unsigned i=0;i<ss.size();i++)
{
intvec=vecIntersection(ss[i], av);
if(intvec.size()==av.size())
{
vv=vecMinus(ss[i], av);
fvs.push_back(vv);
}
}
return fvs;
}

## phi2()

std::vector< std::vector< int > > phi2 | ( | poly | a,
|  | ideal | Xo,
|  | ideal | Sigma )

static

Definition at line 3385 of file cohomo.cc.

{
std::vector<std::vector<int> > ss=p_new(Sigma, Xo), fvs;
std::vector<int> av=support1(a), intvec, vv;
for(unsigned i=0;i<ss.size();i++)
{
intvec=vecIntersection(ss[i], av);
if(intvec.size()==av.size())
{
vv=vecMinus(ss[i], av);
fvs.push_back(vv);
}
}
return fvs;
}

## phimage()

std::vector< int > phimage | ( | std::vector< int > | pv,
|  | std::vector< int > | av,
|  | std::vector< int > | bv )

static

Definition at line 2225 of file cohomo.cc.

{
std::vector<int> qv=vecUnion(pv,av);
qv=vecMinus(qv,bv);
return qv;
}

## phimagel()

std::vector< int > phimagel | ( | std::vector< int > | fv,
|  | std::vector< int > | av,
|  | std::vector< int > | bv )

static

Definition at line 2691 of file cohomo.cc.

{
std::vector<int> nv;
nv=vecMinus(fv,bv);
nv=vecMinus(nv,av);
return nv;
}

## pMake()

poly pMake | ( | std::vector< int > | vbase | ) |

static

Definition at line 338 of file cohomo.cc.

{
int n=vbase.size(); poly p,q;
q=NULL;
for(int i=0;i<n;i++)
{
if(vbase[i]!=0)
{
p = pOne();pSetExp(p, i+1, 1);pSetm(p);pSetCoeff(p, nInit(vbase[i]));
q = pAdd(q, p);
}
}
return q;
}
nInit
#define nInit(i)
Definition numbers.h:24
pAdd
#define pAdd(p, q)
Definition polys.h:204
pSetCoeff
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition polys.h:32

## pMake3()

poly pMake3 | ( | std::vector< int > | vbase | ) |

static

Definition at line 1607 of file cohomo.cc.

{
int co=1;
poly p,q=NULL;
for(int i=0;i<3;i++)
{
if(vbase[i]!=0)
{
if(i==1) co=-1;
p = pOne();pSetExp(p, vbase[i], 1);pSetm(p);pSetCoeff(p, nInit(co));
q = pAdd(q, p);
}
co=1;
}
return q;
}

## pMakei()

std::vector< poly > pMakei | ( | std::vector< std::vector< int > > | mv,
|  | std::vector< int > | vbase )

static

Definition at line 1681 of file cohomo.cc.

{
poly p;
std::vector<poly> h1;
int n=vbase.size();
for(int i=0;i<n;i++)
{
p=pMaken(mv[vbase[i]]);
h1.push_back(p);
}
return h1;
}

## pMaken()

poly pMaken | ( | std::vector< int > | vbase | ) |

static

Definition at line 462 of file cohomo.cc.

{
int n=vbase.size();
poly p,q=pOne();
for(int i=0;i<n;i++)
{
p = pOne();pSetExp(p, vbase[i], 1);pSetm(p);pSetCoeff(p, nInit(1));
//pWrite(p);
q=p_Mult_q(q,p,currRing);
}
return q;
}
p_Mult_q
static poly p_Mult_q(poly p, poly q, const ring r)
Definition p_polys.h:1125

## psMinusp()

BOOLEAN psMinusp | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4407 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
res->rtyp =IDEAL_CMD;
res->data =idMinusp(h1, p);
return FALSE;
}
}
return TRUE;
}
idMinusp
static ideal idMinusp(ideal I, poly p)
Definition cohomo.cc:3470

## psubset()

ideal psubset | ( | poly | p | ) |

static

Definition at line 1558 of file cohomo.cc.

{
int max=pTotaldegree(p);
ideal h1,mons, id_re=idInit(1,1);
for(int i=1;i<max;i++)
{
mons=id_MaxIdeal(i, currRing);
h1=sfreemon(mons,i);
idDelete(&mons);
for(int j=0;j<IDELEMS(h1);j++)
{
if(p_DivisibleBy(h1->m[j],p,currRing))
{
idInsertPoly(id_re, h1->m[j]);
h1->m[j]=NULL;
}
}
idDelete(&h1);
}
idSkipZeroes(id_re);
//PrintS("This is the facset\n");
//id_print(id_re);
return id_re;
}

## pvert()

int pvert | ( | poly | p | ) |

static

Definition at line 535 of file cohomo.cc.

{
for(int i=currRing->N;i>0;i--)
{
if(pGetExp(p,i)>0)
{
return i;
}
}
return 0;
}

## qringadd()

ideal qringadd | ( | ideal | h1,
|  | ideal | h2,
|  | int | deg )

static

Definition at line 730 of file cohomo.cc.

{
ideal h,qrh;
h=idAdd(h1,h2);
qrh=scKBase(deg,h);
idDelete(&h);
return qrh;
}

## redefinedeg()

int redefinedeg | ( | poly | p,
|  | int | num )

static

Definition at line 1331 of file cohomo.cc.

{
int deg=0, deg0;
for(int i=1;i<=currRing->N;i++)
{
deg0=pGetExp(p, i);
if(i>num)
{
deg= deg+2*deg0;
}
else
{
deg=deg+deg0;
}
}
//Print("the new degree is: %d\n", deg);
return (deg);
}

## sfreemon()

ideal sfreemon | ( | ideal | h,
|  | int | deg )

static

Definition at line 650 of file cohomo.cc.

{
ideal temp=idInit(1,1);
if(!idIs0(h))
{
for(int j=0;j<IDELEMS(h);j++)
{
if(p_Ifsfree(h->m[j])&&(pTotaldegree(h->m[j])==deg))
{
idInsertPoly(temp, pCopy(h->m[j]));
}
}
idSkipZeroes(temp);
}
return temp;
}
p_Ifsfree
static bool p_Ifsfree(poly P)
Definition cohomo.cc:635

## sgp()

BOOLEAN sgp | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3911 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
res->rtyp =INTVEC_CMD;
res->data =gradedpiece2n(h1,p,q);
return FALSE;
}
}
}
return TRUE;
}
gradedpiece2n
static intvec * gradedpiece2n(ideal h, poly a, poly b)
Definition cohomo.cc:2568

## sgpl()

BOOLEAN sgpl | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3934 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
res->rtyp =INTVEC_CMD;
res->data =gradedpiece2nl(h1,p,q);
return FALSE;
}
}
}
return TRUE;
}
gradedpiece2nl
static intvec * gradedpiece2nl(ideal h, poly a, poly b)
Definition cohomo.cc:2954

## SimFacset()

ideal SimFacset | ( | poly | p | ) |

static

Definition at line 789 of file cohomo.cc.

{
int max=pTotaldegree(p);
ideal h1,mons,id_re=idInit(1,1);
for(int i=1;i<max;i++)
{
mons=id_MaxIdeal(i, currRing);
h1=sfreemon(mons,i);
idDelete(&mons);
for(int j=0;j<IDELEMS(h1);j++)
{
if(p_DivisibleBy(h1->m[j],p,currRing))
{
idInsertPoly(id_re, h1->m[j]);
h1->m[j]=NULL;
}
}
idDelete(&h1);
}
idSkipZeroes(id_re);
return id_re;
}

## soleli1()

std::vector< std::vector< int > > soleli1 | ( | std::vector< std::vector< int > > | eqs | ) |

static

Definition at line 1074 of file cohomo.cc.

{
int i;
std::vector<int> yaya;
std::vector<std::vector<int> > pre=eqs, ppre, re;
if(eqs.size()>0)
{
re.push_back(eqs[0]);
pre.erase(pre.begin());
}
while(pre.size()>0)
{
yaya=keeporder(eli1(re[0],pre[0]));
for(i=1;i<re.size();i++)
{
if(!vInvsl(yaya, re))
{
yaya=eli1(re[i],yaya);
yaya=keeporder(yaya);
}
}
if(!vInvsl(yaya, re))
{
re.push_back(yaya);
}
pre.erase(pre.begin());
}
return re;
}
keeporder
static std::vector< int > keeporder(std::vector< int > vec)
Definition cohomo.cc:1061
eli1
static std::vector< int > eli1(std::vector< int > eq1, std::vector< int > eq2)
Definition cohomo.cc:1018

## SRideal()

BOOLEAN SRideal | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3640 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal hh=(ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =idsrRing(hh);
return FALSE;
}
return TRUE;
}

## star()

std::vector< std::vector< int > > star | ( | poly | a,
|  | ideal | h )

static

Definition at line 3514 of file cohomo.cc.

{
std::vector<std::vector<int> > st,X=supports(h);
std::vector<int> U,av=support1(a);
for(unsigned i=0;i<X.size();i++)
{
U=vecUnion(av,X[i]);
if(vInvsl(U,X))
{
st.push_back(X[i]);
}
}
return st;
}

## stars()

BOOLEAN stars | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4464 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =idMaken(star(p, h1));
return FALSE;
}
}
return TRUE;
}
star
static std::vector< std::vector< int > > star(poly a, ideal h)
Definition cohomo.cc:3514

## stellarremain()

BOOLEAN stellarremain | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4425 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
std::vector<std::vector<int> > st=star(p, h1);
std::vector<std::vector<int> > hvs=supports(h1);
std::vector<std::vector<int> > re= vsMinusvs(hvs, st);
res->rtyp =IDEAL_CMD;
res->data =idMaken(re);
return FALSE;
}
}
return TRUE;
}

## stellarsub()

std::vector< std::vector< int > > stellarsub | ( | poly | a,
|  | ideal | h )

static

Definition at line 3539 of file cohomo.cc.

{
std::vector<std::vector<int> > vecs_minus, vecs_plus, lk=links(a,h), hvs=supports(h), sub, bys=boundary(a);
std::vector<int> av=support1(a), vec, vec_n;
int vert=0;
for(int i=1;i<=currRing->N;i++)
{
for(int j=0;j<IDELEMS(h);j++)
{
if(pGetExp(h->m[j],i)>0)
{
vert=i+1;
break;
}
}
}
vec_n.push_back(vert);
for(unsigned i=0;i<lk.size();i++)
{
vec=vecUnion(av, lk[i]);
vecs_minus.push_back(vec);
for(unsigned j=0;j<bys.size();j++)
{
vec=vecUnion(lk[i], vec_n);
vec=vecUnion(vec, bys[j]);
vecs_plus.push_back(vec);
}
}
sub=vsMinusvs(hvs, vecs_minus);
sub=vsUnion(sub, vecs_plus);
return(sub);
}
boundary
static std::vector< std::vector< int > > boundary(poly a)
Definition cohomo.cc:3529

## stellarsubdivision()

BOOLEAN stellarsubdivision | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4482 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h2= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
res->rtyp =IDEAL_CMD;
res->data =idMaken(stellarsub(p, h2));
return FALSE;
}
}
return TRUE;
}
stellarsub
static std::vector< std::vector< int > > stellarsub(poly a, ideal h)
Definition cohomo.cc:3539

## subspacet1()

std::vector< int > subspacet1 | ( | int | num,
|  | std::vector< std::vector< int > > | ntvs )

static

Definition at line 1976 of file cohomo.cc.

{
int i, j, t, n=ntvs.size();
std::vector<int> subase;
for(t=0;t<n;t++)
{
i=ntvs[t][0];
j=ntvs[t][1];
if(i==(num))
{
subase.push_back(1);
}
else if(j==num)
{
subase.push_back(-1);
}
else
{
subase.push_back(0);
}
}
//Print("This is the basis w.r.t. %dth polynomial in alpha set\n",num);
//listprint(subase);
return subase;
}

## subspacetn()

std::vector< std::vector< int > > subspacetn | ( | std::vector< std::vector< int > > | N,
|  | std::vector< int > | tN,
|  | std::vector< std::vector< int > > | ntvs )

static

Definition at line 2480 of file cohomo.cc.

{
int i;
std::vector<int> alset=findalphan(N,tN), subase;
std::vector<std::vector<int> > subases;
for(i=0;i<alset.size();i++)
{
subase=subspacet1(alset[i],ntvs);
subases.push_back(subase);
}
//PrintS("These are the bases for the subspace:\n");
//listsprint(subases);
return subases;
}
subspacet1
static std::vector< int > subspacet1(int num, std::vector< std::vector< int > > ntvs)
Definition cohomo.cc:1976
findalphan
static std::vector< int > findalphan(std::vector< std::vector< int > > N, std::vector< int > tN)
Definition cohomo.cc:2464

## support()

BOOLEAN support | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4381 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
res->rtyp =INT_CMD;
res->data =(void *)(long)(support1(p).size());
return FALSE;
}
return TRUE;
}

## support1()

std::vector< int > support1 | ( | poly | p | ) |

static

Definition at line 268 of file cohomo.cc.

{
std::vector<int> supset;
if(p==NULL) return supset;
for(int j=1;j<=rVar(currRing);j++)
{
if(pGetExp(p,j)>0)
{
supset.push_back(j);
}
}
return (supset);
}

## support2()

std::vector< int > support2 | ( | poly | p | ) |

static

Definition at line 300 of file cohomo.cc.

{
poly q;
std::vector<int> supset;
for(int j=1;j<=rVar(currRing);j++)
{
q=p;
while (q!=NULL)
{
if(p_GetExp(q,j,currRing)!=0)
{
supset.push_back(j);
break;
}
pIter(q);
}
}
return (supset);
}
pIter
#define pIter(p)
Definition monomials.h:37

## supports()

std::vector< std::vector< int > > supports | ( | ideal | h | ) |

static

Definition at line 283 of file cohomo.cc.

{
std::vector<std::vector<int> > vecs;
std::vector<int> vec;
if(!idIs0(h))
{
for(int s=0;s<IDELEMS(h);s++)
{
vec=support1(h->m[s]);
vecs.push_back(vec);
}
}
return vecs;
}
s
const CanonicalForm int s
Definition facAbsFact.cc:51

## supports2()

std::vector< std::vector< int > > supports2 | ( | ideal | h | ) |

static

Definition at line 321 of file cohomo.cc.

{
std::vector<std::vector<int> > vecs;
std::vector<int> vec;
if(!idIs0(h))
{
for(int s=0;s<IDELEMS(h);s++)
{
vec=support2(h->m[s]);
vecs.push_back(vec);
}
}
return vecs;
}

## t1h()

BOOLEAN t1h | ( | leftv | res,
|  | leftv | args )

static

Definition at line 3667 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal hh=(ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =T_1h(hh);
return FALSE;
}
return TRUE;
}
T_1h
static ideal T_1h(ideal h)
Definition cohomo.cc:3589

## T_1h()

ideal T_1h | ( | ideal | h | ) |

static

Definition at line 3589 of file cohomo.cc.

{
int i, j;
//std::vector < intvec > T1;
ideal ai=p_a(h), bi;
//intvec *L;
for(i=0;i<IDELEMS(ai);i++)
{
bi=p_b(h,ai->m[i]);
if(!idIs0(bi))
{
for(j=0;j<IDELEMS(bi);j++)
{
//PrintS("This is for:\n");pWrite(ai->m[i]); pWrite(bi->m[j]);
gradedpiece1nl(h,ai->m[i],bi->m[j], 0);
//PrintS("Succeed!\n");
//T1.push_back(L);
}
}
}
TimeShow(t_construct, t_solve, t_value, t_total);
return h;
}
TimeShow
static void TimeShow(clock_t t_construct, clock_t t_solve, clock_t t_value, clock_t t_total)
Definition cohomo.cc:2736

## tetraface()

std::vector< std::vector< int > > tetraface | ( | poly | p,
|  | poly | q,
|  | int | vert )

static

Definition at line 3113 of file cohomo.cc.

{
std::vector<int> ev=commonedge(p, q), vec, fv1=support1(p), fv2=support1(q);
std::vector<std::vector<int> > fvs1, fvs2, fvs;
vec.push_back(vert);
fvs.push_back(vec);
fvs1=b_subsets(fv1);
fvs2=b_subsets(fv2);
fvs1=vsMinusv(fvs1, fv1);
fvs2=vsMinusv(fvs2, fv2);
fvs2=vsUnion(fvs1, fvs2);
fvs2=vsMinusv(fvs2, ev);
for(unsigned i=0;i<fvs2.size();i++)
{
vec=fvs2[i];
vec.push_back(vert);
fvs.push_back(vec);
}
return (fvs);
}

## TimeShow()

void TimeShow | ( | clock_t | t_construct,
|  | clock_t | t_solve,
|  | clock_t | t_value,
|  | clock_t | t_total )

static

Definition at line 2736 of file cohomo.cc.

{
Print("The time of value matching for first order deformation: %.2f sec ;\n", ((double) t_value)/CLOCKS_PER_SEC);
Print("The total time of fpiece: %.2f sec ;\n", ((double) t_total)/CLOCKS_PER_SEC);
Print("The time of equations construction for fpiece: %.2f sec ;\n", ((double) t_construct)/CLOCKS_PER_SEC);
Print("The total time of equations solving for fpiece: %.2f sec ;\n", ((double) t_solve)/CLOCKS_PER_SEC);
PrintS("__________________________________________________________\n");
}
Print
#define Print
Definition emacs.cc:80
PrintS
void PrintS(const char *s)
Definition reporter.cc:288

## Tmat()

intvec * Tmat | ( | std::vector< std::vector< int > > | vecs | ) |

static

Definition at line 2271 of file cohomo.cc.

{
//std::vector<std::vector<int> > solve=gradedpiece1n(h,a,b);
//Print("the size of solve is: %ld\n",solve.size());
//vtm(solve);
intvec *m;
unsigned a=vecs.size();
if(a==0)
{
m=new intvec(1,1,10);
}
else
{
int b=vecs[0].size();
m=new intvec(a,b,0);
for(unsigned i=1;i<=a;i++)
{
for(unsigned j=1;j<=b;j++)
{
IMATELEM((*m),i,j)=vecs[i-1][j-1];
}
}
}
return (m);
}
IMATELEM
#define IMATELEM(M, I, J)
Definition intvec.h:86

## tNab()

bool tNab | ( | std::vector< std::vector< int > > | hvs,
|  | std::vector< int > | pv,
|  | std::vector< std::vector< int > > | bvs )

static

Definition at line 2195 of file cohomo.cc.

{
std::vector<int> sv;
if(bvs.size()<=1) return false;
for(unsigned i=0;i<bvs.size();i++)
{
sv=vecUnion(pv,bvs[i]);
if(!vInvsl(sv,hvs))
{
return true;
}
}
return false;
}

## tnab()

std::vector< int > tnab | ( | std::vector< std::vector< int > > | hvs,
|  | std::vector< std::vector< int > > | nvs,
|  | std::vector< std::vector< int > > | bvs )

static

Definition at line 2210 of file cohomo.cc.

{
std::vector<int> pv, vec;
for(unsigned j=0;j<nvs.size();j++)
{
pv=nvs[j];
if(tNab(hvs, pv, bvs))
{
vec.push_back(j);
}
}
return vec;
}

## tnabvl()

BOOLEAN tnabvl | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4171 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly q= (poly)h->Data();
std::vector<std::vector<int> > vecs=supports(h1), sbv,tnbr;
std::vector<int> pv=support1(p), qv=support1(q);
std::vector<std::vector<int> > nvs=Nabv(vecs, pv, qv);
ideal sub=psubset(q);
sbv=supports(sub);
std::vector<int> tnv =tnab(vecs,nvs,sbv);
for(unsigned i=0;i<tnv.size();i++)
{
tnbr.push_back(nvs[tnv[i]]);
}
res->rtyp =IDEAL_CMD;
res->data =idMaken(tnbr);
return FALSE;
}
}
}
return TRUE;
}

## triangulations1()

ideal triangulations1 | ( | ideal | h,
|  | poly | p,
|  | int | vert )

static

Definition at line 3045 of file cohomo.cc.

{
std::vector<int> vec, pv=support1(p);
std::vector<std::vector<int> > vecs=supports(h),vs,vs0;
vs0=triface(p,vert);
vecs=vsMinusv(vecs, pv);
vecs=vsUnion(vecs,vs0);
//PrintS("This is the new simplicial complex according to the face \n"); pWrite(p);
//PrintS("is:\n");
//listsprint(vecs);
ideal re=idMaken(vecs);
return re;
}

## triangulations2()

ideal triangulations2 | ( | ideal | h,
|  | poly | p,
|  | poly | q,
|  | int | vert )

static

Definition at line 3135 of file cohomo.cc.

{
std::vector<int> ev, fv1=support1(p), fv2=support1(q);
std::vector<std::vector<int> > vecs=supports(h), vs1;
ev=commonedge(p, q);
vecs=vsMinusv(vecs, ev);
vecs=vsMinusv(vecs,fv1);
vecs=vsMinusv(vecs,fv2);
vs1=tetraface(p, q, vert);
vecs=vsUnion(vecs,vs1);
ideal hh=idMaken(vecs);
return hh;
}

## triangulations3()

ideal triangulations3 | ( | ideal | h,
|  | poly | p,
|  | poly | q,
|  | poly | g,
|  | int | vert )

static

Definition at line 3194 of file cohomo.cc.

{
std::vector<int> ev1=commonedge(p, q), ev2=commonedge(p, g), ev3=commonedge(q, g), fv1=support1(p), fv2=support1(q), fv3=support1(g);
std::vector<std::vector<int> > vecs=supports(h), vs1, evec;
evec.push_back(ev1);
evec.push_back(ev2);
evec.push_back(ev3);
for(unsigned i=0;i<evec.size();i++)
{
if(evec[i].size()==2)
{
vecs=vsMinusv(vecs, evec[i]);
}
}
vecs=vsMinusv(vecs,fv1);
vecs=vsMinusv(vecs,fv2);
vecs=vsMinusv(vecs,fv3);
vs1=penface(p, q, g, vert);
vecs=vsUnion(vecs,vs1);
ideal hh=idMaken(vecs);
return hh;
}

## triface()

std::vector< std::vector< int > > triface | ( | poly | p,
|  | int | vert )

static

Definition at line 3026 of file cohomo.cc.

{
std::vector<int> vec, fv=support1(p);
std::vector<std::vector<int> > fvs0, fvs;
vec.push_back(vert);
fvs.push_back(vec);
fvs0=b_subsets(fv);
fvs0=vsMinusv(fvs0,fv);
for(unsigned i=0;i<fvs0.size();i++)
{
vec=fvs0[i];
vec.push_back(vert);
fvs.push_back(vec);
}
return (fvs);
}

## trisets()

ideal trisets | ( | ideal | h | ) |

static

Definition at line 3010 of file cohomo.cc.

{
int i;
ideal ids=idInit(1,1);
std::vector<int> pv;
for(i=0;i<IDELEMS(h);i++)
{
pv= support1(h->m[i]);
if(pv.size()==3)
idInsertPoly(ids, pCopy(h->m[i]));
}
idSkipZeroes(ids);
return ids;
}

## tsets()

BOOLEAN tsets | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4115 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
res->rtyp =IDEAL_CMD;
res->data =trisets(h1);
return FALSE;
}
return TRUE;
}
trisets
static ideal trisets(ideal h)
Definition cohomo.cc:3010

## v_minus()

std::vector< int > v_minus | ( | std::vector< int > | v1,
|  | std::vector< int > | v2 )

static

Definition at line 3487 of file cohomo.cc.

{
std::vector<int> vec;
for(unsigned i=0;i<v1.size();i++)
{
vec.push_back(v1[i]-v2[i]);
}
return vec;
}

## vAbsorb()

std::vector< std::vector< int > > vAbsorb | ( | std::vector< int > | bset,
|  | std::vector< std::vector< int > > | gset )

static

Definition at line 1146 of file cohomo.cc.

{
std::vector<int> badset=bset;
int m, bl=bset.size(), gl=gset.size();
for(int i=0;i<bl;i++)
{
m=badset[i];
for(int j=0;j<gl;j++)
{
if(gset[j][0]==m && !IsinL(gset[j][1],badset))
{
badset.push_back(gset[j][1]);
gset.erase(gset.begin()+j);
j--;
gl--;
bl++;
}
else if(!IsinL(gset[j][0],badset) && gset[j][1]==m)
{
badset.push_back(gset[j][0]);
gset.erase(gset.begin()+j);
j--;
gl--;
bl++;
}
else if(IsinL(gset[j][0],badset) && IsinL(gset[j][1],badset))
{
gset.erase(gset.begin()+j);
j--;
gl--;
}
else
{
;
}
}
}
if(badset.size()==0) badset.push_back(0);
gset.push_back(badset);
return gset;
}

## Valency()

BOOLEAN Valency | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4128 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == POLY_CMD))
{
poly p= (poly)h->Data();
res->rtyp =INT_CMD;
res->data =(void *)(long)valency(h1,p);
return FALSE;
}
}
return TRUE;
}
valency
static int valency(ideal h, poly p)
Definition cohomo.cc:3219

## valency()

int valency | ( | ideal | h,
|  | poly | p )

static

Definition at line 3219 of file cohomo.cc.

{
int val=0;
std::vector<int> ev=support1(pCopy(p));
int ver=ev[0];
//PrintS("the vertex is :\n"); listprint(p);
std::vector<std::vector<int> > vecs=supports(idCopy(h));
for(unsigned i=0;i<vecs.size();i++)
{
if(vecs[i].size()==2 && IsinL(ver, vecs[i]))
val++;
}
return (val);
}

## value1()

std::vector< std::vector< int > > value1 | ( | std::vector< std::vector< int > > | mvs,
|  | std::vector< std::vector< int > > | nvs,
|  | std::vector< std::vector< int > > | vecs,
|  | std::vector< int > | av,
|  | std::vector< int > | bv )

static

Definition at line 2234 of file cohomo.cc.

{
int j;
std::vector<int> pv, base;
std::vector<std::vector<int> > bases;
for(unsigned t=0;t<vecs.size();t++)
{
for(unsigned i=0;i<mvs.size();i++)
{
pv=phimage(mvs[i],av,bv);
for( j=0;j<nvs.size();j++)
{
if(vEvl(pv,nvs[j]))
{
base.push_back(vecs[t][j]);
break;
}
}
if(j==nvs.size())
{
base.push_back(0);
}
}
if(base.size()!=mvs.size())
{
//WerrorS("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1");
WerrorS("Errors in Equations solving (Values Finding)!");
usleep(1000000);
assert(false);
}
bases.push_back(base);
base.clear();
}
return bases;
}
phimage
static std::vector< int > phimage(std::vector< int > pv, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:2225

## value1l()

std::vector< std::vector< int > > value1l | ( | std::vector< std::vector< int > > | mvs,
|  | std::vector< std::vector< int > > | lks,
|  | std::vector< std::vector< int > > | vecs,
|  | std::vector< int > | av,
|  | std::vector< int > | bv )

static

Definition at line 2701 of file cohomo.cc.

{
std::vector<int> pv;
std::vector<int> base;
std::vector<std::vector<int> > bases;
for(unsigned t=0;t<vecs.size();t++)
{
for(unsigned i=0;i<mvs.size();i++)
{
pv=phimagel(mvs[i], av, bv);
for(unsigned j=0;j<lks.size();j++)
{
if(vEvl(pv,lks[j]))
{
base.push_back(vecs[t][j]);break;
}
}
//if(j==lks.size()) {base.push_back(0);}
}
if(base.size()!=mvs.size())
{
WerrorS("Errors in Values Finding(value1l)!");
usleep(1000000);
assert(false);
}
bases.push_back(base);
base.clear();
}
return bases;
}

## value2()

std::vector< std::vector< int > > value2 | ( | std::vector< std::vector< int > > | mvs,
|  | std::vector< std::vector< int > > | nvs,
|  | std::vector< std::vector< int > > | mts,
|  | std::vector< std::vector< int > > | nts,
|  | std::vector< std::vector< int > > | vecs,
|  | std::vector< int > | av,
|  | std::vector< int > | bv )

static

Definition at line 2499 of file cohomo.cc.

{
int row,col,j;
std::vector<int> pv,qv, base;
std::vector<std::vector<int> > bases;
//PrintS("This is the nabt:\n");
//listsprint(nts);
//PrintS("nabt ends:\n");
//PrintS("This is the mabt:\n");
//listsprint(mts);
//PrintS("mabt ends:\n");
for(unsigned t=0;t<vecs.size();t++)
{
for(unsigned i=0;i<mts.size();i++)
{
row=mts[i][0];
col=mts[i][1];
pv=phimage(mvs[row],av,bv);
qv=phimage(mvs[col],av,bv);
if(vEvl(pv,qv))
base.push_back(0);
else
{
for(j=0;j<nts.size();j++)
{
row=nts[j][0];
col=nts[j][1];
if(vEvl(pv,nvs[row])&&vEvl(qv,nvs[col]))
{
base.push_back(vecs[t][j]);break;
}
else if(vEvl(pv,nvs[col])&&vEvl(qv,nvs[row]))
{
base.push_back(-vecs[t][j]);break;
}
}
if(j==nts.size()) {base.push_back(0);}
}
}
if(base.size()!=mts.size())
{
WerrorS("Errors in Values Finding(value2)!");
//WerrorS("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1");
usleep(1000000);
assert(false);
}
bases.push_back(base);
base.clear();
}
return bases;
}

## value2l()

std::vector< std::vector< int > > value2l | ( | std::vector< std::vector< int > > | mvs,
|  | std::vector< std::vector< int > > | lks,
|  | std::vector< std::vector< int > > | mts,
|  | std::vector< std::vector< int > > | lkts,
|  | std::vector< std::vector< int > > | vecs,
|  | std::vector< int > | av,
|  | std::vector< int > | bv )

static

Definition at line 2833 of file cohomo.cc.

{
std::vector<int> pv,qv,base;
int row,col;
std::vector<std::vector<int> > bases;
if(vecs.size()==0)
{
}
for(unsigned t=0;t<vecs.size();t++)
{
for(unsigned i=0;i<mts.size();i++)
{
row=mts[i][0];
col=mts[i][1];
pv=phimagel(mvs[row],av,bv);
qv=phimagel(mvs[col],av,bv);
if(vEvl(pv,qv))
base.push_back(0);
else
{
for(unsigned j=0;j<lkts.size();j++)
{
row=lkts[j][0];
col=lkts[j][1];
if(vEvl(pv,lks[row])&&vEvl(qv,lks[col]))
{
base.push_back(vecs[t][j]);break;
}
else if(vEvl(qv,lks[row])&&vEvl(pv,lks[col]))
{
base.push_back(-vecs[t][j]);break;
}
}
//if(j==lkts.size())
//{
//base.push_back(0);
//}
}
}
if(base.size()!=mts.size())
{
WerrorS("Errors in Values Finding!");
//WerrorS("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1");
usleep(1000000);
assert(false);
}
bases.push_back(base);
base.clear();
}
return bases;
}

## vecbase1()

std::vector< int > vecbase1 | ( | int | num,
|  | std::vector< int > | oset )

static

Definition at line 1190 of file cohomo.cc.

{
std::vector<int> base;
for(int i=0;i<num;i++)
{
if(IsinL(i+1,oset))
base.push_back(1);
else
base.push_back(0);
}
return base;
}

## vecIntersection()

std::vector< int > vecIntersection | ( | std::vector< int > | p,
|  | std::vector< int > | q )

static

Definition at line 151 of file cohomo.cc.

{
std::vector<int> inte;
for(unsigned i=0;i<p.size();i++)
{
if(IsinL(p[i],q))
inte.push_back(p[i]);
}
return inte;
}

## vecMinus()

std::vector< int > vecMinus | ( | std::vector< int > | vec1,
|  | std::vector< int > | vec2 )

static

Definition at line 212 of file cohomo.cc.

{
std::vector<int> vec;
for(unsigned i=0;i<vec1.size();i++)
{
if(!IsinL(vec1[i],vec2))
{
vec.push_back(vec1[i]);
}
}
return vec;
}

## vecqring()

std::vector< std::vector< int > > vecqring | ( | std::vector< std::vector< int > > | vec1,
|  | std::vector< std::vector< int > > | vec2 )

static

Definition at line 449 of file cohomo.cc.

{
ideal h1=idMake(vec1), h2=idMake(vec2);
ideal h=idmodulo(h1,h2);
idDelete(&h1);
idDelete(&h2);
std::vector<std::vector<int> > vecs= vsMake(h);
return vecs;
}
idMake
static ideal idMake(std::vector< std::vector< int > > vecs)
Definition cohomo.cc:354
vsMake
static std::vector< std::vector< int > > vsMake(ideal h)
Definition cohomo.cc:435

## vecUnion()

std::vector< int > vecUnion | ( | std::vector< int > | vec1,
|  | std::vector< int > | vec2 )

static

Definition at line 201 of file cohomo.cc.

{
std::vector<int> vec=vec1;
for(unsigned i=0;i<vec2.size();i++)
{
if(!IsinL(vec2[i],vec))
vec.push_back(vec2[i]);
}
return vec;
}

## vertset()

std::vector< int > vertset | ( | std::vector< std::vector< int > > | vecs | ) |

static

Definition at line 1423 of file cohomo.cc.

{
std::vector<int> vert;
std::vector<std::vector<int> > vvs;
for(int i=1;i<=currRing->N;i++)
{
for(unsigned j=0;j<vecs.size();j++)
{
if(IsinL(i, vecs[j]))
{
if(!IsinL(i , vert))
{
vert.push_back(i);
}
break;
}
}
}
return (vert);
}

## vEvl()

bool vEvl | ( | std::vector< int > | vec1,
|  | std::vector< int > | vec2 )

static

Definition at line 176 of file cohomo.cc.

{
if(vec1.size()==0 && vec2.size()==0)
return true;
if(vsubset(vec1,vec2)&&vsubset(vec2,vec1))
return true;
return false;
}

## vInp()

bool vInp | ( | int | m,
|  | poly | p )

static

Definition at line 402 of file cohomo.cc.

{
poly q=p;
while (q!=NULL)
{
if(p_GetExp(q,m,currRing)!=0)
{
return true;
}
q=pNext(q);
}
return false;
}

## vInvsl()

bool vInvsl | ( | std::vector< int > | vec,
|  | std::vector< std::vector< int > > | vecs )

static

Definition at line 188 of file cohomo.cc.

{
for(int i=0;i<vecs.size();i++)
{
if(vEvl(vec,vecs[i]))
{
return true;
}
}
return false;
}

## vMake()

std::vector< int > vMake | ( | poly | p | ) |

static

Definition at line 417 of file cohomo.cc.

{
std::vector<int> vbase;
for(int i=1;i<=currRing->N;i++)
{
if(vInp(i,p))
{
vbase.push_back(pcoef(p,i));
}
else
{
vbase.push_back(0);
}
}
return (vbase);
}
pcoef
static int pcoef(poly p, int m)
Definition cohomo.cc:383

## vs_subsets()

std::vector< std::vector< int > > vs_subsets | ( | std::vector< std::vector< int > > | vs | ) |

static

Definition at line 3277 of file cohomo.cc.

{
std::vector<std::vector<int> > sset, bv;
for(unsigned i=0;i<vs.size();i++)
{
bv=b_subsets(vs[i]);
sset=vsUnion(sset, bv);
}
return sset;
}

## vsIntersec()

BOOLEAN vsIntersec | ( | leftv | res,
|  | leftv | args )

static

Definition at line 4204 of file cohomo.cc.

{
leftv h=args;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h1= (ideal)h->Data();
h = h->next;
if((h != NULL)&&(h->Typ() == IDEAL_CMD))
{
ideal h2= (ideal)h->Data();
std::vector<std::vector<int> > vs1=supports(h1), vs2=supports(h2);
res->rtyp =INT_CMD;
res->data =(void *)(long)(vsIntersection(vs1, vs2).size());
return FALSE;
}
}
return TRUE;
}
vsIntersection
static std::vector< std::vector< int > > vsIntersection(std::vector< std::vector< int > > vs1, std::vector< std::vector< int > > vs2)
Definition cohomo.cc:251

## vsIntersection()

std::vector< std::vector< int > > vsIntersection | ( | std::vector< std::vector< int > > | vs1,
|  | std::vector< std::vector< int > > | vs2 )

static

Definition at line 251 of file cohomo.cc.

{
std::vector<std::vector<int> > vs;
for(int i=0;i<vs2.size();i++)
{
if(vInvsl(vs2[i],vs1))
{
vs.push_back(vs2[i]);
}
}
return vs;
}

## vsMake()

std::vector< std::vector< int > > vsMake | ( | ideal | h | ) |

static

Definition at line 435 of file cohomo.cc.

{
std::vector<int> vec;
std::vector<std::vector<int> > vecs;
for(int i=0;i<IDELEMS(h);i++)
{
vec=vMake(h->m[i]);
vecs.push_back(vec);
}
return vecs;
}
vMake
static std::vector< int > vMake(poly p)
Definition cohomo.cc:417

## vsMinusv()

std::vector< std::vector< int > > vsMinusv | ( | std::vector< std::vector< int > > | vecs,
|  | std::vector< int > | vec )

static

Definition at line 225 of file cohomo.cc.

{
std::vector<std::vector<int> > rem;
for(int i=0;i<vecs.size();i++)
{
if(!vEvl(vecs[i],vec))
{
rem.push_back(vecs[i]);
}
}
return (rem);
}
rem
void rem(unsigned long *a, unsigned long *q, unsigned long p, int &dega, int degq)
Definition minpoly.cc:572

## vsMinusvs()

std::vector< std::vector< int > > vsMinusvs | ( | std::vector< std::vector< int > > | vs1,
|  | std::vector< std::vector< int > > | vs2 )

static

Definition at line 3267 of file cohomo.cc.

{
std::vector<std::vector<int> > vs=vs1;
for(unsigned i=0;i<vs2.size();i++)
{
vs=vsMinusv(vs, vs2[i]);
}
return vs;
}

## vsubset()

bool vsubset | ( | std::vector< int > | vec1,
|  | std::vector< int > | vec2 )

static

Definition at line 163 of file cohomo.cc.

{
if(vec1.size()>vec2.size())
return false;
for(int i=0;i<vec1.size();i++)
{
if(!IsinL(vec1[i],vec2))
return false;
}
return true;
}

## vsUnion()

std::vector< std::vector< int > > vsUnion | ( | std::vector< std::vector< int > > | vs1,
|  | std::vector< std::vector< int > > | vs2 )

static

Definition at line 238 of file cohomo.cc.

{
std::vector<std::vector<int> > vs=vs1;
for(int i=0;i<vs2.size();i++)
{
if(!vInvsl(vs2[i],vs))
{
vs.push_back(vs2[i]);
}
}
return vs;
}

## Variable Documentation

## t_begin

VAR clock_t t_begin

Definition at line 2733 of file cohomo.cc.

## t_construct

VAR clock_t t_construct =0

Definition at line 2733 of file cohomo.cc.

## t_mark

VAR clock_t t_mark

Definition at line 2733 of file cohomo.cc.

## t_solve

VAR clock_t t_solve =0

Definition at line 2733 of file cohomo.cc.

## t_start

VAR clock_t t_start

Definition at line 2733 of file cohomo.cc.

## t_total

VAR clock_t t_total =0

Definition at line 2733 of file cohomo.cc.

## t_value

VAR clock_t t_value =0

Definition at line 2733 of file cohomo.cc.