My Project
Loading...
Searching...
No Matches
Functions | Variables
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 "cohomo.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 void listprint (std::vector< int > vec)
 
static void listsprint (std::vector< std::vector< int > > posMat)
 
static void id_print (ideal h)
 
static void lpprint (std::vector< poly > pv)
 
static void lpsprint (std::vector< std::vector< poly > > pvs)
 
static bool IsinL (int a, std::vector< int > vec)
 
static std::vector< intvecIntersection (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< intvecUnion (std::vector< int > vec1, std::vector< int > vec2)
 
static std::vector< intvecMinus (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< intsupport1 (poly p)
 
static std::vector< std::vector< int > > supports (ideal h)
 
static std::vector< intsupport2 (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< intvMake (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< inteli1 (std::vector< int > eq1, std::vector< int > eq2)
 
static std::vector< intkeeporder (std::vector< int > vec)
 
static std::vector< std::vector< int > > soleli1 (std::vector< std::vector< int > > eqs)
 
static std::vector< intfreevars (int n, std::vector< int > bset, std::vector< std::vector< int > > gset)
 
static std::vector< intfvarsvalue (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< intvecbase1 (int num, std::vector< int > oset)
 
static std::vector< intmake0 (int n)
 
static std::vector< intmake1 (int n)
 
static std::vector< intofindbases1 (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< intvertset (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< intmakeequation (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< intsubspace1 (std::vector< std::vector< int > > mv, std::vector< int > bv)
 
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 void gradedpiece1 (ideal h, poly a, poly b)
 
static bool condition1for2 (std::vector< int > pv, std::vector< int > qv, std::vector< int > bv)
 
static bool condition2for2 (std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > qv, std::vector< int > sv, std::vector< int > av, std::vector< int > bv)
 
static bool condition3for2 (std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > qv, std::vector< int > av, std::vector< int > bv)
 
static ideal getpresolve (ideal h)
 
static std::vector< intnumfree (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< intfindalpha (std::vector< std::vector< int > > mv, std::vector< int > bv)
 
static std::vector< intsubspacet1 (int num, std::vector< std::vector< int > > ntvs)
 
static std::vector< std::vector< int > > subspacet (std::vector< std::vector< int > > mv, std::vector< int > bv, 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 void gradedpiece2 (ideal h, poly a, poly b)
 
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< inttnab (std::vector< std::vector< int > > hvs, std::vector< std::vector< int > > nvs, std::vector< std::vector< int > > bvs)
 
static std::vector< intphimage (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 intvecTmat (std::vector< std::vector< int > > vecs)
 
static std::vector< intgensindex (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 intvecgradedpiece1n (ideal h, poly a, poly b)
 
static void T1 (ideal h)
 
static bool condition2for2nv (std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > qv, std::vector< int > fv)
 
static std::vector< intfindalphan (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 intvecgradedpiece2n (ideal h, poly a, poly b)
 
static void T2 (ideal h)
 
static std::vector< intphimagel (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 intvecgradedpiece1nl (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 intvecgradedpiece2nl (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< intcommonedge (poly p, poly q)
 
static intvecedgemat (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< intv_minus (std::vector< int > v1, std::vector< int > v2)
 
static std::vector< intgdegree (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 intvecdmat (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()

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

Definition at line 496 of file cohomo.cc.

497{
498 int i,j;
499 std::vector<int> bv;
500 std::vector<std::vector<int> > vecs;
501 for(i=0;i<vec.size();i++)
502 {
503 bv.push_back(vec[i]);
504 vecs.push_back(bv);
505 bv.clear();
506 }
507 //listsprint(vecs);
508 for(i=0;i<vecs.size();i++)
509 {
510 for(j=i+1;j<vecs.size();j++)
511 {
512 bv=vecUnion(vecs[i], vecs[j]);
513 if(!vInvsl(bv,vecs))
514 vecs.push_back(bv);
515 }
516 }
517 //listsprint(vecs);
518 return(vecs);
519}
int i
Definition cfEzgcd.cc:132
static bool vInvsl(std::vector< int > vec, std::vector< std::vector< int > > vecs)
Definition cohomo.cc:186
static std::vector< int > vecUnion(std::vector< int > vec1, std::vector< int > vec2)
Definition cohomo.cc:200
fq_nmod_poly_t * vec
Definition facHensel.cc:108
int j
Definition facHensel.cc:110

◆ boundary()

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

Definition at line 3488 of file cohomo.cc.

3489{
3490 std::vector<int> av=support1(a), vec;
3491 std::vector<std::vector<int> > vecs;
3492 vecs=b_subsets(av);
3493 vecs.push_back(vec);
3494 vecs=vsMinusv(vecs, av);
3495 return vecs;
3496}
static std::vector< std::vector< int > > vsMinusv(std::vector< std::vector< int > > vecs, std::vector< int > vec)
Definition cohomo.cc:225
static std::vector< int > support1(poly p)
Definition cohomo.cc:271
static std::vector< std::vector< int > > b_subsets(std::vector< int > vec)
Definition cohomo.cc:496

◆ bprime()

static BOOLEAN bprime ( leftv  res,
leftv  args 
)
static

Definition at line 4318 of file cohomo.cc.

4319{
4320 leftv h=args;
4321 if((h != NULL)&&(h->Typ() == POLY_CMD))
4322 {
4323 poly p= (poly)h->Data();
4324 res->rtyp =IDEAL_CMD;
4325 res->data =idMaken(bsubsets_1(p));
4326 }
4327 return false;
4328}
int p
Definition cfModGcd.cc:4078
Class used for (list of) interpreter objects.
Definition subexpr.h:83
static ideal idMaken(std::vector< std::vector< int > > vecs)
Definition cohomo.cc:479
static std::vector< std::vector< int > > bsubsets_1(poly b)
Definition cohomo.cc:3531
CanonicalForm res
Definition facAbsFact.cc:60
@ IDEAL_CMD
Definition grammar.cc:284
@ POLY_CMD
Definition grammar.cc:289
STATIC_VAR Poly * h
Definition janet.cc:971
#define NULL
Definition omList.c:12

◆ bsubsets_1()

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

Definition at line 3531 of file cohomo.cc.

3532{
3533 std::vector<int> bvs=support1(b), vs;
3534 std::vector<std::vector<int> > bset;
3535 for(unsigned i=0;i<bvs.size();i++)
3536 {
3537 for(int j=0;j!=i; j++)
3538 {
3539 vs.push_back(bvs[j]);
3540 }
3541 bset.push_back(vs);
3542 vs.resize(0);
3543 }
3544 return bset;
3545}
CanonicalForm b
Definition cfModGcd.cc:4103

◆ c_New()

static ideal c_New ( ideal  Io,
ideal  sig 
)
static

Definition at line 3292 of file cohomo.cc.

3293{
3294 std::vector<std::vector<int> > vs1=p_constant(Io, sig), vs2=p_change(sig), vs3=p_new(Io, sig), vsig=supports(sig), vs;
3295 std::vector<int> ev;
3296 int ednum=vsig.size();
3297 if(ednum==2)
3298 {
3299 vsig.push_back(commonedge(sig->m[0], sig->m[1]));
3300 }
3301 else if(ednum==3)
3302 {
3303 for(int i=0;i<IDELEMS(sig);i++)
3304 {
3305 for(int j=i+1;j<IDELEMS(sig);j++)
3306 {
3307 ev=commonedge(sig->m[i], sig->m[j]);
3308 if(ev.size()==2)
3309 {
3310 vsig.push_back(ev);
3311 }
3312 }
3313 }
3314 }
3315//PrintS("the first part is:\n");id_print(idMaken(vs1));
3316//PrintS("the second part is:\n");id_print(idMaken(vsig));
3317//PrintS("the third part is:\n");id_print(idMaken(vs3));
3319//PrintS("the constant part2 is:\n");id_print(idMaken(vs2));
3320 vs=vsUnion(vs2, vs1);
3321//PrintS("the constant part is:\n");id_print(idMaken(vs));
3322 vs=vsUnion(vs, vs3);
3323//PrintS("the whole part is:\n");id_print(idMaken(vs));
3324 return(idMaken(vs));
3325}
static std::vector< int > commonedge(poly p, poly q)
Definition cohomo.cc:3041
static std::vector< std::vector< int > > vsMinusvs(std::vector< std::vector< int > > vs1, std::vector< std::vector< int > > vs2)
Definition cohomo.cc:3225
static std::vector< std::vector< int > > p_new(ideal Xo, ideal Sigma)
Definition cohomo.cc:3261
static std::vector< std::vector< int > > vsUnion(std::vector< std::vector< int > > vs1, std::vector< std::vector< int > > vs2)
Definition cohomo.cc:239
static std::vector< std::vector< int > > p_change(ideal Sigma)
Definition cohomo.cc:3254
static std::vector< std::vector< int > > supports(ideal h)
Definition cohomo.cc:287
static std::vector< std::vector< int > > p_constant(ideal Xo, ideal Sigma)
Definition cohomo.cc:3246
#define IDELEMS(i)

◆ canonicalbase()

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

Definition at line 1842 of file cohomo.cc.

1843{
1844 std::vector<std::vector<int> > vecs;
1845 std::vector<int> vec;
1846 int i,j;
1847 for(i=0;i<n;i++)
1848 {
1849 for(j=0;j<n;j++)
1850 {
1851 if(i==j)
1852 vec.push_back(1);
1853 else
1854 vec.push_back(0);
1855 }
1856 vecs.push_back(vec);
1857 vec.clear();
1858 }
1859 return vecs;
1860}

◆ cNew()

static BOOLEAN cNew ( leftv  res,
leftv  args 
)
static

Definition at line 4367 of file cohomo.cc.

4368{
4369 leftv h=args;
4370 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4371 {
4372 ideal h1= (ideal)h->Data();
4373 h = h->next;
4374 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4375 {
4376 ideal h2= (ideal)h->Data();
4377 res->rtyp =IDEAL_CMD;
4378 res->data =c_New(h1, h2);
4379 }
4380 }
4381 return false;
4382}
static ideal c_New(ideal Io, ideal sig)
Definition cohomo.cc:3292

◆ cohomo()

int SI_MOD_INIT() cohomo ( SModulFunctions p)

Definition at line 4629 of file cohomo.cc.

4630{
4632 return MAX_TOK;
4633}
static void firstorderdef_setup(SModulFunctions *p)
Definition cohomo.cc:4576
@ MAX_TOK
Definition tok.h:218

◆ comedg()

static BOOLEAN comedg ( leftv  res,
leftv  args 
)
static

Definition at line 3693 of file cohomo.cc.

3694{
3695 leftv h=args;
3696 if((h != NULL)&&(h->Typ() == POLY_CMD))
3697 {
3698 poly p= (poly)h->Data();
3699 h = h->next;
3700 if((h != NULL)&&(h->Typ() == POLY_CMD))
3701 {
3702 poly q= (poly)h->Data();
3703 res->rtyp =INTVEC_CMD;
3704 res->data =edgemat(p,q);
3705 }
3706 }
3707 return false;
3708}
static intvec * edgemat(poly p, poly q)
Definition cohomo.cc:3052
@ INTVEC_CMD
Definition tok.h:101

◆ commonedge()

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

Definition at line 3041 of file cohomo.cc.

3042{
3043 std::vector<int> ev, fv1= support1(p), fv2= support2(q);
3044 for(unsigned i=0;i<fv1.size();i++)
3045 {
3046 if(IsinL(fv1[i], fv2))
3047 ev.push_back(fv1[i]);
3048 }
3049 return ev;
3050}
static bool IsinL(int a, std::vector< int > vec)
Definition cohomo.cc:132
static std::vector< int > support2(poly p)
Definition cohomo.cc:304

◆ complementsimplex()

static ideal complementsimplex ( ideal  h)
static

Definition at line 853 of file cohomo.cc.

854{
855 int i,j;poly p,e=pOne();
856 ideal h1=idInit(1,1), pp, h3;
857 for(i=1;i<=rVar(currRing);i++)
858 {
859 p = pOne(); pSetExp(p, i, 2); pSetm(p); pSetCoeff(p, nInit(1));
860 idInsertPoly(h1, p);
861 }
863 ideal h2=idAdd(h,h1);
864 pp=scKBase(1,h2);
865 h3=idCopy(pp);
866 for(j=2;j<=rVar(currRing);j++)
867 {
868 pp=scKBase(j,h2);
869 h3=idAdd(h3,pp);
870 }
871 idInsertPoly(h3, e);
873 return (h3);
874}
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition cf_gcd.cc:676
ideal scKBase(int deg, ideal s, ideal Q, intvec *mv)
Definition hdegree.cc:1448
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted
ideal idCopy(ideal A)
Definition ideals.h:60
ideal idAdd(ideal h1, ideal h2)
h1 + h2
Definition ideals.h:68
#define nInit(i)
Definition numbers.h:24
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
#define pSetm(p)
Definition polys.h:271
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition polys.h:31
#define pSetExp(p, i, v)
Definition polys.h:42
#define pOne()
Definition polys.h:315
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition ring.h:592
ideal idInit(int idsize, int rank)
initialise an ideal / module
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size

◆ condition1for2()

static bool condition1for2 ( std::vector< int pv,
std::vector< int qv,
std::vector< int bv 
)
static

Definition at line 1750 of file cohomo.cc.

1751{
1752 std::vector<int > vec=vecUnion(pv,qv);
1753 if(vsubset(bv,vec))
1754 {
1755 //PrintS("condition1for2 yes\n");
1756 return true;
1757 }
1758 //PrintS("condition1for2 no\n");
1759 return false;
1760}
static bool vsubset(std::vector< int > vec1, std::vector< int > vec2)
Definition cohomo.cc:160

◆ condition2for2()

static bool condition2for2 ( std::vector< std::vector< int > >  hvs,
std::vector< int pv,
std::vector< int qv,
std::vector< int sv,
std::vector< int av,
std::vector< int bv 
)
static

Definition at line 1763 of file cohomo.cc.

1764{
1765 std::vector<int> vec=vecUnion(pv,qv);
1766 vec=vecUnion(vec,sv);
1768 {
1769 //PrintS("condition2for2 yes\n");
1770 return (true);
1771 }
1772 //PrintS("condition2for2 no\n");
1773 return (false);
1774}
static bool mabconditionv(std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:963

◆ condition2for2nv()

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

Definition at line 2409 of file cohomo.cc.

2410{
2411 std::vector<int> vec=vecUnion(pv,qv);
2412 vec=vecUnion(vec,fv);
2413 if(vInvsl(vec,hvs))
2414 {
2415 //PrintS("condition2for2 yes\n");
2416 return (true);
2417 }
2418 //PrintS("condition2for2 no\n");
2419 return (false);
2420}

◆ condition3for2()

static bool condition3for2 ( std::vector< std::vector< int > >  hvs,
std::vector< int pv,
std::vector< int qv,
std::vector< int av,
std::vector< int bv 
)
static

Definition at line 1776 of file cohomo.cc.

1777{
1778 std::vector<int> v1,v2,v3;
1779 v1=vecIntersection(pv,qv);//intersection
1780 v2=vecUnion(pv,qv);
1781 v2=vecUnion(v2,av);
1782 v2=vecMinus(v2,bv);
1783 v3=vecUnion(v1,v2);
1784 if(vInvsl(v3,hvs))
1785 {
1786 //PrintS("condition3for2 yes\n");
1787 return(true);
1788 }
1789 //PrintS("condition3for2 no\n");
1790 return(false);
1791}
static std::vector< int > vecIntersection(std::vector< int > p, std::vector< int > q)
Definition cohomo.cc:147
static std::vector< int > vecMinus(std::vector< int > vec1, std::vector< int > vec2)
Definition cohomo.cc:212

◆ dim_sim()

static int dim_sim ( ideal  h)
static

Definition at line 876 of file cohomo.cc.

877{
878 int dim=pTotaldegree(h->m[0]), i;
879 for(i=1; i<IDELEMS(h);i++)
880 {
881 if(dim<pTotaldegree(h->m[i]))
882 {
883 dim=pTotaldegree(h->m[i]);
884 }
885 }
886 return dim;
887}
static long pTotaldegree(poly p)
Definition polys.h:282
int dim(ideal I, ring r)

◆ dimsim()

static BOOLEAN dimsim ( leftv  res,
leftv  args 
)
static

Definition at line 4545 of file cohomo.cc.

4546{
4547 leftv h=args;
4548 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4549 {
4550 ideal h1= (ideal)h->Data();
4551 res->rtyp =INT_CMD;
4552 res->data =(void *)(long)dim_sim(h1);
4553 }
4554 return false;
4555}
static int dim_sim(ideal h)
Definition cohomo.cc:876
@ INT_CMD
Definition tok.h:96

◆ dmat()

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

Definition at line 3658 of file cohomo.cc.

3659{
3660 intvec *m;
3661 int i;
3662 std::vector<int> dg=gdegree(a,b);
3663 int lg=dg.size();
3664 m=new intvec(lg);
3665 if(lg!=0)
3666 {
3667 m=new intvec(lg);
3668 for(i=0;i<lg;i++)
3669 {
3670 (*m)[i]=dg[i];
3671 }
3672 }
3673 return (m);
3674}
int m
Definition cfEzgcd.cc:128
static std::vector< int > gdegree(poly a, poly b)
Definition cohomo.cc:3455

◆ edgemat()

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

Definition at line 3052 of file cohomo.cc.

3053{
3054 intvec *m;
3055 int i;
3056 std::vector<int> dg=commonedge(p, q);
3057 int lg=dg.size();
3058 m=new intvec(lg);
3059 if(lg!=0)
3060 {
3061 m=new intvec(lg);
3062 for(i=0;i<lg;i++)
3063 {
3064 (*m)[i]=dg[i];
3065 }
3066 }
3067 return (m);
3068}

◆ eli1()

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

Definition at line 996 of file cohomo.cc.

997{
998 int i,j;
999 std::vector<int> eq;
1000 if(eq1[0]==eq2[0])
1001 {
1002 i=eq1[1];j=eq2[1];
1003 eq.push_back(i);
1004 eq.push_back(j);
1005 }
1006 else
1007 {
1008 eq=eq2;
1009 }
1010 return(eq);
1011}

◆ eli2()

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

Definition at line 1254 of file cohomo.cc.

1255{
1256 std::vector<int> badset;
1257 std::vector<std::vector<int> > goodset, solve;
1258//PrintS("This is the input bset\n");listprint(bset);
1259//PrintS("This is the input gset\n");listsprint(gset);
1260 if(gset.size()!=0)//gset is not empty
1261 {
1262 //find all the variables which are zeroes
1263
1264 if(bset.size()!=0)//bset is not empty
1265 {
1266 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
1267 int m=goodset.size();
1268 badset=goodset[m-1];
1269 goodset.erase(goodset.end());
1270 }
1271 else //bset is empty
1272 {
1273 goodset=gset;//badset is empty
1274 }//goodset is already the set which doesn't contain zero variables
1275//PrintS("This is the badset after absorb \n");listprint(badset);
1276//PrintS("This is the goodset after absorb \n");listsprint(goodset);
1277 goodset=soleli1(goodset);//get the triangular form of goodset
1278//PrintS("This is the goodset after triangulization \n");listsprint(goodset);
1280 }
1281 else
1282 {
1284 }
1285//PrintS("This is the solution\n");listsprint(solve);
1286 return solve;
1287}
CanonicalForm num(const CanonicalForm &f)
bool solve(int **extmat, int nrows, int ncols)
Definition cf_linsys.cc:504
static std::vector< std::vector< int > > ofindbases(int num, std::vector< int > bset, std::vector< std::vector< int > > gset)
Definition cohomo.cc:1227
static std::vector< std::vector< int > > vAbsorb(std::vector< int > bset, std::vector< std::vector< int > > gset)
Definition cohomo.cc:1125
static std::vector< std::vector< int > > soleli1(std::vector< std::vector< int > > eqs)
Definition cohomo.cc:1052

◆ eqsolve1()

static BOOLEAN eqsolve1 ( leftv  res,
leftv  args 
)
static

Definition at line 4011 of file cohomo.cc.

4012{
4013 leftv h=args;int i;
4014 std::vector<int> bset,bs;
4015 std::vector<std::vector<int> > gset;
4016 if((h != NULL)&&(h->Typ() == INT_CMD))
4017 {
4018 int n= (int)(long)h->Data();
4019 h = h->next;
4020 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4021 {
4022 ideal bi= (ideal)h->Data();
4023 h = h->next;
4024 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4025 {
4026 ideal gi= (ideal)h->Data();
4027 for(i=0;i<IDELEMS(bi);i++)
4028 {
4029 bs=support1(bi->m[i]);
4030 if(bs.size()==1)
4031 bset.push_back(bs[0]);
4032 else if(bs.size()==0)
4033 ;
4034 else
4035 {
4036 WerrorS("Errors in T^1 Equations Solving!");
4037 usleep(1000000);
4038 assert(false);
4039 }
4040
4041 }
4042 gset=supports2(gi);
4043 res->rtyp =INTVEC_CMD;
4044 std::vector<std::vector<int> > vecs=eli2(n,bset,gset);
4045 res->data =Tmat(vecs);
4046 }
4047 }
4048 }
4049 return false;
4050}
static std::vector< std::vector< int > > eli2(int num, std::vector< int > bset, std::vector< std::vector< int > > gset)
Definition cohomo.cc:1254
static intvec * Tmat(std::vector< std::vector< int > > vecs)
Definition cohomo.cc:2232
static std::vector< std::vector< int > > supports2(ideal h)
Definition cohomo.cc:326
void WerrorS(const char *s)
Definition feFopen.cc:24
#define assert(A)
Definition svd_si.h:3

◆ equmab()

static void equmab ( int  num)
static

Definition at line 1618 of file cohomo.cc.

1619{
1620 int i;
1621 //Print("There are %d new variables for equations solving.\n",num);
1622 ring r=currRing;
1623 char** tt;
1624 coeffs cf=nCopyCoeff(r->cf);
1625 tt=(char**)omAlloc(num*sizeof(char *));
1626 for(i=0; i <num; i++)
1627 {
1628 tt[i] = (char*)omalloc(10); //if required enlarge it later
1629 snprintf (tt[i],10, "t(%d)", i+1);
1630 }
1633 IDRING(h)=rCopy(R);
1634 rSetHdl(h);
1635}
#define FALSE
Definition auxiliary.h:96
CanonicalForm cf
Definition cfModGcd.cc:4083
Definition idrec.h:35
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
Definition coeffs.h:430
@ RING_CMD
Definition grammar.cc:281
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition ipid.cc:279
#define IDROOT
Definition ipid.h:19
#define IDRING(a)
Definition ipid.h:127
void rSetHdl(idhdl h)
Definition ipshell.cc:5128
The main handler for Singular numbers which are suitable for Singular polynomials.
#define omStrDup(s)
#define omAlloc(size)
#define omalloc(size)
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:102
ring rCopy(ring r)
Definition ring.cc:1731
@ ringorder_lp
Definition ring.h:77
#define R
Definition sirandom.c:27

◆ existIn()

static int existIn ( poly  b,
ideal  Xs 
)
static

Definition at line 3385 of file cohomo.cc.

3386{
3387 std::vector<int> bv=support1(pCopy(b));
3388 std::vector<std::vector<int> > xvs=supports(idCopy(Xs)), bs=b_subsets(bv);
3389 bs=vsMinusv(bs, bv);
3390 for(unsigned i=0;i<bs.size();i++)
3391 {
3392 if(!vInvsl(bs[i], xvs))
3393 {
3394 return 1;
3395 }
3396 }
3397 return 0;
3398}
#define pCopy(p)
return a copy of the poly
Definition polys.h:185

◆ existsub()

static BOOLEAN existsub ( leftv  res,
leftv  args 
)
static

Definition at line 4243 of file cohomo.cc.

4244{
4245 leftv h=args;
4246 if((h != NULL)&&(h->Typ() == POLY_CMD))
4247 {
4248 poly p= (poly)h->Data();
4249 h = h->next;
4250 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4251 {
4252 ideal h1= (ideal)h->Data();
4253 res->rtyp =INT_CMD;
4254 res->data =(void *)(long)existIn(p, h1);
4255 }
4256 }
4257 return false;
4258}
static int existIn(poly b, ideal Xs)
Definition cohomo.cc:3385

◆ fa()

static BOOLEAN fa ( leftv  res,
leftv  args 
)
static

Definition at line 3763 of file cohomo.cc.

3764{
3765 leftv h=args;
3766 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3767 {
3768 ideal h1= (ideal)h->Data();
3769 h = h->next;
3770 if((h != NULL)&&(h->Typ() == POLY_CMD))
3771 {
3772 poly q= (poly)h->Data();
3773 h = h->next;
3774 if((h != NULL)&&(h->Typ() == INT_CMD))
3775 {
3776 int d= (int)(long)h->Data();
3777 res->rtyp =IDEAL_CMD;
3778 res->data =finda(h1,q,d);
3779 }
3780 }
3781 }
3782 return false;
3783}
static ideal finda(ideal h, poly S, int ddeg)
Definition cohomo.cc:934

◆ fb()

static BOOLEAN fb ( leftv  res,
leftv  args 
)
static

Definition at line 3710 of file cohomo.cc.

3711{
3712 leftv h=args;
3713 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3714 {
3715 ideal h1= (ideal)h->Data();
3716 res->rtyp =IDEAL_CMD;
3717 res->data =findb(h1);
3718 }
3719 return false;
3720}
static ideal findb(ideal h)
Definition cohomo.cc:908

◆ fgp()

static BOOLEAN fgp ( leftv  res,
leftv  args 
)
static

Definition at line 3785 of file cohomo.cc.

3786{
3787 leftv h=args;
3788 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3789 {
3790 ideal h1= (ideal)h->Data();
3791 h = h->next;
3792 if((h != NULL)&&(h->Typ() == POLY_CMD))
3793 {
3794 poly p= (poly)h->Data();
3795 h = h->next;
3796 if((h != NULL)&&(h->Typ() == POLY_CMD))
3797 {
3798 poly q= (poly)h->Data();
3799 res->rtyp =INTVEC_CMD;
3800 res->data =gradedpiece1n(h1,p,q);
3801 }
3802 }
3803 }
3804 return false;
3805}
static intvec * gradedpiece1n(ideal h, poly a, poly b)
Definition cohomo.cc:2312

◆ fgpl()

static BOOLEAN fgpl ( leftv  res,
leftv  args 
)
static

Definition at line 3807 of file cohomo.cc.

3808{
3809 leftv h=args;
3810 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3811 {
3812 ideal h1= (ideal)h->Data();
3813 h = h->next;
3814 if((h != NULL)&&(h->Typ() == POLY_CMD))
3815 {
3816 poly p= (poly)h->Data();
3817 h = h->next;
3818 if((h != NULL)&&(h->Typ() == POLY_CMD))
3819 {
3820 poly q= (poly)h->Data();
3821 h = h->next;
3822 if((h != NULL)&&(h->Typ() == INT_CMD))
3823 {
3824 int d= (int)(long)h->Data();
3825 res->rtyp =INTVEC_CMD;
3826 res->data =gradedpiece1nl(h1,p,q,d);
3827 }
3828 }
3829 }
3830 }
3831 return false;
3832}
static intvec * gradedpiece1nl(ideal h, poly a, poly b, int set)
Definition cohomo.cc:2767

◆ finda()

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

Definition at line 934 of file cohomo.cc.

935{
936 poly e=pOne();
938 int i,deg1=pTotaldegree(S);
939 int tdeg=deg1+ddeg;
940 if(tdeg!=0)
941 {
942 std::vector<int> v,bv=support1(S),in;
943 std::vector<std::vector<int> > hvs=supports(h);
945 for(i=0;i<IDELEMS(ia);i++)
946 {
947 v=support1(ia->m[i]);
949 if(vInvsl(v,hvs)&&in.size()==0)
950 {
951 idInsertPoly(aset, ia->m[i]);
952 }
953 }
955 }
956 else idInsertPoly(aset,e);
957 return(aset);
958}
static ideal id_complement(ideal h)
Definition cohomo.cc:698
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
ideal id_MaxIdeal(const ring r)
initialise the maximal ideal (at 0)
int tdeg(poly p)

◆ findalpha()

static std::vector< int > findalpha ( std::vector< std::vector< int > >  mv,
std::vector< int bv 
)
static

Definition at line 1926 of file cohomo.cc.

1927{
1928 std::vector<int> alset;
1929 for(unsigned i=0;i<mv.size();i++)
1930 {
1931 if(vsubset(bv,mv[i]))
1932 {
1933 alset.push_back(i);
1934 }
1935 }
1936 //Print("This is the alpha set, and the subspace is dim-%ld\n",alset.size());
1937 //listprint(alset);
1938 return alset;
1939}

◆ findalphan()

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

Definition at line 2423 of file cohomo.cc.

2424{
2425 int i;std::vector<int> alset,vec;
2426 for(i=0;i<N.size();i++)
2427 {
2428 // vec=N[i];
2429 if(!IsinL(i,tN))
2430 {
2431 alset.push_back(i);
2432 }
2433 }
2434 //listprint(alset);
2435 return alset;
2436}
const CanonicalForm CFMap CFMap & N
Definition cfEzgcd.cc:56

◆ findb()

static ideal findb ( ideal  h)
static

Definition at line 908 of file cohomo.cc.

909{
911 poly e=pOne();
912 int i,j;
913 for(i=0;i<IDELEMS(ib);i++)
914 {
915 for(j=0;j<IDELEMS(nonf);j++)
916 {
917 if(p_DivisibleBy(ib->m[i],nonf->m[j],currRing))
918 {
919 idInsertPoly(bset, ib->m[i]);
920 break;
921 }
922 }
923 }
926 return bset;
927}
static ideal id_sfmon(ideal h)
Definition cohomo.cc:679
static BOOLEAN p_DivisibleBy(poly a, poly b, const ring r)
Definition p_polys.h:1900

◆ firstorderdef_setup()

static void firstorderdef_setup ( SModulFunctions p)
static

Definition at line 4576 of file cohomo.cc.

4577{
4578 p->iiAddCproc("","mg",FALSE,idsr);
4579 p->iiAddCproc("","gd",FALSE,gd);
4580 p->iiAddCproc("","findbset",FALSE,fb);
4581 p->iiAddCproc("","findaset",FALSE,fa);
4582 p->iiAddCproc("","fgp",FALSE,fgp);
4583 p->iiAddCproc("","fgpl",FALSE,fgpl);
4584 p->iiAddCproc("","idcomplement",FALSE,idcomplement);
4585 p->iiAddCproc("","genst",FALSE,genstt);
4586 p->iiAddCproc("","sgp",FALSE,sgp);
4587 p->iiAddCproc("","sgpl",FALSE,sgpl);
4588 p->iiAddCproc("","Links",FALSE,Links);
4589 p->iiAddCproc("","eqsolve1",FALSE,eqsolve1);
4590 p->iiAddCproc("","pb",FALSE,pb);
4591 p->iiAddCproc("","pa",FALSE,pa);
4592 p->iiAddCproc("","makeSimplex",FALSE,makeSimplex);
4593 p->iiAddCproc("","isSim",FALSE,isSim);
4594 p->iiAddCproc("","nfaces1",FALSE,nfaces1);
4595 p->iiAddCproc("","nfaces2",FALSE,nfaces2);
4596 p->iiAddCproc("","nfaces3",FALSE,nfaces3);
4597 p->iiAddCproc("","comedg",FALSE,comedg);
4598 p->iiAddCproc("","tsets",FALSE,tsets);
4599 p->iiAddCproc("","valency",FALSE,Valency);
4600 p->iiAddCproc("","nab",FALSE,nabvl);
4601 p->iiAddCproc("","tnab",FALSE,tnabvl);
4602 p->iiAddCproc("","mab",FALSE,mabvl);
4603 p->iiAddCproc("","SRideal",FALSE,SRideal);
4604 p->iiAddCproc("","Linkn",FALSE,linkn);
4605 p->iiAddCproc("","Existb",FALSE,existsub);
4606 p->iiAddCproc("","pConstant",FALSE,pConstant);
4607 p->iiAddCproc("","pChange",FALSE,pChange);
4608 p->iiAddCproc("","pNew",FALSE,p_New);
4609 p->iiAddCproc("","pSupport",FALSE,support);
4610 p->iiAddCproc("","psMinusp",FALSE,psMinusp);
4611 p->iiAddCproc("","cNew",FALSE,cNew);
4612 p->iiAddCproc("","isoNumber",FALSE,isoNumber);
4613 p->iiAddCproc("","vsInsec",FALSE,vsIntersec);
4614 p->iiAddCproc("","getnabt",FALSE,nabtvl);
4615 p->iiAddCproc("","idmodulo",FALSE,idModulo);
4616 p->iiAddCproc("","ndegree",FALSE,newDegree);
4617 p->iiAddCproc("","nonf2f",FALSE,nonf2f);
4618 p->iiAddCproc("","ifIsom",FALSE,ifIsomorphism);
4619 p->iiAddCproc("","stellarsubdivision",FALSE,stellarsubdivision);
4620 p->iiAddCproc("","star",FALSE,stars);
4621 p->iiAddCproc("","numdim",FALSE,numdim);
4622 p->iiAddCproc("","dimsim",FALSE,dimsim);
4623 p->iiAddCproc("","bprime",FALSE,bprime);
4624 p->iiAddCproc("","remainpart",FALSE,stellarremain);
4625 p->iiAddCproc("","idminus",FALSE,idminus);
4626 p->iiAddCproc("","time1",FALSE,t1h);
4627}
static BOOLEAN fa(leftv res, leftv args)
Definition cohomo.cc:3763
static BOOLEAN pa(leftv res, leftv args)
Definition cohomo.cc:3722
static BOOLEAN tsets(leftv res, leftv args)
Definition cohomo.cc:4052
static BOOLEAN tnabvl(leftv res, leftv args)
Definition cohomo.cc:4105
BOOLEAN nfaces1(leftv res, leftv args)
Definition cohomo.cc:3930
static BOOLEAN cNew(leftv res, leftv args)
Definition cohomo.cc:4367
static BOOLEAN comedg(leftv res, leftv args)
Definition cohomo.cc:3693
static BOOLEAN idModulo(leftv res, leftv args)
Definition cohomo.cc:4418
static BOOLEAN isoNumber(leftv res, leftv args)
Definition cohomo.cc:4452
static BOOLEAN makeSimplex(leftv res, leftv args)
Definition cohomo.cc:3734
static BOOLEAN fgp(leftv res, leftv args)
Definition cohomo.cc:3785
static BOOLEAN stars(leftv res, leftv args)
Definition cohomo.cc:4384
static BOOLEAN newDegree(leftv res, leftv args)
Definition cohomo.cc:4516
static BOOLEAN bprime(leftv res, leftv args)
Definition cohomo.cc:4318
static BOOLEAN pConstant(leftv res, leftv args)
Definition cohomo.cc:4260
static BOOLEAN dimsim(leftv res, leftv args)
Definition cohomo.cc:4545
static BOOLEAN fgpl(leftv res, leftv args)
Definition cohomo.cc:3807
static BOOLEAN psMinusp(leftv res, leftv args)
Definition cohomo.cc:4330
static BOOLEAN SRideal(leftv res, leftv args)
Definition cohomo.cc:3599
static BOOLEAN stellarsubdivision(leftv res, leftv args)
Definition cohomo.cc:4401
static BOOLEAN idcomplement(leftv res, leftv args)
Definition cohomo.cc:3611
static BOOLEAN isSim(leftv res, leftv args)
Definition cohomo.cc:3918
static BOOLEAN gd(leftv res, leftv args)
Definition cohomo.cc:3676
static BOOLEAN nabvl(leftv res, leftv args)
Definition cohomo.cc:4081
static BOOLEAN fb(leftv res, leftv args)
Definition cohomo.cc:3710
static BOOLEAN eqsolve1(leftv res, leftv args)
Definition cohomo.cc:4011
static BOOLEAN numdim(leftv res, leftv args)
Definition cohomo.cc:4557
static BOOLEAN vsIntersec(leftv res, leftv args)
Definition cohomo.cc:4137
static BOOLEAN support(leftv res, leftv args)
Definition cohomo.cc:4306
static BOOLEAN genstt(leftv res, leftv args)
Definition cohomo.cc:3834
static BOOLEAN nonf2f(leftv res, leftv args)
Definition cohomo.cc:4533
static BOOLEAN sgpl(leftv res, leftv args)
Definition cohomo.cc:3878
static BOOLEAN sgp(leftv res, leftv args)
Definition cohomo.cc:3856
static BOOLEAN idsr(leftv res, leftv args)
Definition cohomo.cc:3636
static BOOLEAN linkn(leftv res, leftv args)
Definition cohomo.cc:4211
static BOOLEAN Valency(leftv res, leftv args)
Definition cohomo.cc:4064
static BOOLEAN stellarremain(leftv res, leftv args)
Definition cohomo.cc:4347
static BOOLEAN nabtvl(leftv res, leftv args)
Definition cohomo.cc:4177
static BOOLEAN nfaces3(leftv res, leftv args)
Definition cohomo.cc:3979
static BOOLEAN p_New(leftv res, leftv args)
Definition cohomo.cc:4289
static BOOLEAN Links(leftv res, leftv args)
Definition cohomo.cc:3900
static BOOLEAN nfaces2(leftv res, leftv args)
Definition cohomo.cc:3952
static BOOLEAN pb(leftv res, leftv args)
Definition cohomo.cc:3746
static BOOLEAN pChange(leftv res, leftv args)
Definition cohomo.cc:4277
static BOOLEAN idminus(leftv res, leftv args)
Definition cohomo.cc:4435
static BOOLEAN mabvl(leftv res, leftv args)
Definition cohomo.cc:4155
static BOOLEAN ifIsomorphism(leftv res, leftv args)
Definition cohomo.cc:4479
static BOOLEAN existsub(leftv res, leftv args)
Definition cohomo.cc:4243
static BOOLEAN t1h(leftv res, leftv args)
Definition cohomo.cc:3624

◆ freevars()

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

Definition at line 1085 of file cohomo.cc.

1086{
1087 int ql=gset.size(), bl=bset.size(), i;
1088 std::vector<int> mvar, fvar;
1089 for(i=0;i<bl;i++)
1090 {
1091 mvar.push_back(bset[i]);
1092 }
1093 for(i=0;i<ql;i++)
1094 {
1095 mvar.push_back(gset[i][0]);
1096 }
1097 for(i=1;i<=n;i++)
1098 {
1099 if(!IsinL(i,mvar))
1100 {
1101 fvar.push_back(i);
1102 }
1103 }
1104 return fvar;
1105}
Variable mvar(const CanonicalForm &f)

◆ fvarsvalue()

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

Definition at line 1108 of file cohomo.cc.

1109{
1110 int i;
1111 std::vector<int> fset=fvars;
1112 for(i=0;i<fset.size();i++)
1113 {
1114 if(fset[i]==vnum)
1115 {
1116 fset.erase(fset.begin()+i);
1117 break;
1118 }
1119 }
1120 return fset;
1121}

◆ gd()

static BOOLEAN gd ( leftv  res,
leftv  args 
)
static

Definition at line 3676 of file cohomo.cc.

3677{
3678 leftv h=args;
3679 if((h != NULL)&&(h->Typ() == POLY_CMD))
3680 {
3681 poly p= (poly)h->Data();
3682 h = h->next;
3683 if((h != NULL)&&(h->Typ() == POLY_CMD))
3684 {
3685 poly q= (poly)h->Data();
3686 res->rtyp =INTVEC_CMD;
3687 res->data =dmat(p,q);
3688 }
3689 }
3690 return false;
3691}
static intvec * dmat(poly a, poly b)
Definition cohomo.cc:3658

◆ gdegree()

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

Definition at line 3455 of file cohomo.cc.

3456{
3457 int i;
3458 std::vector<int> av,bv;
3459 for(i=1;i<=currRing->N;i++)
3460 {
3461 av.push_back(pGetExp(a,i));
3462 bv.push_back(pGetExp(b,i));
3463 }
3464 std::vector<int> vec=v_minus(av,bv);
3465 //PrintS("The degree is:\n");
3466 //listprint(vec);
3467 return vec;
3468}
static std::vector< int > v_minus(std::vector< int > v1, std::vector< int > v2)
Definition cohomo.cc:3445
#define pGetExp(p, i)
Exponent.
Definition polys.h:41

◆ gensindex()

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

Definition at line 2259 of file cohomo.cc.

2260{
2261 int i;
2262 std::vector<int> vec,index;
2263 if(!idIs0(M))
2264 {
2265 std::vector<std::vector<int> > vecs=supports(ids);
2266 for(i=0;i<IDELEMS(M);i++)
2267 {
2268 vec=support1(M->m[i]);
2269 if(vInvsl(vec,vecs))
2270 index.push_back(i);
2271 }
2272 }
2273 return (index);
2274}
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
static int index(p_Length length, p_Ord ord)
#define M
Definition sirandom.c:25

◆ genst()

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

Definition at line 2510 of file cohomo.cc.

2511{
2512 std::vector<std::vector<int> > hvs=supports(h),mv,mts;
2513 std::vector<int> av=support1(a), bv=support1(b);
2514 mv=Mabv(h,a,b);
2515 mts=mabtv(hvs,mv,av,bv);
2516 std::vector<std::vector<poly> > pvs=idMakei(mv,mts);
2517 ideal gens=idInit(1,1);
2518 for(unsigned i=0;i<pvs.size();i++)
2519 {
2520 idInsertPoly(gens,pvs[i][0]);
2521 idInsertPoly(gens,pvs[i][1]);
2522 }
2524 return (gens);
2525}
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:1982
static std::vector< std::vector< poly > > idMakei(std::vector< std::vector< int > > mv, std::vector< std::vector< int > > vecs)
Definition cohomo.cc:1670
static std::vector< std::vector< int > > Mabv(ideal h, poly a, poly b)
Definition cohomo.cc:975

◆ genstt()

static BOOLEAN genstt ( leftv  res,
leftv  args 
)
static

Definition at line 3834 of file cohomo.cc.

3835{
3836 leftv h=args;
3837 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3838 {
3839 ideal h1= (ideal)h->Data();
3840 h = h->next;
3841 if((h != NULL)&&(h->Typ() == POLY_CMD))
3842 {
3843 poly p= (poly)h->Data();
3844 h = h->next;
3845 if((h != NULL)&&(h->Typ() == POLY_CMD))
3846 {
3847 poly q= (poly)h->Data();
3848 res->rtyp =IDEAL_CMD;
3849 res->data =genst(h1,p,q);
3850 }
3851 }
3852 }
3853 return false;
3854}
static ideal genst(ideal h, poly a, poly b)
Definition cohomo.cc:2510

◆ getpresolve()

static ideal getpresolve ( ideal  h)
static

Definition at line 1795 of file cohomo.cc.

1796{
1797 //ring r=currRing;
1798 //assume (LIB "presolve.lib");
1799 sleftv a;a.Init();
1800 a.rtyp=IDEAL_CMD;a.data=(void*)h;
1801 idhdl solve=ggetid("elimlinearpart");
1802 if(solve==NULL)
1803 {
1804 WerrorS("presolve.lib are not loaded!");
1805 return NULL;
1806 }
1808 //PrintS("no errors here\n");
1809 if(sl)
1810 {
1811 WerrorS("error in solve!");
1812 }
1814 ideal re=(ideal)L->m[4].CopyD();
1815 //iiRETURNEXPR.CleanUp();
1817 //PrintS("no errors here\n");
1818 //idSkipZeroes(re);
1819 //id_print(re);
1820 return re;
1821}
int BOOLEAN
Definition auxiliary.h:87
void * CopyD(int t)
Definition subexpr.cc:710
int rtyp
Definition subexpr.h:91
void * Data()
Definition subexpr.cc:1173
void Init()
Definition subexpr.h:107
void * data
Definition subexpr.h:88
Definition lists.h:24
sleftv * m
Definition lists.h:46
idhdl ggetid(const char *n)
Definition ipid.cc:581
BOOLEAN iiMake_proc(idhdl pn, package pack, leftv args)
Definition iplib.cc:504
INST_VAR sleftv iiRETURNEXPR
Definition iplib.cc:474
slists * lists

◆ getvector()

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

Definition at line 1862 of file cohomo.cc.

1863{
1864 std::vector<int> vec;
1865 std::vector<std::vector<int> > vecs;
1866 ideal h2=idCopy(h);
1867 if(!idIs0(h))
1868 {
1870 poly q,e=pOne();
1871 int lg=IDELEMS(h1),n,i,j,t;
1872 std::vector<int> fvar=numfree(h1);
1873 n=fvar.size();
1874 if(n==0)
1875 {
1876 vec=make0(IDELEMS(h1));vecs.push_back(vec);//listsprint(vecs);
1877 }
1878 else
1879 {
1880 for(t=0;t<n;t++)
1881 {
1882 vec.clear();
1883 for(i=0;i<lg;i++)
1884 {
1885 q=pCopy(h1->m[i]);
1886 //pWrite(q);
1887 if(q==0)
1888 {
1889 vec.push_back(0);
1890 }
1891 else
1892 {
1893 q=p_Subst(q, fvar[t], e,currRing);
1894 //Print("the %dth variable was substituted by 1:\n",fvar[t]);
1895 //pWrite(q);
1896 for(j=0;j<n;j++)
1897 {
1898 //Print("the %dth variable was substituted by 0:\n",fvar[j]);
1899 q=p_Subst(q, fvar[j],0,currRing);
1900 //pWrite(q);
1901 }
1902 if(q==0)
1903 {
1904 vec.push_back(0);
1905 }
1906 else
1907 {
1908 vec.push_back(n_Int(pGetCoeff(q),currRing->cf));
1909 }
1910 }
1911 }
1912 //listprint(vec);
1913 vecs.push_back(vec);
1914 }
1915 }
1916 }
1917 else
1918 {vecs=canonicalbase(n);}
1919 //listsprint(vecs);
1920 return vecs;
1921}
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:544
static std::vector< std::vector< int > > canonicalbase(int n)
Definition cohomo.cc:1842
static ideal getpresolve(ideal h)
Definition cohomo.cc:1795
static std::vector< int > make0(int n)
Definition cohomo.cc:1185
static std::vector< int > numfree(ideal h)
Definition cohomo.cc:1823
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
poly p_Subst(poly p, int n, poly e, const ring r)
Definition p_polys.cc:3958

◆ gpl()

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

Definition at line 2703 of file cohomo.cc.

2704{
2705 int i,j,co;
2706 std::vector<std::vector<int> > hvs=supports(h),sbv,nv,mv,good,solve;
2707 std::vector<int> av=support1(a), bv=support1(b),index,bad,tnv;
2708 ideal sub=psubset(b);
2709 sbv=supports(sub);
2710 nv=Nabv(hvs,av,bv);
2711 mv=Mabv(h,a,b);
2712 ideal M=idMaken(mv);
2713 index = gensindex(M, idsrRing(h));
2714 int n=nv.size();
2715 ring r=currRing;
2716 t_begin=clock();
2717 if(n > 0)
2718 {
2719 tnv=tnab(hvs,nv,sbv);
2720 for(i=0;i<tnv.size();i++)
2721 {
2722 co=tnv[i];
2723 bad.push_back(co+1);
2724 }
2725 for(i=0;i<n;i++)
2726 {
2727 for(j=i+1;j<n;j++)
2728 {
2729 if(nabtconditionv(hvs,nv[i],nv[j]))
2730 {
2732 }
2733 else
2734 {
2735 ;
2736 }
2737 }
2738 }
2740 t_begin=clock();
2741 solve=eli2(n,bad,good);
2743 if(bv.size()!=1)
2744 {;
2745 }
2746 else
2747 {
2748 std::vector<int> su=make1(n);
2749 std::vector<std::vector<int> > suu;
2750 suu.push_back(su);
2751 equmab(n);
2753 rChangeCurrRing(r);
2754 }
2755 }
2756 else
2757 {
2758 solve.clear();
2759 }
2760 //listsprint(solve);
2761 //sl->show(0,0);
2762 return solve;
2763}
VAR clock_t t_construct
Definition cohomo.cc:2691
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:2171
static std::vector< std::vector< int > > listsinsertlist(std::vector< std::vector< int > > gset, int a, int b)
Definition cohomo.cc:1561
static std::vector< std::vector< int > > Nabv(std::vector< std::vector< int > > hvs, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:2105
static ideal psubset(poly p)
Definition cohomo.cc:1539
static bool nabtconditionv(std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > qv)
Definition cohomo.cc:2122
VAR clock_t t_begin
Definition cohomo.cc:2691
static std::vector< int > make1(int n)
Definition cohomo.cc:1198
static void equmab(int num)
Definition cohomo.cc:1618
static std::vector< std::vector< int > > vecqring(std::vector< std::vector< int > > vec1, std::vector< std::vector< int > > vec2)
Definition cohomo.cc:454
static std::vector< int > gensindex(ideal M, ideal ids)
Definition cohomo.cc:2259
VAR clock_t t_solve
Definition cohomo.cc:2691
static ideal idsrRing(ideal h)
Definition cohomo.cc:758
bool bad
void rChangeCurrRing(ring r)
Definition polys.cc:15

◆ gpl2()

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

Definition at line 2844 of file cohomo.cc.

2845{
2846 int i,j,t,n;
2847 std::vector<std::vector<int> > hvs=supports(h),sbv,nv,mv,mts,vecs,vars,ntvs,solve;
2848 std::vector<int> av=support1(a), bv=support1(b),vec,var,tnv;
2849 ideal sub=psubset(b);
2850 sbv=supports(sub);
2851 nv=Nabv(hvs,av,bv);
2852 n=nv.size();
2853 tnv=tnab(hvs,nv,sbv);
2854 ring r=currRing;
2855 mv=Mabv(h,a,b);
2856 mts=mabtv(hvs,mv,av,bv);
2857 if(n>0)
2858 {
2859 ntvs=nabtv( hvs, nv, av, bv);
2860 int l=ntvs.size();
2861 if(l>0)
2862 {
2863 for(int t0=0;t0<l;t0++)
2864 {
2865 i=ntvs[t0][0];
2866 j=ntvs[t0][1];
2867 if(tNab(hvs,nv[i],sbv)&&tNab(hvs,nv[j],sbv))//condition 1
2868 {
2869 vec=makeequation(t0+1,0,0);
2870 vecs.push_back(vec);
2871 vec.clear();
2872 }
2873 for(int t1=t0+1;t1<ntvs.size();t1++)
2874 {
2875 for(int t2=t1+1;t2<ntvs.size();t2++)
2876 {
2877 if(ntvs[t0][0]==ntvs[t1][0]&&ntvs[t1][1]==ntvs[t2][1]&&ntvs[t0][1]==ntvs[t2][0])
2878 {
2879 i=ntvs[t0][0];
2880 j=ntvs[t0][1];
2881 t=ntvs[t1][1];
2882 if(condition2for2nv(hvs,nv[i],nv[j],nv[t]))
2883 {
2884 vec=makeequation(t0+1,t1+1,t2+1);
2885 vecs.push_back(vec);
2886 vec.clear();
2887 }
2888 }
2889 }
2890 }
2891 }
2892 if(n==1) {l=1;}
2893 equmab(l);
2895 std::vector<std::vector<int> > re=getvector(id_re,l);
2896 rChangeCurrRing(r);
2897 std::vector<std::vector<int> > sub=subspacetn(nv, tnv,ntvs);
2898 equmab(l);
2899 solve=vecqring(re, sub);
2900 rChangeCurrRing(r);
2901 }
2902 else
2903 {
2904 solve.clear();
2905 }
2906 }
2907 else
2908 solve.clear();
2909 return solve;
2910}
int l
Definition cfEzgcd.cc:100
static bool tNab(std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< std::vector< int > > bvs)
Definition cohomo.cc:2156
static bool condition2for2nv(std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > qv, std::vector< int > fv)
Definition cohomo.cc:2409
static ideal idMake3(std::vector< std::vector< int > > vecs)
Definition cohomo.cc:1601
static std::vector< int > makeequation(int i, int j, int t)
Definition cohomo.cc:1570
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:2439
static std::vector< std::vector< int > > getvector(ideal h, int n)
Definition cohomo.cc:1862
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:2134

◆ gradedpiece1()

static void gradedpiece1 ( ideal  h,
poly  a,
poly  b 
)
static

Definition at line 1690 of file cohomo.cc.

1691{
1692 int i,j,m;
1693 ideal sub=psubset(b);
1694 std::vector<int> av=support1(a), bv=support1(b), bad, vv;
1695 std::vector<std::vector<int> > hvs=supports(h), sbv=supports(sub), mv=Mabv(h,a,b),good;
1696 m=mv.size();
1697 ring r=currRing;
1698 if( m > 0 )
1699 {
1700 for(i=0;i<m;i++)
1701 {
1702 if(!vsubset(bv,mv[i]))
1703 {
1704 bad.push_back(i+1);
1705 }
1706 }
1707 for(i=0;i<m;i++)
1708 {
1709 for(j=i+1;j<m;j++)
1710 {
1711 vv=vecUnion(mv[i],mv[j]);
1712 if(mabconditionv(hvs,vv,av,bv))
1713 {
1715 }
1716 else
1717 {
1718 //PrintS("They are not in Mabt!\n");
1719 ;
1720 }
1721 }
1722 }
1723 std::vector<std::vector<int> > solve=eli2(m,bad,good);
1724 if(bv.size()!=1)
1725 {
1726 //PrintS("This is the solution of coefficients:\n");
1728 }
1729 else
1730 {
1731 std::vector<int> su=subspace1(mv,bv);
1732 //PrintS("This is the solution of subspace:\n");
1733 //listprint(su);
1734 std::vector<std::vector<int> > suu;
1735 suu.push_back(su);
1736 equmab(solve[0].size());
1737 std::vector<std::vector<int> > solves=vecqring(solve,suu);
1738 //PrintS("This is the solution of coefficients:\n");
1740 rChangeCurrRing(r);
1741 }
1742 }
1743 else
1744 {
1745 PrintS("No element considered!\n");
1746 }
1747}
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition cf_ops.cc:600
static std::vector< int > subspace1(std::vector< std::vector< int > > mv, std::vector< int > bv)
Definition cohomo.cc:1639
static void listsprint(std::vector< std::vector< int > > posMat)
Definition cohomo.cc:65
void PrintS(const char *s)
Definition reporter.cc:284

◆ gradedpiece1n()

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

Definition at line 2312 of file cohomo.cc.

2313{
2314 int i,j,co,n;
2315 std::vector<std::vector<int> > hvs=supports(h),mv=Mabv(h,a,b),sbv,nv,good,solve;
2316 std::vector<int> av=support1(a), bv=support1(b), bad, tnv, index;
2317 ideal sub=psubset(b),M;
2318 sbv=supports(sub);
2319 nv=Nabv(hvs,av,bv);
2320 M=idMaken(mv);
2321 index = gensindex(M, idsrRing(h));
2322 n=nv.size();
2323 ring r=currRing;
2324 if(n > 0)
2325 {
2326 tnv=tnab(hvs,nv,sbv);
2327 for(i=0;i<tnv.size();i++)
2328 {
2329 co=tnv[i];
2330 bad.push_back(co+1);
2331 }
2332 for(i=0;i<n;i++)
2333 {
2334 for(j=i+1;j<n;j++)
2335 {
2336 if(nabtconditionv(hvs,nv[i],nv[j]))
2337 {
2339 }
2340 else
2341 {
2342 ;
2343 }
2344 }
2345 }
2346 solve=eli2(n,bad,good);
2347 if(bv.size()!=1)
2348 {;
2349 //PrintS("This is the solution of coefficients:\n");
2350 //listsprint(solve);
2351 }
2352 else
2353 {
2354 std::vector<int> su=make1(n);
2355 std::vector<std::vector<int> > suu;
2356 suu.push_back(su);
2357 equmab(n);
2359 //PrintS("This is the solution of coefficients:\n");
2360 //listsprint(solve);
2361 rChangeCurrRing(r);
2362 }
2364 }
2365 else
2366 {
2367 //PrintS("No element considered here!\n");
2368 solve.clear();
2369 }
2370 //PrintS("This is the solution of final coefficients:\n");
2371 //listsprint(solve);
2373 intvec *sl=Tmat(solve);
2374 //sl->show(0,0);
2375 return sl;
2376}
static std::vector< std::vector< int > > minisolve(std::vector< std::vector< int > > solve, std::vector< int > index)
Definition cohomo.cc:2290
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:2195

◆ gradedpiece1nl()

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

Definition at line 2767 of file cohomo.cc.

2768{
2769 t_start=clock();
2770 poly e=pOne();
2771 std::vector<int> av=support1(a),bv=support1(b),index, em;
2772 std::vector<std::vector<int> > solve, hvs=supports(h), lks=links(a,h), mv=Mabv(h,a,b), nvl;
2774 ideal M=idMaken(mv);
2775 index = gensindex(M, idsrRing(h));
2776 solve=gpl(id_links,e,b);
2777 t_mark=clock();
2778 nvl=Nabv(lks,em,bv);
2779 solve=value1l(mv, nvl , solve, av, bv);
2780 if(set==1)
2781 {
2783 }
2784 intvec *sl=Tmat(solve);
2787 return sl;
2788}
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:2658
VAR clock_t t_start
Definition cohomo.cc:2691
VAR clock_t t_mark
Definition cohomo.cc:2691
VAR clock_t t_value
Definition cohomo.cc:2691
VAR clock_t t_total
Definition cohomo.cc:2691
static std::vector< std::vector< int > > gpl(ideal h, poly a, poly b)
Definition cohomo.cc:2703
static std::vector< std::vector< int > > links(poly a, ideal h)
Definition cohomo.cc:1293

◆ gradedpiece2()

static void gradedpiece2 ( ideal  h,
poly  a,
poly  b 
)
static

Definition at line 2005 of file cohomo.cc.

2006{
2007 int t0,t1,t2,i,j,t,m;
2008 ideal sub=psubset(b);
2009 ring r=rCopy(currRing);
2010 std::vector<std::vector<int> > hvs=supports(h), mv=Mabv(h,a,b), mts, vecs,vars;
2011 std::vector<int> av=support1(a), bv=support1(b), vec,var;
2012 mts=mabtv(hvs,mv,av,bv);
2013 PrintS("The homomorphism should map onto:\n");
2015 m=mv.size();
2016 if(m > 0)
2017 {
2018 vars=mabtv(hvs,mv,av,bv);
2019 int vn=vars.size();
2020 for(t0=0;t0<vars.size();t0++)
2021 {
2022 i=vars[t0][0];
2023 j=vars[t0][1];
2024 if(!condition1for2(mv[i],mv[j],bv))//condition 1
2025 {
2026 //PrintS("And they satisfy the condition 1.\n");
2027 vec=makeequation(t0+1,0,0);
2028 //PrintS("So the equation:\n");
2029 //pWrite(p);
2030 //PrintS("holds.\n");
2031 vecs.push_back(vec);
2032 vec.clear();
2033 }
2034 if(condition3for2(hvs,mv[i],mv[j],av,bv))//condition 3
2035 {
2036 //PrintS("And they satisfy the condition 3.\n");
2037 vec=makeequation(t0+1,0,0);
2038 //PrintS("So the equation: \n");
2039 //pWrite(p);
2040 //PrintS("holds.\n");
2041 vecs.push_back(vec);
2042 vec.clear();
2043 }
2044 for(t1=t0+1;t1<vars.size();t1++)
2045 {
2046 for(t2=t1+1;t2<vars.size();t2++)
2047 {
2048 if(vars[t0][0]==vars[t1][0]&&vars[t1][1]==vars[t2][1]&&vars[t0][1]==vars[t2][0])
2049 {
2050 i=vars[t0][0];
2051 j=vars[t0][1];
2052 t=vars[t1][1];
2053 if(condition2for2(hvs,mv[i],mv[j],mv[t],av,bv))//condition 2
2054 {
2055 vec=makeequation(t0+1,t1+1,t2+1);
2056 vecs.push_back(vec);
2057 vec.clear();
2058 }
2059 }
2060 }
2061 }
2062 }
2063 //PrintS("this is EQUATIONS:\n");
2064 //listsprint(vecs);
2065 equmab(vn);
2067 //id_print(id_re);
2068 std::vector<std::vector<int> > re=getvector(id_re,vn);
2069 PrintS("this is the solution for ideal :\n");
2070 listsprint(re);
2071 rChangeCurrRing(r);
2072 std::vector<std::vector<int> > sub=subspacet(mv, bv,vars);
2073 PrintS("this is the solution for subspace:\n");
2074 listsprint(sub);
2075 equmab(vn);
2076 std::vector<std::vector<int> > solve=vecqring(re, sub);
2077 PrintS("This is the solution of coefficients:\n");
2079 rChangeCurrRing(r);
2080 }
2081 else
2082 {
2083 PrintS("No element considered!");
2084 }
2085}
static bool condition3for2(std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > qv, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:1776
static void lpsprint(std::vector< std::vector< poly > > pvs)
Definition cohomo.cc:112
static bool condition2for2(std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > qv, std::vector< int > sv, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:1763
static bool condition1for2(std::vector< int > pv, std::vector< int > qv, std::vector< int > bv)
Definition cohomo.cc:1750
static std::vector< std::vector< int > > subspacet(std::vector< std::vector< int > > mv, std::vector< int > bv, std::vector< std::vector< int > > ntvs)
Definition cohomo.cc:1968

◆ gradedpiece2n()

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

Definition at line 2527 of file cohomo.cc.

2528{
2529 int i,j,t,n;
2530 std::vector<std::vector<int> > hvs=supports(h),nv,mv,mts,sbv,vecs,vars,ntvs,solve;
2531 std::vector<int> av=support1(a), bv=support1(b),tnv,vec,var;
2532 ideal sub=psubset(b);
2533 sbv=supports(sub);
2534 nv=Nabv(hvs,av,bv);
2535 n=nv.size();
2536 tnv=tnab(hvs,nv,sbv);
2537 ring r=currRing;
2538 mv=Mabv(h,a,b);
2539 mts=mabtv(hvs,mv,av,bv);
2540 //PrintS("The relations are:\n");
2541 //listsprint(mts);
2542 //PrintS("The homomorphism should map onto:\n");
2543 //lpsprint(idMakei(mv,mts));
2544 if(n>0)
2545 {
2546 ntvs=nabtv( hvs, nv, av, bv);
2547 //PrintS("The current homomorphism map onto###:\n");
2548 //lpsprint(idMakei(nv,ntvs));
2549 int l=ntvs.size();
2550 for(int t0=0;t0<l;t0++)
2551 {
2552 i=ntvs[t0][0];
2553 j=ntvs[t0][1];
2554 if(tNab(hvs,nv[i],sbv)&&tNab(hvs,nv[j],sbv))//condition 1
2555 {
2556 vec=makeequation(t0+1,0,0);
2557 vecs.push_back(vec);
2558 vec.clear();
2559 }
2560 for(int t1=t0+1;t1<ntvs.size();t1++)
2561 {
2562 for(int t2=t1+1;t2<ntvs.size();t2++)
2563 {
2564 if(ntvs[t0][0]==ntvs[t1][0]&&ntvs[t1][1]==ntvs[t2][1]&&ntvs[t0][1]==ntvs[t2][0])
2565 {
2566 i=ntvs[t0][0];
2567 j=ntvs[t0][1];
2568 t=ntvs[t1][1];
2569 if(condition2for2nv(hvs,nv[i],nv[j],nv[t]))
2570 {
2571 vec=makeequation(t0+1,t1+1,t2+1);
2572 vecs.push_back(vec);
2573 vec.clear();
2574 }
2575 }
2576 }
2577 }
2578 }
2579 //PrintS("this is EQUATIONS:\n");
2580 //listsprint(vecs);
2581 if(n==1) l=1;
2582 equmab(l);
2584 //id_print(id_re);
2585 std::vector<std::vector<int> > re=getvector(id_re,l);
2586 //PrintS("this is the solution for ideal :\n");
2587 //listsprint(re);
2588 rChangeCurrRing(r);
2589 std::vector<std::vector<int> > sub=subspacetn(nv, tnv,ntvs);
2590 //PrintS("this is the solution for subspace:\n");
2591 //listsprint(sub);
2592 equmab(l);
2593 solve=vecqring(re, sub);
2594 //PrintS("This is the solution of coefficients:\n");
2595 //listsprint(solve);
2596 rChangeCurrRing(r);
2598 }
2599 else
2600 solve.clear();
2601 intvec *sl=Tmat(solve);
2602 return sl;
2603}
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:2458

◆ gradedpiece2nl()

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

Definition at line 2912 of file cohomo.cc.

2913{
2914 poly e=pOne();
2915 std::vector<int> av=support1(a), bv=support1(b), em;
2916 std::vector<std::vector<int> > hvs=supports(h), mv=Mabv(h,a,b),mts,solve,lks,nvl,ntsl;
2917 mts=mabtv(hvs,mv,av,bv);
2918 lks=links(a,h);
2920//PrintS("This is the links of a:\n"); id_print(id_links);
2921 nvl=Nabv(lks,em,bv);
2922//PrintS("This is the N set:\n"); id_print(idMaken(nvl));
2923 ntsl=nabtv(lks,nvl,em,bv);
2924//PrintS("This is N^2:\n"); listsprint(ntsl);
2925 solve=gpl2(id_links,e,b);
2926//PrintS("This is pre solution of N:\n"); listsprint(solve);
2927 if(solve.size() > 0)
2928 {
2929 solve=value2l(mv, nvl, mts, ntsl, solve, av, bv);
2930 }
2931//PrintS("This is solution of N:\n"); listsprint(solve);
2932 intvec *sl=Tmat(solve);
2933 return sl;
2934}
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:2791
static std::vector< std::vector< int > > gpl2(ideal h, poly a, poly b)
Definition cohomo.cc:2844

◆ id_complement()

static ideal id_complement ( ideal  h)
static

Definition at line 698 of file cohomo.cc.

699{
700 int j, vert=idvert(h);
702 ideal i3=idInit(1,1);
703 poly p;
704 for(j=0;j<IDELEMS(i1);j++)
705 {
706 p=pCopy(i1->m[j]);
707 if(pvert(p)<=vert)
708 {
709 idInsertPoly(i3, p);
710 }
711 }
714 return (i2);
715}
static int pvert(poly p)
Definition cohomo.cc:541
static int idvert(ideal h)
Definition cohomo.cc:522
static ideal idMinus(ideal h1, ideal h2)
Definition cohomo.cc:617

◆ id_maxdeg()

static int id_maxdeg ( ideal  h)
static

Definition at line 744 of file cohomo.cc.

745{
746 int i,max;
747 max=pTotaldegree(h->m[0]);
748 for(i=1;i<IDELEMS(h);i++)
749 {
750 if(pTotaldegree(h->m[i]) > max)
751 max=pTotaldegree(h->m[i]);
752 }
753 return (max);
754}
static int max(int a, int b)
Definition fast_mult.cc:264

◆ id_print()

static void id_print ( ideal  h)
static

Definition at line 84 of file cohomo.cc.

85{
86 int i;
87 for(i=0;i<IDELEMS(h);i++)
88 {
89 Print(" [%d]\n",i+1);
90 pWrite(h->m[i]);
91 PrintLn();
92 }
93}
#define Print
Definition emacs.cc:80
void pWrite(poly p)
Definition polys.h:308
void PrintLn()
Definition reporter.cc:310

◆ id_sfmon()

static ideal id_sfmon ( ideal  h)
static

Definition at line 679 of file cohomo.cc.

680{
682 int j, vert=idvert(h);
685 for(j=2;j<=vert;j++)
686 {
690 }
691 return asfmons;
692}
static ideal sfreemon(ideal h, int deg)
Definition cohomo.cc:658
ideal id_Add(ideal h1, ideal h2, const ring r)
h1 + h2

◆ idadda()

static ideal idadda ( ideal  h1,
ideal  h2 
)
static

Definition at line 808 of file cohomo.cc.

809{
810 ideal h=idInit(1,1);
811 for(int i=0;i<IDELEMS(h1);i++)
812 {
813 if(!IsInX(h1->m[i],h))
814 {
815 idInsertPoly(h, h1->m[i]);
816 }
817 }
818 for(int i=0;i<IDELEMS(h2);i++)
819 {
820 if(!IsInX(h2->m[i],h))
821 {
822 idInsertPoly(h, h2->m[i]);
823 }
824 }
826 return h;
827}
static bool IsInX(poly p, ideal X)
Definition cohomo.cc:719

◆ idcomplement()

static BOOLEAN idcomplement ( leftv  res,
leftv  args 
)
static

Definition at line 3611 of file cohomo.cc.

3612{
3613 leftv h=args;
3614 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3615 {
3616 ideal hh=(ideal)h->Data();
3618 res->rtyp =IDEAL_CMD;
3619 res->data =h2;
3620 }
3621 return false;
3622}

◆ idMake()

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

Definition at line 358 of file cohomo.cc.

359{
360 int lv=vecs.size(), i;
361 poly p;
362 ideal id_re=idInit(1,1);
363 for(i=0;i<lv;i++)
364 {
365 p=pMake(vecs[i]);
367 }
369 return id_re;
370}
static poly pMake(std::vector< int > vbase)
Definition cohomo.cc:343

◆ idMake3()

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

Definition at line 1601 of file cohomo.cc.

1602{
1603 ideal id_re=idInit(1,1);
1604 poly p;
1605 int i,lv=vecs.size();
1606 for(i=0;i<lv;i++)
1607 {
1608 p=pMake3(vecs[i]);
1610 }
1612 return id_re;
1613}
static poly pMake3(std::vector< int > vbase)
Definition cohomo.cc:1583

◆ idMakei()

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

Definition at line 1670 of file cohomo.cc.

1671{
1672 int i,lv=vecs.size();
1673 std::vector<std::vector<poly> > re;
1674 std::vector<poly> h;
1675 for(i=0;i<lv;i++)
1676 {
1677 h=pMakei(mv,vecs[i]);
1678 re.push_back(h);
1679 }
1680 //PrintS("This is the metrix M:\n");
1681 //listsprint(vecs);
1682 //PrintS("the ideal according to metrix M is:\n");
1683 return re;
1684}
static std::vector< poly > pMakei(std::vector< std::vector< int > > mv, std::vector< int > vbase)
Definition cohomo.cc:1656

◆ idMaken()

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

Definition at line 479 of file cohomo.cc.

480{
481 ideal id_re=idInit(1,1);
482 poly p;
483 int i,lv=vecs.size();
484 for(i=0;i<lv;i++)
485 {
486 p=pMaken(vecs[i]);
488 }
490 //id_print(id_re);
491 return id_re;
492}
static poly pMaken(std::vector< int > vbase)
Definition cohomo.cc:465

◆ idMinus()

static ideal idMinus ( ideal  h1,
ideal  h2 
)
static

Definition at line 617 of file cohomo.cc.

618{
619 ideal h=idInit(1,1);
620 int i,j,eq=0;
621 for(i=0;i<IDELEMS(h1);i++)
622 {
623 eq=0;
624 for(j=0;j<IDELEMS(h2);j++)
625 {
626 if(p_EqualPolys(pCopy(h1->m[i]),pCopy(h2->m[j]), currRing))
627 {
628 eq=1;
629 break;
630 }
631 }
632 if(eq==0)
633 {
634 idInsertPoly(h, pCopy(h1->m[i]));
635 }
636 }
638 return h;
639}
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition p_polys.cc:4512

◆ idminus()

static BOOLEAN idminus ( leftv  res,
leftv  args 
)
static

Definition at line 4435 of file cohomo.cc.

4436{
4437 leftv h=args;
4438 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4439 {
4440 ideal h1= (ideal)h->Data();
4441 h = h->next;
4442 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4443 {
4444 ideal h2= (ideal)h->Data();
4445 res->rtyp =IDEAL_CMD;
4446 res->data =idMinus(h1, h2);
4447 }
4448 }
4449 return false;
4450}

◆ idMinusp()

static ideal idMinusp ( ideal  I,
poly  p 
)
static

Definition at line 3428 of file cohomo.cc.

3429{
3430 ideal h=idInit(1,1);
3431 int i;
3432 for(i=0;i<IDELEMS(I);i++)
3433 {
3434 if(!p_EqualPolys(I->m[i], p, currRing))
3435 {
3436 idInsertPoly(h, pCopy(I->m[i]));
3437 }
3438 }
3439 idSkipZeroes(h);
3440 return h;
3441}

◆ idmodulo()

static ideal idmodulo ( ideal  h1,
ideal  h2 
)
static

Definition at line 375 of file cohomo.cc.

376{
381 return idq;
382}
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition kstd1.cc:3235
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
Definition kstd1.cc:2483
@ testHomog
Definition structs.h:38

◆ idModulo()

static BOOLEAN idModulo ( leftv  res,
leftv  args 
)
static

Definition at line 4418 of file cohomo.cc.

4419{
4420 leftv h=args;
4421 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4422 {
4423 ideal h1= (ideal)h->Data();
4424 h = h->next;
4425 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4426 {
4427 ideal h2= (ideal)h->Data();
4428 res->rtyp =IDEAL_CMD;
4429 res->data =idmodulo(h1, h2);
4430 }
4431 }
4432 return false;
4433}
static ideal idmodulo(ideal h1, ideal h2)
Definition cohomo.cc:375

◆ idsr()

static BOOLEAN idsr ( leftv  res,
leftv  args 
)
static

Definition at line 3636 of file cohomo.cc.

3637{
3638 leftv h=args;
3639 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3640 {
3641 ideal h1= (ideal)h->Data();
3642 h = h->next;
3643 if((h != NULL)&&(h->Typ() == POLY_CMD))
3644 {
3645 poly p= (poly)h->Data();
3646 h = h->next;
3647 if((h != NULL)&&(h->Typ() == POLY_CMD))
3648 {
3649 poly q= (poly)h->Data();
3650 res->rtyp =IDEAL_CMD;
3651 res->data =mingens(h1,p,q);
3652 }
3653 }
3654 }
3655 return false;
3656}
static ideal mingens(ideal h, poly a, poly b)
Definition cohomo.cc:2276

◆ idsrRing()

static ideal idsrRing ( ideal  h)
static

Definition at line 758 of file cohomo.cc.

759{
760 int i,n;
762 for(i=1;i<=rVar(currRing);i++)
763 {
764 pp=sfreemon(hc,i);
765 pp=scKBase(i,pp);//quotient ring (R/I_i)_i
766 if(!idIs0(pp))
767 {
768 pp=sfreemon(pp,i);
769 rsr=pp;
770 //Print("This is the first quotient generators %d:\n",i);
771 //id_print(rsr);
772 break;
773 }
774 }
775 for(n=i+1;n<=rVar(currRing);n++)
776 {
777 qq=sfreemon(hc,n);
778 pp=qringadd(qq,rsr,n);
779 ppp=sfreemon(pp,n);
780 rsr=idAdd(rsr,ppp);
781 }
783 return rsr;
784}
static ideal qringadd(ideal h1, ideal h2, int deg)
Definition cohomo.cc:735

◆ idvert()

static int idvert ( ideal  h)
static

Definition at line 522 of file cohomo.cc.

523{
524 int i, j, vert=0;
525 if(idIs0(h))
526 return vert;
527 for(i=currRing->N;i>0;i--)
528 {
529 for(j=0;j<IDELEMS(h);j++)
530 {
531 if(pGetExp(h->m[j],i)>0)
532 {
533 vert=i;
534 return vert;
535 }
536 }
537 }
538 return vert;
539}

◆ ifIso()

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

Definition at line 3417 of file cohomo.cc.

3418{
3419 std::vector<int> va=support1(a), vb=support1(b), vp=support1(p), vq=support1(q), vf=support1(f), vg=support1(g);
3420 std::vector<int> v1=phimagel(vp, va, vb), v2=phimagel(vq, va, vb), v3=phimagel(vf, va, vb), v4=phimagel(vg, va, vb);
3421 if((vEvl(v1, v3)&& vEvl(v2,v4))||(vEvl(v1, v4)&& vEvl(v2,v3)) )
3422 {
3423 return (1);
3424 }
3425 return (0);
3426}
g
Definition cfModGcd.cc:4090
FILE * f
Definition checklibs.c:9
static std::vector< int > phimagel(std::vector< int > fv, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:2648
static bool vEvl(std::vector< int > vec1, std::vector< int > vec2)
Definition cohomo.cc:174

◆ ifIsomorphism()

static BOOLEAN ifIsomorphism ( leftv  res,
leftv  args 
)
static

Definition at line 4479 of file cohomo.cc.

4480{
4481 leftv h=args;
4482 if((h != NULL)&&(h->Typ() == POLY_CMD))
4483 {
4484 poly p= (poly)h->Data();
4485 h = h->next;
4486 if((h != NULL)&&(h->Typ() == POLY_CMD))
4487 {
4488 poly q= (poly)h->Data();
4489 h = h->next;
4490 if((h != NULL)&&(h->Typ() == POLY_CMD))
4491 {
4492 poly f= (poly)h->Data();
4493 h = h->next;
4494 if((h != NULL)&&(h->Typ() == POLY_CMD))
4495 {
4496 poly g= (poly)h->Data();
4497 h = h->next;
4498 if((h != NULL)&&(h->Typ() == POLY_CMD))
4499 {
4500 poly a= (poly)h->Data();
4501 h = h->next;
4502 if((h != NULL)&&(h->Typ() == POLY_CMD))
4503 {
4504 poly b= (poly)h->Data();
4505 res->rtyp =INT_CMD;
4506 res->data =(void *)(long)ifIso(p,q,f,g, a, b);
4507 }
4508 }
4509 }
4510 }
4511 }
4512 }
4513 return false;
4514}
static int ifIso(poly p, poly q, poly f, poly g, poly a, poly b)
Definition cohomo.cc:3417

◆ IsinL()

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

Definition at line 132 of file cohomo.cc.

133{
134 unsigned i;
135 for(i=0;i<vec.size();i++)
136 {
137 if(a==vec[i])
138 {
139 return true;
140 }
141 }
142 return false;
143}

◆ IsInX()

static bool IsInX ( poly  p,
ideal  X 
)
static

Definition at line 719 of file cohomo.cc.

720{
721 int i;
722 for(i=0;i<IDELEMS(X);i++)
723 {
724 if(pEqualPolys(p,X->m[i]))
725 {
726 //PrintS("yes\n");
727 return(true);
728 }
729 }
730 //PrintS("no\n");
731 return(false);
732}
#define pEqualPolys(p1, p2)
Definition polys.h:399

◆ isoNum()

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

Definition at line 3400 of file cohomo.cc.

3401{
3402 int i;
3403 std::vector<std::vector<int> > vs=supports(idCopy(I));
3404 std::vector<int> v1=support1(a), v2=support1(b), v=support1(p);
3405 std::vector<int> vp, iv=phimagel(v, v1, v2);
3406 for(i=0;i<IDELEMS(I);i++)
3407 {
3408 vp=support1(pCopy(I->m[i]));
3409 if(vEvl(iv, phimagel(vp, v1, v2)))
3410 {
3411 return (i+1);
3412 }
3413 }
3414 return (0);
3415}

◆ isoNumber()

static BOOLEAN isoNumber ( leftv  res,
leftv  args 
)
static

Definition at line 4452 of file cohomo.cc.

4453{
4454 leftv h=args;
4455 if((h != NULL)&&(h->Typ() == POLY_CMD))
4456 {
4457 poly p= (poly)h->Data();
4458 h = h->next;
4459 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4460 {
4461 ideal h1= (ideal)h->Data();
4462 h = h->next;
4463 if((h != NULL)&&(h->Typ() == POLY_CMD))
4464 {
4465 poly a= (poly)h->Data();
4466 h = h->next;
4467 if((h != NULL)&&(h->Typ() == POLY_CMD))
4468 {
4469 poly b= (poly)h->Data();
4470 res->rtyp =INT_CMD;
4471 res->data =(void *)(long)isoNum(p, h1, a, b);
4472 }
4473 }
4474 }
4475 }
4476 return false;
4477}
static int isoNum(poly p, ideal I, poly a, poly b)
Definition cohomo.cc:3400

◆ isSim()

static BOOLEAN isSim ( leftv  res,
leftv  args 
)
static

Definition at line 3918 of file cohomo.cc.

3919{
3920 leftv h=args;
3921 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3922 {
3923 ideal h1= (ideal)h->Data();
3924 res->rtyp =IDEAL_CMD;
3925 res->data =IsSimplex(h1);
3926 }
3927 return false;
3928}
static ideal IsSimplex(ideal h)
Definition cohomo.cc:832

◆ IsSimplex()

static ideal IsSimplex ( ideal  h)
static

Definition at line 832 of file cohomo.cc.

833{
834 int i,max=id_maxdeg(h);
835 poly e=pOne();
837 for(i=0;i<IDELEMS(h);i++)
838 {
839 id_re=SimFacset(h->m[i]);
840 if(!idIs0(id_re))
841 {
842 id_so=idadda(id_so, id_re);//idAdd(id_so,id_re);
843 }
844 }
847 return (idMinus(id_so,h));
848}
static ideal SimFacset(poly p)
Definition cohomo.cc:787
static ideal idadda(ideal h1, ideal h2)
Definition cohomo.cc:808
static int id_maxdeg(ideal h)
Definition cohomo.cc:744

◆ keeporder()

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

Definition at line 1039 of file cohomo.cc.

1040{
1041 std::vector<int> yaya;
1042 int n;
1043 if(vec[0]>vec[1])
1044 {
1045 n=vec[0];
1046 vec[0]=vec[1];
1047 vec[1]=n;
1048 }
1049 return vec;
1050}

◆ linkn()

static BOOLEAN linkn ( leftv  res,
leftv  args 
)
static

Definition at line 4211 of file cohomo.cc.

4212{
4213 leftv h=args;
4214 if((h != NULL)&&(h->Typ() == POLY_CMD))
4215 {
4216 poly a= (poly)h->Data();
4217 h = h->next;
4218 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4219 {
4220 ideal Xo= (ideal)h->Data();
4221 h = h->next;
4222 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4223 {
4224 ideal Sigma= (ideal)h->Data();
4225 h = h->next;
4226 if((h != NULL)&&(h->Typ() == INT_CMD))
4227 {
4228 int vert= (int)(long)h->Data();
4229 h = h->next;
4230 if((h != NULL)&&(h->Typ() == INT_CMD))
4231 {
4232 int ord= (int)(long)h->Data();
4233 res->rtyp =IDEAL_CMD;
4234 res->data =idMaken(links_new(a, Xo, Sigma, vert, ord));
4235 }
4236 }
4237 }
4238 }
4239 }
4240 return false;
4241}
static std::vector< std::vector< int > > links_new(poly a, ideal Xo, ideal Sigma, int vert, int ord)
Definition cohomo.cc:3360

◆ Links()

static BOOLEAN Links ( leftv  res,
leftv  args 
)
static

Definition at line 3900 of file cohomo.cc.

3901{
3902 leftv h=args;
3903 if((h != NULL)&&(h->Typ() == POLY_CMD))
3904 {
3905 poly p= (poly)h->Data();
3906 h = h->next;
3907 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3908 {
3909 ideal h1= (ideal)h->Data();
3910 res->rtyp =IDEAL_CMD;
3911 std::vector<std::vector<int> > vecs=links(p,h1);
3912 res->data =idMaken(vecs);
3913 }
3914 }
3915 return false;
3916}

◆ links()

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

Definition at line 1293 of file cohomo.cc.

1294{
1295 int i;
1296 std::vector<std::vector<int> > lk,X=supports(h);
1297 std::vector<int> U,In,av=support1(a);
1298 for(i=0;i<X.size();i++)
1299 {
1300 U=vecUnion(av,X[i]);
1302 if( In.size()==0 && vInvsl(U,X))
1303 {
1304 //PrintS("The union of them is FACE and intersection is EMPTY!\n");
1305 lk.push_back(X[i]);
1306 }
1307 else
1308 {
1309 ;
1310 }
1311 }
1312 return lk;
1313}

◆ links_new()

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

Definition at line 3360 of file cohomo.cc.

3361{
3362 std::vector<int> av=support1(a);
3363 std::vector<std::vector<int> > lko, lkn, lk1, lk2;
3364 lko=links(a, Xo);
3365 if(ord==1)
3366 return lko;
3367 if(ord==2)
3368 {
3369 lk1=phi1(a, Sigma);
3370 lk2=phi2(a, Xo, Sigma);
3371 lkn=vsMinusvs(lko, lk1);
3372 lkn=vsUnion(lkn, lk2);
3373 return lkn;
3374 }
3375 if(ord==3)
3376 {
3377 lkn=phi2(a, Xo, Sigma);
3378 return lkn;
3379 }
3380 WerrorS("Cannot find the links smartly!");
3381 return lko;
3382}
static std::vector< std::vector< int > > phi1(poly a, ideal Sigma)
Definition cohomo.cc:3327
static std::vector< std::vector< int > > phi2(poly a, ideal Xo, ideal Sigma)
Definition cohomo.cc:3343

◆ listprint()

static void listprint ( std::vector< int vec)
static

Definition at line 49 of file cohomo.cc.

50{
51 unsigned i;
52 for(i=0;i<vec.size();i++)
53 {
54 Print(" _[%d]=%d\n",i+1,vec[i]);
55 PrintLn();
56 }
57 if(vec.size()==0)
58 {
59 PrintS(" _[1]= \n");
60 PrintLn();
61 }
62}

◆ listsinsertlist()

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

Definition at line 1561 of file cohomo.cc.

1562{
1563 std::vector<int> eq;
1564 eq.push_back(a);
1565 eq.push_back(b);
1566 gset.push_back(eq);
1567 return gset;
1568}

◆ listsprint()

static void listsprint ( std::vector< std::vector< int > >  posMat)
static

Definition at line 65 of file cohomo.cc.

66{
67 unsigned i;
68 for(i=0;i<posMat.size();i++)
69 {
70 Print("[%d]:\n",i+1);
72 Print("\n");
73 PrintLn();
74 }
75 if(posMat.size()==0)
76 {
77 PrintS("[1]:\n");
78 PrintLn();
79 }
80}
static void listprint(std::vector< int > vec)
Definition cohomo.cc:49

◆ lpprint()

static void lpprint ( std::vector< poly >  pv)
static

Definition at line 97 of file cohomo.cc.

98{
99 for(unsigned i=0;i<pv.size();i++)
100 {
101 Print(" _[%d]=",i+1);
102 pWrite(pv[i]);
103 }
104 if(pv.size()==0)
105 {
106 PrintS(" _[1]= \n");
107 PrintLn();
108 }
109}

◆ lpsprint()

static void lpsprint ( std::vector< std::vector< poly > >  pvs)
static

Definition at line 112 of file cohomo.cc.

113{
114 for(unsigned i=0;i<pvs.size();i++)
115 {
116 Print("[%d]:\n",i+1);
117 lpprint(pvs[i]);
118 Print("\n");
119 PrintLn();
120 }
121 if(pvs.size()==0)
122 {
123 PrintS("[1]:\n");
124 PrintLn();
125 }
126}
static void lpprint(std::vector< poly > pv)
Definition cohomo.cc:97

◆ mabconditionv()

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

Definition at line 963 of file cohomo.cc.

964{
965 std::vector<int> uv=vecUnion(pv,av);
966 uv=vecMinus(uv,bv);
967 if(vInvsl(uv,hvs))
968 {
969 return(true);
970 }
971 return(false);
972}

◆ 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 
)
static

Definition at line 1982 of file cohomo.cc.

1983{
1984 std::vector<int> v1,var;
1985 std::vector<std::vector<int> > vars;
1986 for(unsigned i=0;i<Mv.size();i++)
1987 {
1988 for(unsigned j=i+1;j<Mv.size();j++)
1989 {
1990 var.clear();
1991 v1=vecUnion(Mv[i],Mv[j]);
1992 if(mabconditionv(hvs, v1, av, bv))
1993 {
1994 var.push_back(i);
1995 var.push_back(j);
1996 vars.push_back(var);
1997 }
1998 }
1999 }
2000 return vars;
2001}

◆ Mabv()

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

Definition at line 975 of file cohomo.cc.

976{
977 std::vector<int> av=support1(a), bv=support1(b), pv, vec;
979 std::vector<std::vector<int> > hvs=supports(h), h2v=supports(h2), vecs;
980 for(unsigned i=0;i<h2v.size();i++)
981 {
982 pv=h2v[i];
984 {
985 vecs.push_back(pv);
986 }
987 }
988 return vecs;
989}

◆ mabvl()

static BOOLEAN mabvl ( leftv  res,
leftv  args 
)
static

Definition at line 4155 of file cohomo.cc.

4156{
4157 leftv h=args;
4158 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4159 {
4160 ideal h1= (ideal)h->Data();
4161 h = h->next;
4162 if((h != NULL)&&(h->Typ() == POLY_CMD))
4163 {
4164 poly p= (poly)h->Data();
4165 h = h->next;
4166 if((h != NULL)&&(h->Typ() == POLY_CMD))
4167 {
4168 poly q= (poly)h->Data();
4169 res->rtyp =IDEAL_CMD;
4170 res->data =idMaken(Mabv(h1,p,q));
4171 }
4172 }
4173 }
4174 return false;
4175}

◆ make0()

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

Definition at line 1185 of file cohomo.cc.

1186{
1187 int i;
1188 std::vector<int> vec;
1189 for(i=0;i<n;i++)
1190 {
1191 vec.push_back(0);
1192 }
1193 return vec;
1194}

◆ make1()

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

Definition at line 1198 of file cohomo.cc.

1199{
1200 int i;
1201 std::vector<int> vec;
1202 for(i=0;i<n;i++)
1203 {
1204 vec.push_back(1);
1205 }
1206 return vec;
1207}

◆ makeequation()

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

Definition at line 1570 of file cohomo.cc.

1571{
1572 std::vector<int> equation;
1573 equation.push_back(i);
1574 equation.push_back(j);
1575 equation.push_back(t);
1576 //listprint(equation);
1577 return equation;
1578}

◆ makeSimplex()

static BOOLEAN makeSimplex ( leftv  res,
leftv  args 
)
static

Definition at line 3734 of file cohomo.cc.

3735{
3736 leftv h=args;
3737 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3738 {
3739 ideal h1= (ideal)h->Data();
3740 res->rtyp =IDEAL_CMD;
3741 res->data =complementsimplex(h1);
3742 }
3743 return false;
3744}
static ideal complementsimplex(ideal h)
Definition cohomo.cc:853

◆ mingens()

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

Definition at line 2276 of file cohomo.cc.

2277{
2278 int i;
2279 std::vector<std::vector<int> > mv=Mabv(h,a,b);
2280 ideal M=idMaken(mv), hi=idInit(1,1);
2281 std::vector<int> index = gensindex(M, idsrRing(h));
2282 for(i=0;i<index.size();i++)
2283 {
2284 idInsertPoly(hi,M->m[index[i]]);
2285 }
2287 return (hi);
2288}

◆ minisolve()

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

Definition at line 2290 of file cohomo.cc.

2291{
2292 int i,j;
2293 std::vector<int> vec,solm;
2294 std::vector<std::vector<int> > solsm;
2295 for(i=0;i<solve.size();i++)
2296 {
2297 vec=solve[i];
2298 for(j=0;j<vec.size();j++)
2299 {
2300 if(IsinL(j,index))
2301 solm.push_back(vec[j]);
2302 }
2303 solsm.push_back(solm);
2304 solm.clear();
2305 }
2306 return (solsm);
2307}

◆ nabconditionv()

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

Definition at line 2091 of file cohomo.cc.

2092{
2093 std::vector<int> vec1=vecIntersection(pv,bv), vec2=vecUnion(pv,bv);
2094 int s1=vec1.size();
2095 if(!vInvsl(vec2,hvs) && s1==0 && vsubset(av,pv))
2096 {
2097 //PrintS("nab condition satisfied\n");
2098 return(true);
2099 }
2100 //PrintS("nab condition not satisfied\n");
2101 return(false);
2102}

◆ nabtconditionv()

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

Definition at line 2122 of file cohomo.cc.

2123{
2124 std::vector<int> v1;
2125 v1=vecUnion(pv,qv);
2126 if(vInvsl(v1,hvs))
2127 {
2128 return (true);
2129 }
2130 return (false);
2131}

◆ 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 
)
static

Definition at line 2134 of file cohomo.cc.

2135{
2136 std::vector<int> v1,var;
2137 std::vector<std::vector<int> > vars;
2138 for(unsigned i=0;i<Nv.size();i++)
2139 {
2140 for(unsigned j=i+1;j<Nv.size();j++)
2141 {
2142 var.clear();
2143 if(nabtconditionv(hvs, Nv[i], Nv[j]))
2144 {
2145 var.push_back(i);
2146 var.push_back(j);
2147 vars.push_back(var);
2148 }
2149 }
2150 }
2151 return vars;
2152}

◆ nabtvl()

static BOOLEAN nabtvl ( leftv  res,
leftv  args 
)
static

Definition at line 4177 of file cohomo.cc.

4178{
4179 leftv h=args;
4180 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4181 {
4182 ideal h1= (ideal)h->Data();
4183 h = h->next;
4184 if((h != NULL)&&(h->Typ() == POLY_CMD))
4185 {
4186 poly p= (poly)h->Data();
4187 h = h->next;
4188 if((h != NULL)&&(h->Typ() == POLY_CMD))
4189 {
4190 poly q= (poly)h->Data();
4191 std::vector<std::vector<int> > hvs=supports(h1), nv, ntvs;
4192 std::vector<int> av=support1(p), bv=support1(q);
4193 nv=Nabv(hvs,av,bv);
4194 ntvs=nabtv( hvs, nv, av, bv);
4195 std::vector<std::vector<poly> > pvs=idMakei(nv,ntvs);
4196 ideal gens=idInit(1,1);
4197 for(unsigned i=0;i<pvs.size();i++)
4198 {
4199 idInsertPoly(gens,pvs[i][0]);
4200 idInsertPoly(gens,pvs[i][1]);
4201 }
4203 res->rtyp =IDEAL_CMD;
4204 res->data =gens;
4205 }
4206 }
4207 }
4208 return false;
4209}

◆ Nabv()

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

Definition at line 2105 of file cohomo.cc.

2106{
2107 std::vector<std::vector<int> > vecs;
2108 int num=hvs.size();
2109 for(int i=0;i<num;i++)
2110 {
2111 if(nabconditionv(hvs,hvs[i],av,bv))
2112 {
2113 //PrintS("satisfy:\n");
2114 vecs.push_back(hvs[i]);
2115 }
2116 }
2117 return vecs;
2118}
static bool nabconditionv(std::vector< std::vector< int > > hvs, std::vector< int > pv, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:2091

◆ nabvl()

static BOOLEAN nabvl ( leftv  res,
leftv  args 
)
static

Definition at line 4081 of file cohomo.cc.

4082{
4083 leftv h=args;
4084 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4085 {
4086 ideal h1= (ideal)h->Data();
4087 h = h->next;
4088 if((h != NULL)&&(h->Typ() == POLY_CMD))
4089 {
4090 poly p= (poly)h->Data();
4091 h = h->next;
4092 if((h != NULL)&&(h->Typ() == POLY_CMD))
4093 {
4094 poly q= (poly)h->Data();
4095 res->rtyp =IDEAL_CMD;
4096 std::vector<std::vector<int> > vecs=supports(h1);
4097 std::vector<int> pv=support1(p), qv=support1(q);
4098 res->data =idMaken(Nabv(vecs,pv,qv));
4099 }
4100 }
4101 }
4102 return false;
4103}

◆ newDegree()

static BOOLEAN newDegree ( leftv  res,
leftv  args 
)
static

Definition at line 4516 of file cohomo.cc.

4517{
4518 leftv h=args;
4519 if((h != NULL)&&(h->Typ() == POLY_CMD))
4520 {
4521 poly p= (poly)h->Data();
4522 h = h->next;
4523 if((h != NULL)&&(h->Typ() == INT_CMD))
4524 {
4525 int num= (int)(long)h->Data();
4526 res->rtyp =INT_CMD;
4527 res->data =(void *)(long)redefinedeg( p, num);
4528 }
4529 }
4530 return false;
4531}
static int redefinedeg(poly p, int num)
Definition cohomo.cc:1315

◆ nfaces1()

BOOLEAN nfaces1 ( leftv  res,
leftv  args 
)

Definition at line 3930 of file cohomo.cc.

3931{
3932 leftv h=args;
3933 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3934 {
3935 ideal h1= (ideal)h->Data();
3936 h = h->next;
3937 if((h != NULL)&&(h->Typ() == POLY_CMD))
3938 {
3939 poly p= (poly)h->Data();
3940 h = h->next;
3941 if((h != NULL)&&(h->Typ() == INT_CMD))
3942 {
3943 int d= (int)(long)h->Data();
3944 res->rtyp =IDEAL_CMD;
3945 res->data =triangulations1(h1, p, d);
3946 }
3947 }
3948 }
3949 return false;
3950}
static ideal triangulations1(ideal h, poly p, int vert)
Definition cohomo.cc:3003

◆ nfaces2()

static BOOLEAN nfaces2 ( leftv  res,
leftv  args 
)
static

Definition at line 3952 of file cohomo.cc.

3953{
3954 leftv h=args;
3955 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3956 {
3957 ideal h1= (ideal)h->Data();
3958 h = h->next;
3959 if((h != NULL)&&(h->Typ() == POLY_CMD))
3960 {
3961 poly p= (poly)h->Data();
3962 h = h->next;
3963 if((h != NULL)&&(h->Typ() == POLY_CMD))
3964 {
3965 poly q= (poly)h->Data();
3966 h = h->next;
3967 if((h != NULL)&&(h->Typ() == INT_CMD))
3968 {
3969 int d= (int)(long)h->Data();
3970 res->rtyp =IDEAL_CMD;
3971 res->data =triangulations2(h1,p,q,d);
3972 }
3973 }
3974 }
3975 }
3976 return false;
3977}
static ideal triangulations2(ideal h, poly p, poly q, int vert)
Definition cohomo.cc:3093

◆ nfaces3()

static BOOLEAN nfaces3 ( leftv  res,
leftv  args 
)
static

Definition at line 3979 of file cohomo.cc.

3980{
3981 leftv h=args;
3982 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3983 {
3984 ideal h1= (ideal)h->Data();
3985 h = h->next;
3986 if((h != NULL)&&(h->Typ() == POLY_CMD))
3987 {
3988 poly p= (poly)h->Data();
3989 h = h->next;
3990 if((h != NULL)&&(h->Typ() == POLY_CMD))
3991 {
3992 poly q= (poly)h->Data();
3993 h = h->next;
3994 if((h != NULL)&&(h->Typ() == POLY_CMD))
3995 {
3996 poly g= (poly)h->Data();
3997 h = h->next;
3998 if((h != NULL)&&(h->Typ() == INT_CMD))
3999 {
4000 int d= (int)(long)h->Data();
4001 res->rtyp =IDEAL_CMD;
4002 res->data =triangulations3(h1,p,q,g,d);
4003 }
4004 }
4005 }
4006 }
4007 }
4008 return false;
4009}
static ideal triangulations3(ideal h, poly p, poly q, poly g, int vert)
Definition cohomo.cc:3152

◆ nonf2f()

static BOOLEAN nonf2f ( leftv  res,
leftv  args 
)
static

Definition at line 4533 of file cohomo.cc.

4534{
4535 leftv h=args;
4536 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4537 {
4538 ideal h1= (ideal)h->Data();
4539 res->rtyp =IDEAL_CMD;
4540 res->data =complementsimplex(h1);
4541 }
4542 return false;
4543}

◆ num4dim()

static int num4dim ( ideal  h,
int  n 
)
static

Definition at line 889 of file cohomo.cc.

890{
891 int num=0;
892 for(int i=0; i<IDELEMS(h); i++)
893 {
894 if(pTotaldegree(h->m[i])==n)
895 {
896 num++;
897 }
898 }
899 return num;
900}

◆ numdim()

static BOOLEAN numdim ( leftv  res,
leftv  args 
)
static

Definition at line 4557 of file cohomo.cc.

4558{
4559 leftv h=args;
4560 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4561 {
4562 ideal h1= (ideal)h->Data();
4563 h = h->next;
4564 if((h != NULL)&&(h->Typ() == INT_CMD))
4565 {
4566 int num= (int)(long)h->Data();
4567 res->rtyp =INT_CMD;
4568 res->data =(void *)(long)num4dim( h1, num);
4569 }
4570 }
4571 return false;
4572}
static int num4dim(ideal h, int n)
Definition cohomo.cc:889

◆ numfree()

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

Definition at line 1823 of file cohomo.cc.

1824{
1825 int i,j;
1826 std::vector<int> fvar;
1827 for(j=1;j<=currRing->N;j++)
1828 {
1829 for(i=0;i<IDELEMS(h);i++)
1830 {
1831 if(vInp(j,h->m[i]))
1832 {
1833 fvar.push_back(j);
1834 break;
1835 }
1836 }
1837 }
1838 //Print("There are %d free variables in total\n",num);
1839 return fvar;
1840}
static bool vInp(int m, poly p)
Definition cohomo.cc:405

◆ ofindbases()

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

Definition at line 1227 of file cohomo.cc.

1228{
1229 int i,m;
1230 std::vector<std::vector<int> > bases;
1231 std::vector<int> fvars=freevars(num, bset, gset), base1;
1232 if (fvars.size()==0)
1233 {
1234 base1=make0(num);
1235 bases.push_back(base1);
1236 }
1237 else
1238 {
1239 for(i=0;i<fvars.size();i++)
1240 {
1241 m=fvars[i];
1243 bases.push_back(base1);
1244 }
1245 }
1246 //PrintS("They are the bases for the solution space:\n");
1247 //listsprint(bases);
1248 return bases;
1249}
static std::vector< int > freevars(int n, std::vector< int > bset, std::vector< std::vector< int > > gset)
Definition cohomo.cc:1085
static std::vector< int > ofindbases1(int num, int vnum, std::vector< int > bset, std::vector< std::vector< int > > gset)
Definition cohomo.cc:1211

◆ ofindbases1()

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

Definition at line 1211 of file cohomo.cc.

1212{
1213 std::vector<std::vector<int> > goodset;
1214 std::vector<int> fvars=freevars(num, bset, gset), oset, base;
1215 std::vector<int> zset=fvarsvalue(vnum, fvars);
1217 oset.push_back(vnum);
1219 oset=goodset[goodset.size()-1];
1220 goodset.erase(goodset.end());
1221 base= vecbase1(num, oset);
1222 return base;
1223}
static std::vector< int > vecbase1(int num, std::vector< int > oset)
Definition cohomo.cc:1169
static std::vector< int > fvarsvalue(int vnum, std::vector< int > fvars)
Definition cohomo.cc:1108
char N base

◆ p_a()

static ideal p_a ( ideal  h)
static

Definition at line 1335 of file cohomo.cc.

1336{
1337 poly p;
1338 int i,j,deg=0,deg0;
1339 ideal aset=idCopy(h),ia,h1=idsrRing(h);
1340//PrintS("idsrRing is:\n");id_print(h1);
1341 std::vector<int> as;
1342 std::vector<std::vector<int> > hvs=supports(h);
1343 for(i=0;i<IDELEMS(h1);i++)
1344 {
1345 deg0=pTotaldegree(h1->m[i]);
1346 if(deg < deg0)
1347 deg=deg0;
1348 }
1349 for(i=2;i<=deg;i++)
1350 {
1351 ia=id_MaxIdeal(i, currRing);
1352 for(j=0;j<IDELEMS(ia);j++)
1353 {
1354 p=pCopy(ia->m[j]);
1355 if(!IsInX(p,h))
1356 {
1357 as=support1(p);
1358 if(vInvsl(as,hvs))
1359 {
1361 }
1362 }
1363 }
1364 }
1366 return(aset);
1367}

◆ p_b()

static ideal p_b ( ideal  h,
poly  a 
)
static

Definition at line 1427 of file cohomo.cc.

1428{
1429 std::vector<std::vector<int> > pbv,lk=links(a,h), res;
1430 std::vector<int> vert=vertset(lk), bv;
1432 int i, adg=pTotaldegree(a);
1433 poly e=pOne();
1434 ideal idd=idInit(1,1);
1435 for(i=0;i<res.size();i++)
1436 {
1437 if(res[i].size()==adg)
1438 pbv.push_back(res[i]);
1439 }
1440 if(pEqualPolys(a,e))
1441 {
1442 idInsertPoly(idd, e);
1444 return (idd);
1445 }
1446 idd=idMaken(pbv);
1447 return(idd);
1448}
static std::vector< int > vertset(std::vector< std::vector< int > > vecs)
Definition cohomo.cc:1404

◆ p_change()

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

Definition at line 3254 of file cohomo.cc.

3255{
3256 std::vector<std::vector<int> > ss=supports(idCopy(Sigma)), fvs;
3257 fvs=vs_subsets(ss);
3258 return (fvs);
3259}
static std::vector< std::vector< int > > vs_subsets(std::vector< std::vector< int > > vs)
Definition cohomo.cc:3235

◆ p_constant()

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

Definition at line 3246 of file cohomo.cc.

3247{
3248 std::vector<std::vector<int> > xs=supports(idCopy(Xo)), ss=supports(idCopy(Sigma)), fvs1;
3251 return fvs1;
3252}

◆ p_Ifsfree()

static bool p_Ifsfree ( poly  P)
static

Definition at line 643 of file cohomo.cc.

644{
645 int i,sf=1;
646 for(i=1;i<=rVar(currRing);i++)
647 {
648 if (pGetExp(P,i)>1)
649 {
650 sf=0;
651 break;
652 }
653 }
654 return sf;
655}

◆ p_new()

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

Definition at line 3261 of file cohomo.cc.

3262{
3263 int vert=0;
3264 std::vector<std::vector<int> > ss=supports(idCopy(Sigma)), fvs;
3265 for(int i=1;i<=currRing->N;i++)
3266 {
3267 for(int j=0;j<IDELEMS(Xo);j++)
3268 {
3269 if(pGetExp(Xo->m[j],i)>0)
3270 {
3271 vert=i+1;
3272 break;
3273 }
3274 }
3275 }
3276 int typ=ss.size();
3277 if(typ==1)
3278 {
3279 fvs=triface(Sigma->m[0], vert);
3280 }
3281 else if(typ==2)
3282 {
3283 fvs=tetraface(Sigma->m[0], Sigma->m[1], vert);
3284 }
3285 else
3286 {
3287 fvs=penface(Sigma->m[0], Sigma->m[1], Sigma->m[2], vert);
3288 }
3289 return (fvs);
3290}
static std::vector< std::vector< int > > penface(poly p, poly q, poly g, int vert)
Definition cohomo.cc:3108
static std::vector< std::vector< int > > tetraface(poly p, poly q, int vert)
Definition cohomo.cc:3071
static std::vector< std::vector< int > > triface(poly p, int vert)
Definition cohomo.cc:2984

◆ p_New()

static BOOLEAN p_New ( leftv  res,
leftv  args 
)
static

Definition at line 4289 of file cohomo.cc.

4290{
4291 leftv h=args;
4292 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4293 {
4294 ideal h1= (ideal)h->Data();
4295 h = h->next;
4296 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4297 {
4298 ideal h2= (ideal)h->Data();
4299 res->rtyp =IDEAL_CMD;
4300 res->data =idMaken(p_new(h1,h2));
4301 }
4302 }
4303 return false;
4304}

◆ pa()

static BOOLEAN pa ( leftv  res,
leftv  args 
)
static

Definition at line 3722 of file cohomo.cc.

3723{
3724 leftv h=args;
3725 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3726 {
3727 ideal h1= (ideal)h->Data();
3728 res->rtyp =IDEAL_CMD;
3729 res->data =p_a(h1);
3730 }
3731 return false;
3732}
static ideal p_a(ideal h)
Definition cohomo.cc:1335

◆ pb()

static BOOLEAN pb ( leftv  res,
leftv  args 
)
static

Definition at line 3746 of file cohomo.cc.

3747{
3748 leftv h=args;
3749 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3750 {
3751 ideal h1= (ideal)h->Data();
3752 h = h->next;
3753 if((h != NULL)&&(h->Typ() == POLY_CMD))
3754 {
3755 poly p= (poly)h->Data();
3756 res->rtyp =IDEAL_CMD;
3757 res->data =p_b(h1,p);
3758 }
3759 }
3760 return false;
3761}
static ideal p_b(ideal h, poly a)
Definition cohomo.cc:1427

◆ pChange()

static BOOLEAN pChange ( leftv  res,
leftv  args 
)
static

Definition at line 4277 of file cohomo.cc.

4278{
4279 leftv h=args;
4280 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4281 {
4282 ideal h1= (ideal)h->Data();
4283 res->rtyp =IDEAL_CMD;
4284 res->data =idMaken(p_change(h1));
4285 }
4286 return false;
4287}

◆ pcoef()

static int pcoef ( poly  p,
int  m 
)
static

Definition at line 386 of file cohomo.cc.

387{
388 int i,co; poly q=pCopy(p);
389 for(i=1;i<=currRing->N;i++)
390 {
391 if(p_GetExp(q,m,currRing)!=0)
392 {
393 co=n_Int(pGetCoeff(q),currRing->cf);
394 return co;
395 }
396 else
397 q=pNext(q);
398 }
399 if(q!=NULL)
400 co=0;
401 return co;
402}
#define pNext(p)
Definition monomials.h:36
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:469

◆ pConstant()

static BOOLEAN pConstant ( leftv  res,
leftv  args 
)
static

Definition at line 4260 of file cohomo.cc.

4261{
4262 leftv h=args;
4263 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4264 {
4265 ideal h1= (ideal)h->Data();
4266 h = h->next;
4267 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4268 {
4269 ideal h2= (ideal)h->Data();
4270 res->rtyp =IDEAL_CMD;
4271 res->data =idMaken(p_constant(h1,h2));
4272 }
4273 }
4274 return false;
4275}

◆ penface()

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

Definition at line 3108 of file cohomo.cc.

3109{
3110 int en=0;
3111 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);
3112 std::vector<std::vector<int> > fvs1, fvs2, fvs3, fvs, evec;
3113 evec.push_back(ev1);
3114 evec.push_back(ev2);
3115 evec.push_back(ev3);
3116 for(unsigned i=0;i<evec.size();i++)
3117 {
3118 if(evec[i].size()==2)
3119 {
3120 en++;
3121 }
3122 }
3123 if(en==2)
3124 {
3125 vec.push_back(vert);
3126 fvs.push_back(vec);
3135 for(unsigned i=0;i<evec.size();i++)
3136 {
3137 if(evec[i].size()==2)
3138 {
3139 fvs3=vsMinusv(fvs3, evec[i]);
3140 }
3141 }
3142 for(unsigned i=0;i<fvs3.size();i++)
3143 {
3144 vec=fvs3[i];
3145 vec.push_back(vert);
3146 fvs.push_back(vec);
3147 }
3148 }
3149 return (fvs);
3150}

◆ phi1()

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

Definition at line 3327 of file cohomo.cc.

3328{
3329 std::vector<std::vector<int> > ss=supports(idCopy(Sigma)), fvs;
3330 std::vector<int> av=support1(a), intvec, vv;
3331 for(unsigned i=0;i<ss.size();i++)
3332 {
3334 if(intvec.size()==av.size())
3335 {
3336 vv=vecMinus(ss[i], av);
3337 fvs.push_back(vv);
3338 }
3339 }
3340 return fvs;
3341}

◆ phi2()

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

Definition at line 3343 of file cohomo.cc.

3344{
3345
3346 std::vector<std::vector<int> > ss=p_new(Sigma, Xo), fvs;
3347 std::vector<int> av=support1(a), intvec, vv;
3348 for(unsigned i=0;i<ss.size();i++)
3349 {
3351 if(intvec.size()==av.size())
3352 {
3353 vv=vecMinus(ss[i], av);
3354 fvs.push_back(vv);
3355 }
3356 }
3357 return fvs;
3358}

◆ phimage()

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

Definition at line 2186 of file cohomo.cc.

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

◆ phimagel()

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

Definition at line 2648 of file cohomo.cc.

2649{
2650 std::vector<int> nv;
2651 nv=vecMinus(fv,bv);
2652 nv=vecMinus(nv,av);
2653 return nv;
2654}

◆ pMake()

static poly pMake ( std::vector< int vbase)
static

Definition at line 343 of file cohomo.cc.

344{
345 int n=vbase.size(); poly p,q=0;
346 for(int i=0;i<n;i++)
347 {
348 if(vbase[i]!=0)
349 {
350 p = pOne();pSetExp(p, i+1, 1);pSetm(p);pSetCoeff(p, nInit(vbase[i]));
351 q = pAdd(q, p);
352 }
353 }
354 return q;
355}
#define pAdd(p, q)
Definition polys.h:203

◆ pMake3()

static poly pMake3 ( std::vector< int vbase)
static

Definition at line 1583 of file cohomo.cc.

1584{
1585 int co=1;
1586 poly p,q=0;
1587 for(int i=0;i<3;i++)
1588 {
1589 if(vbase[i]!=0)
1590 {
1591 if(i==1) co=-1;
1592 p = pOne();pSetExp(p, vbase[i], 1);pSetm(p);pSetCoeff(p, nInit(co));
1593 }
1594 else p=0;
1595 q = pAdd(q, p);
1596 co=1;
1597 }
1598 return q;
1599}

◆ pMakei()

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

Definition at line 1656 of file cohomo.cc.

1657{
1658 poly p;
1659 std::vector<poly> h1;
1660 int n=vbase.size();
1661 for(int i=0;i<n;i++)
1662 {
1663 p=pMaken(mv[vbase[i]]);
1664 h1.push_back(p);
1665 }
1666 return h1;
1667}

◆ pMaken()

static poly pMaken ( std::vector< int vbase)
static

Definition at line 465 of file cohomo.cc.

466{
467 int n=vbase.size();
468 poly p,q=pOne();
469 for(int i=0;i<n;i++)
470 {
471 p = pOne();pSetExp(p, vbase[i], 1);pSetm(p);pSetCoeff(p, nInit(1));
472 //pWrite(p);
473 q=pp_Mult_mm(q,p,currRing);
474 }
475 return q;
476}
static poly pp_Mult_mm(poly p, poly m, const ring r)
Definition p_polys.h:1031

◆ psMinusp()

static BOOLEAN psMinusp ( leftv  res,
leftv  args 
)
static

Definition at line 4330 of file cohomo.cc.

4331{
4332 leftv h=args;
4333 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4334 {
4335 ideal h1= (ideal)h->Data();
4336 h = h->next;
4337 if((h != NULL)&&(h->Typ() == POLY_CMD))
4338 {
4339 poly p= (poly)h->Data();
4340 res->rtyp =IDEAL_CMD;
4341 res->data =idMinusp(h1, p);
4342 }
4343 }
4344 return false;
4345}
static ideal idMinusp(ideal I, poly p)
Definition cohomo.cc:3428

◆ psubset()

static ideal psubset ( poly  p)
static

Definition at line 1539 of file cohomo.cc.

1540{
1541 int i,j,max=pTotaldegree(p);
1542 ideal h1,mons, id_re=idInit(1,1);
1543 for(i=1;i<max;i++)
1544 {
1546 h1=sfreemon(mons,i);
1547 for(j=0;j<IDELEMS(h1);j++)
1548 {
1549 if(p_DivisibleBy(h1->m[j],p,currRing))
1550 idInsertPoly(id_re, h1->m[j]);
1551 }
1552 }
1554 //PrintS("This is the facset\n");
1555 //id_print(id_re);
1556 return id_re;
1557}

◆ pvert()

static int pvert ( poly  p)
static

Definition at line 541 of file cohomo.cc.

542{
543 int i, vert=0;
544 for(i=currRing->N;i>0;i--)
545 {
546 if(pGetExp(p,i)>0)
547 {
548 vert=i;
549 return vert;
550 }
551 }
552 return vert;
553}

◆ qringadd()

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

Definition at line 735 of file cohomo.cc.

736{
737 ideal h,qrh;
738 h=idAdd(h1,h2);
739 qrh=scKBase(deg,h);
740 return qrh;
741}

◆ redefinedeg()

static int redefinedeg ( poly  p,
int  num 
)
static

Definition at line 1315 of file cohomo.cc.

1316{
1317 int deg=0, deg0;
1318 for(int i=1;i<=currRing->N;i++)
1319 {
1320 deg0=pGetExp(p, i);
1321 if(i>num)
1322 {
1323 deg= deg+2*deg0;
1324 }
1325 else
1326 {
1327 deg=deg+deg0;
1328 }
1329 }
1330 //Print("the new degree is: %d\n", deg);
1331 return (deg);
1332}

◆ sfreemon()

static ideal sfreemon ( ideal  h,
int  deg 
)
static

Definition at line 658 of file cohomo.cc.

659{
660 int j;
661 ideal temp;
662 temp=idInit(1,1);
663 if(!idIs0(h))
664 {
665 for(j=0;j<IDELEMS(h);j++)
666 {
667 if((p_Ifsfree(h->m[j]))&&(pTotaldegree(h->m[j])==deg))
668 {
669 idInsertPoly(temp, h->m[j]);
670 }
671 }
673 }
674 return temp;
675}
static bool p_Ifsfree(poly P)
Definition cohomo.cc:643

◆ sgp()

static BOOLEAN sgp ( leftv  res,
leftv  args 
)
static

Definition at line 3856 of file cohomo.cc.

3857{
3858 leftv h=args;
3859 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3860 {
3861 ideal h1= (ideal)h->Data();
3862 h = h->next;
3863 if((h != NULL)&&(h->Typ() == POLY_CMD))
3864 {
3865 poly p= (poly)h->Data();
3866 h = h->next;
3867 if((h != NULL)&&(h->Typ() == POLY_CMD))
3868 {
3869 poly q= (poly)h->Data();
3870 res->rtyp =INTVEC_CMD;
3871 res->data =gradedpiece2n(h1,p,q);
3872 }
3873 }
3874 }
3875 return false;
3876}
static intvec * gradedpiece2n(ideal h, poly a, poly b)
Definition cohomo.cc:2527

◆ sgpl()

static BOOLEAN sgpl ( leftv  res,
leftv  args 
)
static

Definition at line 3878 of file cohomo.cc.

3879{
3880 leftv h=args;
3881 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3882 {
3883 ideal h1= (ideal)h->Data();
3884 h = h->next;
3885 if((h != NULL)&&(h->Typ() == POLY_CMD))
3886 {
3887 poly p= (poly)h->Data();
3888 h = h->next;
3889 if((h != NULL)&&(h->Typ() == POLY_CMD))
3890 {
3891 poly q= (poly)h->Data();
3892 res->rtyp =INTVEC_CMD;
3893 res->data =gradedpiece2nl(h1,p,q);
3894 }
3895 }
3896 }
3897 return false;
3898}
static intvec * gradedpiece2nl(ideal h, poly a, poly b)
Definition cohomo.cc:2912

◆ SimFacset()

static ideal SimFacset ( poly  p)
static

Definition at line 787 of file cohomo.cc.

788{
789 int i,j,max=pTotaldegree(p);
790 ideal h1,mons,id_re=idInit(1,1);
791 for(i=1;i<max;i++)
792 {
794 h1=sfreemon(mons,i);
795
796 for(j=0;j<IDELEMS(h1);j++)
797 {
798 if(p_DivisibleBy(h1->m[j],p,currRing))
799 {
800 idInsertPoly(id_re, h1->m[j]);
801 }
802 }
803 }
805 return id_re;
806}

◆ soleli1()

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

Definition at line 1052 of file cohomo.cc.

1053{
1054 int i;
1055 std::vector<int> yaya;
1056 std::vector<std::vector<int> > pre=eqs, ppre, re;
1057 if(eqs.size()>0)
1058 {
1059 re.push_back(eqs[0]);
1060 pre.erase(pre.begin());
1061 }
1062 while(pre.size()>0)
1063 {
1064 yaya=keeporder(eli1(re[0],pre[0]));
1065 for(i=1;i<re.size();i++)
1066 {
1067 if(!vInvsl(yaya, re))
1068 {
1069 yaya=eli1(re[i],yaya);
1071 }
1072 }
1073 if(!vInvsl(yaya, re))
1074 {
1075 re.push_back(yaya);
1076 }
1077 pre.erase(pre.begin());
1078 }
1079 return re;
1080}
static std::vector< int > keeporder(std::vector< int > vec)
Definition cohomo.cc:1039
static std::vector< int > eli1(std::vector< int > eq1, std::vector< int > eq2)
Definition cohomo.cc:996

◆ SRideal()

static BOOLEAN SRideal ( leftv  res,
leftv  args 
)
static

Definition at line 3599 of file cohomo.cc.

3600{
3601 leftv h=args;
3602 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3603 {
3604 ideal hh=(ideal)h->Data();
3605 res->rtyp =IDEAL_CMD;
3606 res->data =idsrRing(hh);
3607 }
3608 return false;
3609}

◆ star()

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

Definition at line 3472 of file cohomo.cc.

3473{
3474 int i;
3475 std::vector<std::vector<int> > st,X=supports(h);
3476 std::vector<int> U,av=support1(a);
3477 for(i=0;i<X.size();i++)
3478 {
3479 U=vecUnion(av,X[i]);
3480 if(vInvsl(U,X))
3481 {
3482 st.push_back(X[i]);
3483 }
3484 }
3485 return st;
3486}

◆ stars()

static BOOLEAN stars ( leftv  res,
leftv  args 
)
static

Definition at line 4384 of file cohomo.cc.

4385{
4386 leftv h=args;
4387 if((h != NULL)&&(h->Typ() == POLY_CMD))
4388 {
4389 poly p= (poly)h->Data();
4390 h = h->next;
4391 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4392 {
4393 ideal h1= (ideal)h->Data();
4394 res->rtyp =IDEAL_CMD;
4395 res->data =idMaken(star(p, h1));
4396 }
4397 }
4398 return false;
4399}
static std::vector< std::vector< int > > star(poly a, ideal h)
Definition cohomo.cc:3472

◆ stellarremain()

static BOOLEAN stellarremain ( leftv  res,
leftv  args 
)
static

Definition at line 4347 of file cohomo.cc.

4348{
4349 leftv h=args;
4350 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4351 {
4352 ideal h1= (ideal)h->Data();
4353 h = h->next;
4354 if((h != NULL)&&(h->Typ() == POLY_CMD))
4355 {
4356 poly p= (poly)h->Data();
4357 std::vector<std::vector<int> > st=star(p, h1);
4358 std::vector<std::vector<int> > hvs=supports(h1);
4359 std::vector<std::vector<int> > re= vsMinusvs(hvs, st);
4360 res->rtyp =IDEAL_CMD;
4361 res->data =idMaken(re);
4362 }
4363 }
4364 return false;
4365}

◆ stellarsub()

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

Definition at line 3498 of file cohomo.cc.

3499{
3500 std::vector<std::vector<int> > vecs_minus, vecs_plus, lk=links(a,h), hvs=supports(h), sub, bys=boundary(a);
3501 std::vector<int> av=support1(a), vec, vec_n;
3502 int i,j,vert=0;
3503 for(i=1;i<=currRing->N;i++)
3504 {
3505 for(j=0;j<IDELEMS(h);j++)
3506 {
3507 if(pGetExp(h->m[j],i)>0)
3508 {
3509 vert=i+1;
3510 break;
3511 }
3512 }
3513 }
3514 vec_n.push_back(vert);
3515 for(i=0;i<lk.size();i++)
3516 {
3517 vec=vecUnion(av, lk[i]);
3518 vecs_minus.push_back(vec);
3519 for(j=0;j<bys.size();j++)
3520 {
3521 vec=vecUnion(lk[i], vec_n);
3522 vec=vecUnion(vec, bys[j]);
3523 vecs_plus.push_back(vec);
3524 }
3525 }
3526 sub=vsMinusvs(hvs, vecs_minus);
3527 sub=vsUnion(sub, vecs_plus);
3528 return(sub);
3529}
static std::vector< std::vector< int > > boundary(poly a)
Definition cohomo.cc:3488

◆ stellarsubdivision()

static BOOLEAN stellarsubdivision ( leftv  res,
leftv  args 
)
static

Definition at line 4401 of file cohomo.cc.

4402{
4403 leftv h=args;
4404 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4405 {
4406 ideal h2= (ideal)h->Data();
4407 h = h->next;
4408 if((h != NULL)&&(h->Typ() == POLY_CMD))
4409 {
4410 poly p= (poly)h->Data();
4411 res->rtyp =IDEAL_CMD;
4412 res->data =idMaken(stellarsub(p, h2));
4413 }
4414 }
4415 return false;
4416}
static std::vector< std::vector< int > > stellarsub(poly a, ideal h)
Definition cohomo.cc:3498

◆ subspace1()

static std::vector< int > subspace1 ( std::vector< std::vector< int > >  mv,
std::vector< int bv 
)
static

Definition at line 1639 of file cohomo.cc.

1640{
1641 int i, num=mv.size();
1642 std::vector<int> base;
1643 for(i=0;i<num;i++)
1644 {
1645 if(IsinL(bv[0],mv[i]))
1646 base.push_back(1);
1647 else
1648 base.push_back(0);
1649 }
1650 return base;
1651}

◆ subspacet()

static std::vector< std::vector< int > > subspacet ( std::vector< std::vector< int > >  mv,
std::vector< int bv,
std::vector< std::vector< int > >  ntvs 
)
static

Definition at line 1968 of file cohomo.cc.

1969{
1970 std::vector<int> alset=findalpha(mv,bv), subase;
1971 std::vector<std::vector<int> > subases;
1972 for(unsigned i=0;i<alset.size();i++)
1973 {
1975 subases.push_back(subase);
1976 }
1977 //PrintS("These are the bases for the subspace:\n");
1978 //listsprint(subases);
1979 return subases;
1980}
static std::vector< int > subspacet1(int num, std::vector< std::vector< int > > ntvs)
Definition cohomo.cc:1941
static std::vector< int > findalpha(std::vector< std::vector< int > > mv, std::vector< int > bv)
Definition cohomo.cc:1926

◆ subspacet1()

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

Definition at line 1941 of file cohomo.cc.

1942{
1943 int i, j, t, n=ntvs.size();
1944 std::vector<int> subase;
1945 for(t=0;t<n;t++)
1946 {
1947 i=ntvs[t][0];
1948 j=ntvs[t][1];
1949 if(i==(num))
1950 {
1951 subase.push_back(1);
1952 }
1953 else if(j==num)
1954 {
1955 subase.push_back(-1);
1956 }
1957 else
1958 {
1959 subase.push_back(0);
1960 }
1961 }
1962 //Print("This is the basis w.r.t. %dth polynomial in alpha set\n",num);
1963 //listprint(subase);
1964 return subase;
1965}

◆ subspacetn()

static 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 2439 of file cohomo.cc.

2440{
2441 int i;
2442 std::vector<int> alset=findalphan(N,tN), subase;
2443 std::vector<std::vector<int> > subases;
2444 for(i=0;i<alset.size();i++)
2445 {
2447 subases.push_back(subase);
2448 }
2449 //PrintS("These are the bases for the subspace:\n");
2450 //listsprint(subases);
2451 return subases;
2452}
static std::vector< int > findalphan(std::vector< std::vector< int > > N, std::vector< int > tN)
Definition cohomo.cc:2423

◆ support()

static BOOLEAN support ( leftv  res,
leftv  args 
)
static

Definition at line 4306 of file cohomo.cc.

4307{
4308 leftv h=args;
4309 if((h != NULL)&&(h->Typ() == POLY_CMD))
4310 {
4311 poly p= (poly)h->Data();
4312 res->rtyp =INT_CMD;
4313 res->data =(void *)(long)(support1(p).size());
4314 }
4315 return false;
4316}

◆ support1()

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

Definition at line 271 of file cohomo.cc.

272{
273 int j;
274 std::vector<int> supset;
275 if(p==0) return supset;
276 for(j=1;j<=rVar(currRing);j++)
277 {
278 if(pGetExp(p,j)>0)
279 {
280 supset.push_back(j);
281 }
282 }
283 return (supset);
284}

◆ support2()

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

Definition at line 304 of file cohomo.cc.

305{
306 int j;
307 poly q;
308 std::vector<int> supset;
309 for(j=1;j<=rVar(currRing);j++)
310 {
311 q=pCopy(p);
312 while (q!=NULL)
313 {
314 if(p_GetExp(q,j,currRing)!=0)
315 {
316 supset.push_back(j);
317 break;
318 }
319 q=pNext(q);
320 }
321 }
322 return (supset);
323}

◆ supports()

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

Definition at line 287 of file cohomo.cc.

288{
289 std::vector<std::vector<int> > vecs;
290 std::vector<int> vec;
291 if(!idIs0(h))
292 {
293 for(int s=0;s<IDELEMS(h);s++)
294 {
295 vec=support1(h->m[s]);
296 vecs.push_back(vec);
297 }
298 }
299 return vecs;
300}
const CanonicalForm int s
Definition facAbsFact.cc:51

◆ supports2()

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

Definition at line 326 of file cohomo.cc.

327{
328 std::vector<std::vector<int> > vecs;
329 std::vector<int> vec;
330 if(!idIs0(h))
331 {
332 for(int s=0;s<IDELEMS(h);s++)
333 {
334 vec=support2(h->m[s]);
335 vecs.push_back(vec);
336 }
337 }
338 return vecs;
339}

◆ T1()

static void T1 ( ideal  h)
static

Definition at line 2379 of file cohomo.cc.

2380{
2381 ideal bi=findb(h),ai;
2382 int mm=0;
2383 id_print(bi);
2384 poly a,b;
2385 std::vector<std::vector<int> > solve;
2386 for(int i=0;i<IDELEMS(bi);i++)
2387 {
2388 //PrintS("This is aset according to:");
2389 b=pCopy(bi->m[i]);
2390 pWrite(b);
2391 ai=finda(h,b,0);
2392 if(!idIs0(ai))
2393 {
2394 id_print(ai);
2395 for(int j=0;j<IDELEMS(ai);j++)
2396 {
2397 //PrintS("This is a:");
2398 a=pCopy(ai->m[j]);
2399 //pWrite(a);
2400 intvec * solve=gradedpiece1n(h, a, b);
2401 if (IMATELEM(*solve,1,1)!=10)
2402 mm++;
2403 }
2404 }
2405 }
2406 Print("Finished %d!\n",mm);
2407}
static void id_print(ideal h)
Definition cohomo.cc:84
#define IMATELEM(M, I, J)
Definition intvec.h:85

◆ t1h()

static BOOLEAN t1h ( leftv  res,
leftv  args 
)
static

Definition at line 3624 of file cohomo.cc.

3625{
3626 leftv h=args;
3627 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
3628 {
3629 ideal hh=(ideal)h->Data();
3630 res->rtyp =IDEAL_CMD;
3631 res->data =T_1h(hh);
3632 }
3633 return false;
3634}
static ideal T_1h(ideal h)
Definition cohomo.cc:3548

◆ T2()

static void T2 ( ideal  h)
static

Definition at line 2606 of file cohomo.cc.

2607{
2608 ideal bi=findb(h),ai;
2609 id_print(bi);
2610 poly a,b;
2611 int mm=0,gp=0;
2612 std::vector<int> bv,av;
2613 std::vector<std::vector<int> > solve;
2614 for(int i=0;i<IDELEMS(bi);i++)
2615 {
2616 b=pCopy(bi->m[i]);
2617 //bv=support1(b);
2618 //PrintS("This is aset according to:");
2619 pWrite(b);
2620//if(bv.size()==2)
2621 //{
2622 ai=finda(h,b,0);
2623 if(!idIs0(ai))
2624 {
2625 PrintS("This is a set according to current b:\n");
2626 id_print(ai);
2627 for(int j=0;j<IDELEMS(ai);j++)
2628 {
2629 PrintS("This is a:");
2630 a=pCopy(ai->m[j]);
2631 pWrite(a);
2632 PrintS("This is b:");
2633 pWrite(b);
2635 delete solve;
2636 gp++;
2637 }
2638 }
2639 mm=mm+1;
2640 }
2641 if(mm==IDELEMS(bi))
2642 PrintS("Finished!\n");
2643 Print("There are %d graded pieces in total.\n",gp);
2644}
CanonicalForm gp
Definition cfModGcd.cc:4102

◆ T_1h()

static ideal T_1h ( ideal  h)
static

Definition at line 3548 of file cohomo.cc.

3549{
3550 int i, j;
3551 //std::vector < intvec > T1;
3552 ideal ai=p_a(h), bi;
3553 //intvec *L;
3554 for(i=0;i<IDELEMS(ai);i++)
3555 {
3556 bi=p_b(h,ai->m[i]);
3557 if(!idIs0(bi))
3558 {
3559 for(j=0;j<IDELEMS(bi);j++)
3560 {
3561 //PrintS("This is for:\n");pWrite(ai->m[i]); pWrite(bi->m[j]);
3562 gradedpiece1nl(h,ai->m[i],bi->m[j], 0);
3563 //PrintS("Succeed!\n");
3564 //T1.push_back(L);
3565 }
3566 }
3567 }
3569 return h;
3570}
static void TimeShow(clock_t t_construct, clock_t t_solve, clock_t t_value, clock_t t_total)
Definition cohomo.cc:2694

◆ tetraface()

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

Definition at line 3071 of file cohomo.cc.

3072{
3073 std::vector<int> ev=commonedge(p, q), vec, fv1=support1(p), fv2=support1(q);
3074 std::vector<std::vector<int> > fvs1, fvs2, fvs;
3075 vec.push_back(vert);
3076 fvs.push_back(vec);
3082 fvs2=vsMinusv(fvs2, ev);
3083 for(unsigned i=0;i<fvs2.size();i++)
3084 {
3085 vec=fvs2[i];
3086 vec.push_back(vert);
3087 fvs.push_back(vec);
3088 }
3089 return (fvs);
3090}

◆ TimeShow()

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

Definition at line 2694 of file cohomo.cc.

2695{
2696 Print("The time of value matching for first order deformation: %.2f sec ;\n", ((double) t_value)/CLOCKS_PER_SEC);
2697 Print("The total time of fpiece: %.2f sec ;\n", ((double) t_total)/CLOCKS_PER_SEC);
2698 Print("The time of equations construction for fpiece: %.2f sec ;\n", ((double) t_construct)/CLOCKS_PER_SEC);
2699 Print("The total time of equations solving for fpiece: %.2f sec ;\n", ((double) t_solve)/CLOCKS_PER_SEC);
2700 PrintS("__________________________________________________________\n");
2701}

◆ Tmat()

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

Definition at line 2232 of file cohomo.cc.

2233{
2234 //std::vector<std::vector<int> > solve=gradedpiece1n(h,a,b);
2235 //Print("the size of solve is: %ld\n",solve.size());
2236 //vtm(solve);
2237 intvec *m;
2238 int i,j, a=vecs.size();
2239 if(a==0)
2240 {
2241 m=new intvec(1,1,10);
2242 }
2243 else
2244 {
2245 int b=vecs[0].size();
2246 m=new intvec(a,b,0);
2247 for(i=1;i<=a;i++)
2248 {
2249 for(j=1;j<=b;j++)
2250 {
2251 IMATELEM(*m,i,j)=vecs[i-1][j-1];
2252 }
2253 }
2254 }
2255 return (m);
2256}

◆ tNab()

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

Definition at line 2156 of file cohomo.cc.

2157{
2158 std::vector<int> sv;
2159 if(bvs.size()<=1) return false;
2160 for(unsigned i=0;i<bvs.size();i++)
2161 {
2162 sv=vecUnion(pv,bvs[i]);
2163 if(!vInvsl(sv,hvs))
2164 {
2165 return true;
2166 }
2167 }
2168 return false;
2169}

◆ tnab()

static 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 2171 of file cohomo.cc.

2172{
2173 std::vector<int> pv, vec;
2174 for(unsigned j=0;j<nvs.size();j++)
2175 {
2176 pv=nvs[j];
2177 if(tNab(hvs, pv, bvs))
2178 {
2179 vec.push_back(j);
2180 }
2181 }
2182 return vec;
2183}

◆ tnabvl()

static BOOLEAN tnabvl ( leftv  res,
leftv  args 
)
static

Definition at line 4105 of file cohomo.cc.

4106{
4107 leftv h=args;
4108 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4109 {
4110 ideal h1= (ideal)h->Data();
4111 h = h->next;
4112 if((h != NULL)&&(h->Typ() == POLY_CMD))
4113 {
4114 poly p= (poly)h->Data();
4115 h = h->next;
4116 if((h != NULL)&&(h->Typ() == POLY_CMD))
4117 {
4118 poly q= (poly)h->Data();
4119 res->rtyp =IDEAL_CMD;
4120 std::vector<std::vector<int> > vecs=supports(h1), sbv,tnbr;
4121 std::vector<int> pv=support1(p), qv=support1(q);
4122 std::vector<std::vector<int> > nvs=Nabv(vecs, pv, qv);
4123 ideal sub=psubset(q);
4124 sbv=supports(sub);
4125 std::vector<int> tnv =tnab(vecs,nvs,sbv);
4126 for(unsigned i=0;i<tnv.size();i++)
4127 {
4128 tnbr.push_back(nvs[tnv[i]]);
4129 }
4130 res->data =idMaken(tnbr);
4131 }
4132 }
4133 }
4134 return false;
4135}

◆ triangulations1()

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

Definition at line 3003 of file cohomo.cc.

3004{
3005 std::vector<int> vec, pv=support1(p);
3006 std::vector<std::vector<int> > vecs=supports(h),vs,vs0;
3007 vs0=triface(p,vert);
3008 vecs=vsMinusv(vecs, pv);
3010 //PrintS("This is the new simplicial complex according to the face \n"); pWrite(p);
3011 //PrintS("is:\n");
3012 //listsprint(vecs);
3014 return re;
3015}

◆ triangulations2()

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

Definition at line 3093 of file cohomo.cc.

3094{
3095 std::vector<int> ev, fv1=support1(p), fv2=support1(q);
3096 std::vector<std::vector<int> > vecs=supports(h), vs1;
3097 ev=commonedge(p, q);
3098 vecs=vsMinusv(vecs, ev);
3101 vs1=tetraface(p, q, vert);
3104 return hh;
3105}

◆ triangulations3()

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

Definition at line 3152 of file cohomo.cc.

3153{
3154 std::vector<int> ev1=commonedge(p, q), ev2=commonedge(p, g), ev3=commonedge(q, g), fv1=support1(p), fv2=support1(q), fv3=support1(g);
3155 std::vector<std::vector<int> > vecs=supports(h), vs1, evec;
3156 evec.push_back(ev1);
3157 evec.push_back(ev2);
3158 evec.push_back(ev3);
3159 for(unsigned i=0;i<evec.size();i++)
3160 {
3161 if(evec[i].size()==2)
3162 {
3163 vecs=vsMinusv(vecs, evec[i]);
3164 }
3165 }
3169 vs1=penface(p, q, g, vert);
3172 return hh;
3173}

◆ triface()

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

Definition at line 2984 of file cohomo.cc.

2985{
2986 std::vector<int> vec, fv=support1(p);
2987 std::vector<std::vector<int> > fvs0, fvs;
2988 vec.push_back(vert);
2989 fvs.push_back(vec);
2990 fvs0=b_subsets(fv);
2992 for(unsigned i=0;i<fvs0.size();i++)
2993 {
2994 vec=fvs0[i];
2995 vec.push_back(vert);
2996 fvs.push_back(vec);
2997 }
2998 return (fvs);
2999}

◆ trisets()

static ideal trisets ( ideal  h)
static

Definition at line 2968 of file cohomo.cc.

2969{
2970 int i;
2971 ideal ids=idInit(1,1);
2972 std::vector<int> pv;
2973 for(i=0;i<IDELEMS(h);i++)
2974 {
2975 pv= support1(h->m[i]);
2976 if(pv.size()==3)
2977 idInsertPoly(ids, pCopy(h->m[i]));
2978 }
2980 return ids;
2981}

◆ tsets()

static BOOLEAN tsets ( leftv  res,
leftv  args 
)
static

Definition at line 4052 of file cohomo.cc.

4053{
4054 leftv h=args;
4055 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4056 {
4057 ideal h1= (ideal)h->Data();
4058 res->rtyp =IDEAL_CMD;
4059 res->data =trisets(h1);
4060 }
4061 return false;
4062}
static ideal trisets(ideal h)
Definition cohomo.cc:2968

◆ v_minus()

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

Definition at line 3445 of file cohomo.cc.

3446{
3447 std::vector<int> vec;
3448 for(unsigned i=0;i<v1.size();i++)
3449 {
3450 vec.push_back(v1[i]-v2[i]);
3451 }
3452 return vec;
3453}

◆ vAbsorb()

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

Definition at line 1125 of file cohomo.cc.

1126{
1127 std::vector<int> badset=bset;
1128 int i,j,m, bl=bset.size(), gl=gset.size();
1129 for(i=0;i<bl;i++)
1130 {
1131 m=badset[i];
1132 for(j=0;j<gl;j++)
1133 {
1134 if(gset[j][0]==m && !IsinL(gset[j][1],badset))
1135 {
1136 badset.push_back(gset[j][1]);
1137 gset.erase(gset.begin()+j);
1138 j--;
1139 gl--;
1140 bl++;
1141 }
1142 else if(!IsinL(gset[j][0],badset) && gset[j][1]==m)
1143 {
1144 badset.push_back(gset[j][0]);
1145 gset.erase(gset.begin()+j);
1146 j--;
1147 gl--;
1148 bl++;
1149 }
1150 else if(IsinL(gset[j][0],badset) && IsinL(gset[j][1],badset))
1151 {
1152 gset.erase(gset.begin()+j);
1153 j--;
1154 gl--;
1155 }
1156 else
1157 {
1158 ;
1159 }
1160 }
1161 }
1162 if(badset.size()==0) badset.push_back(0);
1163 gset.push_back(badset);
1164 return gset;
1165}

◆ valency()

static int valency ( ideal  h,
poly  p 
)
static

Definition at line 3177 of file cohomo.cc.

3178{
3179 int val=0;
3180 std::vector<int> ev=support1(pCopy(p));
3181 int ver=ev[0];
3182//PrintS("the vertex is :\n"); listprint(p);
3183 std::vector<std::vector<int> > vecs=supports(idCopy(h));
3184 for(unsigned i=0;i<vecs.size();i++)
3185 {
3186 if(vecs[i].size()==2 && IsinL(ver, vecs[i]))
3187 val++;
3188 }
3189 return (val);
3190}

◆ Valency()

static BOOLEAN Valency ( leftv  res,
leftv  args 
)
static

Definition at line 4064 of file cohomo.cc.

4065{
4066 leftv h=args;
4067 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4068 {
4069 ideal h1= (ideal)h->Data();
4070 h = h->next;
4071 if((h != NULL)&&(h->Typ() == POLY_CMD))
4072 {
4073 poly p= (poly)h->Data();
4074 res->rtyp =INT_CMD;
4075 res->data =(void *)(long)valency(h1,p);
4076 }
4077 }
4078 return false;
4079}
static int valency(ideal h, poly p)
Definition cohomo.cc:3177

◆ 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 
)
static

Definition at line 2195 of file cohomo.cc.

2196{
2197 int j;
2198 std::vector<int> pv, base;
2199 std::vector<std::vector<int> > bases;
2200 for(unsigned t=0;t<vecs.size();t++)
2201 {
2202 for(unsigned i=0;i<mvs.size();i++)
2203 {
2204 pv=phimage(mvs[i],av,bv);
2205 for( j=0;j<nvs.size();j++)
2206 {
2207 if(vEvl(pv,nvs[j]))
2208 {
2209 base.push_back(vecs[t][j]);
2210 break;
2211 }
2212 }
2213 if(j==nvs.size())
2214 {
2215 base.push_back(0);
2216 }
2217 }
2218 if(base.size()!=mvs.size())
2219 {
2220 //WerrorS("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1");
2221 WerrorS("Errors in Equations solving (Values Finding)!");
2222 usleep(1000000);
2223 assert(false);
2224
2225 }
2226 bases.push_back(base);
2227 base.clear();
2228 }
2229 return bases;
2230}
static std::vector< int > phimage(std::vector< int > pv, std::vector< int > av, std::vector< int > bv)
Definition cohomo.cc:2186
unsigned size() const

◆ 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 
)
static

Definition at line 2658 of file cohomo.cc.

2659{
2660 int j;
2661 std::vector<int> pv;
2662 std::vector<int> base;
2663 std::vector<std::vector<int> > bases;
2664 for(unsigned t=0;t<vecs.size();t++)
2665 {
2666 for(unsigned i=0;i<mvs.size();i++)
2667 {
2668 pv=phimagel(mvs[i], av, bv);
2669 for(j=0;j<lks.size();j++)
2670 {
2671 if(vEvl(pv,lks[j]))
2672 {
2673 base.push_back(vecs[t][j]);break;
2674 }
2675 }
2676 //if(j==lks.size()) {base.push_back(0);}
2677 }
2678 if(base.size()!=mvs.size())
2679 {
2680 WerrorS("Errors in Values Finding(value1l)!");
2681 usleep(1000000);
2682 assert(false);
2683 }
2684 bases.push_back(base);
2685 base.clear();
2686 }
2687 return bases;
2688}

◆ 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 
)
static

Definition at line 2458 of file cohomo.cc.

2459{
2460 int row,col,j;
2461 std::vector<int> pv,qv, base;
2462 std::vector<std::vector<int> > bases;
2463 //PrintS("This is the nabt:\n");
2464 //listsprint(nts);
2465 //PrintS("nabt ends:\n");
2466 //PrintS("This is the mabt:\n");
2467 //listsprint(mts);
2468 //PrintS("mabt ends:\n");
2469 for(unsigned t=0;t<vecs.size();t++)
2470 {
2471 for(unsigned i=0;i<mts.size();i++)
2472 {
2473 row=mts[i][0];
2474 col=mts[i][1];
2475 pv=phimage(mvs[row],av,bv);
2476 qv=phimage(mvs[col],av,bv);
2477 if(vEvl(pv,qv))
2478 base.push_back(0);
2479 else
2480 {
2481 for(j=0;j<nts.size();j++)
2482 {
2483 row=nts[j][0];
2484 col=nts[j][1];
2485 if(vEvl(pv,nvs[row])&&vEvl(qv,nvs[col]))
2486 {
2487 base.push_back(vecs[t][j]);break;
2488 }
2489 else if(vEvl(pv,nvs[col])&&vEvl(qv,nvs[row]))
2490 {
2491 base.push_back(-vecs[t][j]);break;
2492 }
2493 }
2494 if(j==nts.size()) {base.push_back(0);}
2495 }
2496 }
2497 if(base.size()!=mts.size())
2498 {
2499 WerrorS("Errors in Values Finding(value2)!");
2500 //WerrorS("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1");
2501 usleep(1000000);
2502 assert(false);
2503 }
2504 bases.push_back(base);
2505 base.clear();
2506 }
2507 return bases;
2508}

◆ 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 
)
static

Definition at line 2791 of file cohomo.cc.

2792{
2793 std::vector<int> pv,qv,base;
2794 int row,col,j;
2795 std::vector<std::vector<int> > bases;
2796 if(vecs.size()==0)
2797 {
2798
2799 }
2800 for(unsigned t=0;t<vecs.size();t++)
2801 {
2802 for(unsigned i=0;i<mts.size();i++)
2803 {
2804 row=mts[i][0];
2805 col=mts[i][1];
2806 pv=phimagel(mvs[row],av,bv);
2807 qv=phimagel(mvs[col],av,bv);
2808 if(vEvl(pv,qv))
2809 base.push_back(0);
2810 else
2811 {
2812 for(j=0;j<lkts.size();j++)
2813 {
2814 row=lkts[j][0];
2815 col=lkts[j][1];
2816 if(vEvl(pv,lks[row])&&vEvl(qv,lks[col]))
2817 {
2818 base.push_back(vecs[t][j]);break;
2819 }
2820 else if(vEvl(qv,lks[row])&&vEvl(pv,lks[col]))
2821 {
2822 base.push_back(-vecs[t][j]);break;
2823 }
2824 }
2825 //if(j==lkts.size())
2826 //{
2827 //base.push_back(0);
2828 //}
2829 }
2830 }
2831 if(base.size()!=mts.size())
2832 {
2833 WerrorS("Errors in Values Finding!");
2834 //WerrorS("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1");
2835 usleep(1000000);
2836 assert(false);
2837 }
2838 bases.push_back(base);
2839 base.clear();
2840 }
2841 return bases;
2842}

◆ vecbase1()

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

Definition at line 1169 of file cohomo.cc.

1170{
1171 int i;
1172 std::vector<int> base;
1173 for(i=0;i<num;i++)
1174 {
1175 if(IsinL(i+1,oset))
1176 base.push_back(1);
1177 else
1178 base.push_back(0);
1179 }
1180 return base;
1181}

◆ vecIntersection()

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

Definition at line 147 of file cohomo.cc.

148{
149 unsigned i;
150 std::vector<int> inte;
151 for(i=0;i<p.size();i++)
152 {
153 if(IsinL(p[i],q))
154 inte.push_back(p[i]);
155 }
156 return inte;
157}

◆ vecMinus()

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

Definition at line 212 of file cohomo.cc.

213{
214 std::vector<int> vec;
215 for(unsigned i=0;i<vec1.size();i++)
216 {
217 if(!IsinL(vec1[i],vec2))
218 {
219 vec.push_back(vec1[i]);
220 }
221 }
222 return vec;
223}

◆ vecqring()

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

Definition at line 454 of file cohomo.cc.

455{
458 std::vector<std::vector<int> > vecs= vsMake(h);
459 return vecs;
460}
static ideal idMake(std::vector< std::vector< int > > vecs)
Definition cohomo.cc:358
static std::vector< std::vector< int > > vsMake(ideal h)
Definition cohomo.cc:439

◆ vecUnion()

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

Definition at line 200 of file cohomo.cc.

201{
202 std::vector<int> vec=vec1;
203 unsigned i;
204 for(i=0;i<vec2.size();i++)
205 {
206 if(!IsinL(vec2[i],vec))
207 vec.push_back(vec2[i]);
208 }
209 return vec;
210}

◆ vertset()

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

Definition at line 1404 of file cohomo.cc.

1405{
1406 int i,j;
1407 std::vector<int> vert;
1408 std::vector<std::vector<int> > vvs;
1409 for(i=1;i<=currRing->N;i++)
1410 {
1411 for(j=0;j<vecs.size();j++)
1412 {
1413 if(IsinL(i, vecs[j]))
1414 {
1415 if(!IsinL(i , vert))
1416 {
1417 vert.push_back(i);
1418 }
1419 break;
1420 }
1421 }
1422 }
1423 return (vert);
1424}

◆ vEvl()

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

Definition at line 174 of file cohomo.cc.

175{
176 if(vec1.size()==0 && vec2.size()==0)
177 return true;
179 return true;
180 return false;
181}

◆ vInp()

static bool vInp ( int  m,
poly  p 
)
static

Definition at line 405 of file cohomo.cc.

406{
407 poly q=pCopy(p);
408 while (q!=NULL)
409 {
410 if(p_GetExp(q,m,currRing)!=0)
411 {
412 return true;
413 }
414 q=pNext(q);
415 }
416 return false;
417}

◆ vInvsl()

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

Definition at line 186 of file cohomo.cc.

187{
188 int i;
189 for(i=0;i<vecs.size();i++)
190 {
191 if(vEvl(vec,vecs[i]))
192 {
193 return true;
194 }
195 }
196 return false;
197}

◆ vMake()

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

Definition at line 420 of file cohomo.cc.

421{
422 int i;
423 std::vector<int> vbase;
424 for(i=1;i<=currRing->N;i++)
425 {
426 if(vInp(i,p))
427 {
428 vbase.push_back(pcoef(p,i));
429 }
430 else
431 {
432 vbase.push_back(0);
433 }
434 }
435 return (vbase);
436}
static int pcoef(poly p, int m)
Definition cohomo.cc:386

◆ vs_subsets()

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

Definition at line 3235 of file cohomo.cc.

3236{
3237 std::vector<std::vector<int> > sset, bv;
3238 for(unsigned i=0;i<vs.size();i++)
3239 {
3240 bv=b_subsets(vs[i]);
3241 sset=vsUnion(sset, bv);
3242 }
3243 return sset;
3244}

◆ vsIntersec()

static BOOLEAN vsIntersec ( leftv  res,
leftv  args 
)
static

Definition at line 4137 of file cohomo.cc.

4138{
4139 leftv h=args;
4140 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4141 {
4142 ideal h1= (ideal)h->Data();
4143 h = h->next;
4144 if((h != NULL)&&(h->Typ() == IDEAL_CMD))
4145 {
4146 ideal h2= (ideal)h->Data();
4147 res->rtyp =INT_CMD;
4148 std::vector<std::vector<int> > vs1=supports(h1), vs2=supports(h2);
4149 res->data =(void *)(long)(vsIntersection(vs1, vs2).size());
4150 }
4151 }
4152 return false;
4153}
static std::vector< std::vector< int > > vsIntersection(std::vector< std::vector< int > > vs1, std::vector< std::vector< int > > vs2)
Definition cohomo.cc:253

◆ vsIntersection()

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

Definition at line 253 of file cohomo.cc.

254{
255 int i;
256 std::vector<std::vector<int> > vs;
257 for(i=0;i<vs2.size();i++)
258 {
259 if(vInvsl(vs2[i],vs1))
260 {
261 vs.push_back(vs2[i]);
262 }
263 }
264 return vs;
265}

◆ vsMake()

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

Definition at line 439 of file cohomo.cc.

440{
441 std::vector<int> vec;
442 std::vector<std::vector<int> > vecs;
443 int i;
444 for(i=0;i<IDELEMS(h);i++)
445 {
446 vec=vMake(h->m[i]);
447 vecs.push_back(vec);
448 }
449 return vecs;
450}
static std::vector< int > vMake(poly p)
Definition cohomo.cc:420

◆ vsMinusv()

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

226{
227 int i;
228 std::vector<std::vector<int> > rem;
229 for(i=0;i<vecs.size();i++)
230 {
231 if(!vEvl(vecs[i],vec))
232 {
233 rem.push_back(vecs[i]);
234 }
235 }
236 return (rem);
237}
void rem(unsigned long *a, unsigned long *q, unsigned long p, int &dega, int degq)
Definition minpoly.cc:572

◆ vsMinusvs()

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

Definition at line 3225 of file cohomo.cc.

3226{
3227 std::vector<std::vector<int> > vs=vs1;
3228 for(unsigned i=0;i<vs2.size();i++)
3229 {
3230 vs=vsMinusv(vs, vs2[i]);
3231 }
3232 return vs;
3233}

◆ vsubset()

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

Definition at line 160 of file cohomo.cc.

161{
162 int i;
163 if(vec1.size()>vec2.size())
164 return false;
165 for(i=0;i<vec1.size();i++)
166 {
167 if(!IsinL(vec1[i],vec2))
168 return false;
169 }
170 return true;
171}

◆ vsUnion()

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

Definition at line 239 of file cohomo.cc.

240{
241 int i;
242 std::vector<std::vector<int> > vs=vs1;
243 for(i=0;i<vs2.size();i++)
244 {
245 if(!vInvsl(vs2[i],vs))
246 {
247 vs.push_back(vs2[i]);
248 }
249 }
250 return vs;
251}

Variable Documentation

◆ t_begin

VAR clock_t t_begin

Definition at line 2691 of file cohomo.cc.

◆ t_construct

VAR clock_t t_construct =0

Definition at line 2691 of file cohomo.cc.

◆ t_mark

VAR clock_t t_mark

Definition at line 2691 of file cohomo.cc.

◆ t_solve

VAR clock_t t_solve =0

Definition at line 2691 of file cohomo.cc.

◆ t_start

VAR clock_t t_start

Definition at line 2691 of file cohomo.cc.

◆ t_total

VAR clock_t t_total =0

Definition at line 2691 of file cohomo.cc.

◆ t_value

VAR clock_t t_value =0

Definition at line 2691 of file cohomo.cc.