# Changeset 0f987ab in git

Ignore:
Timestamp:
May 8, 2018, 3:03:58 PM (6 years ago)
Branches:
(u'spielwiese', 'ec94ef7a30b928574c0c3daf41f6804dff5f6b69')
Children:
0dc748aa220932595ba06044cb85807f30b3c2fe
Parents:
458174a01ed388fe1f5bcb6624bc7f13f0223860e734084ec7bec9299f110c52697b1fd638b90bec
Message:
Merge branch 'spielwiese' into stable
Files:
32 edited

Unmodified
Removed
• ## Singular/LIB/fpaprops.lib

 re734084 PROCEDURES: lpNoetherian();     check whether A/ is (left/right) noetherian lpNoetherian();     check whether A/ is (left/right) Noetherian lpIsSemiPrime();    check whether A/ is semi prime lpIsPrime();        check whether A/ is prime "USAGE: lpNoetherian(G); G an ideal in a Letterplace ring RETURN: int @*      0 not noetherian @*      1 left noetherian @*      2 right noetherian @*      3 noetherian PURPOSE: Check whether A/ is (left/right) noetherian @*      0 not Noetherian @*      1 left Noetherian @*      2 right Noetherian @*      3 Noetherian @*      4 weak Noetherian PURPOSE: Check whether the monomial algebra A/ is (left/right) noetherian ASSUME: - basering is a Letterplace ring @*      - G is a Groebner basis THEORY: lpNoetherian works with the monomial algebra A/. If it gives an affirmative answer for one of the properties, then it holds for both A/ and A/. However, a negative answer applies only to A/ and not necessarily to A/. NOTE: Weak Noetherian means that two-sided ideals in A/ satisfy the acc (ascending chain condition). " { intvec visited; visited[ncols(UG)] = 0; int inFlag, outFlag; int inFlag, outFlag, inOutFlag; for (int v = 1; v <= ncols(UG) && (inFlag + outFlag) != 3; v++) { int inOutFlags = inOrOutCommingEdgeInCycle(UG, v, visited, 0); int inOutFlags = inOutCommingEdgesInCycles(UG, v, visited, 0); if (inOutFlags == 1) { inFlag = 1; } if (inOutFlags == 2) { outFlag = 2; outFlag = 1; } if (inOutFlags == 3) { inFlag = 1; outFlag = 2; outFlag = 1; } if (inOutFlags == 4) { inOutFlag = 1; } if (inOutFlags == 5) { inFlag = 1; inOutFlag = 1; } if (inOutFlags == 6) { outFlag = 1; inOutFlag = 1; } if (inOutFlags == 7) { inFlag = 1; outFlag = 1; inOutFlag = 1; } kill inOutFlags; } kill v; return (3 - inFlag - outFlag); int noetherian = 3 - 1*inFlag - 2*outFlag; if (noetherian == 0) { return (4 - 4*inOutFlag); // weak noetherian } return (noetherian); } example } static proc inOrOutCommingEdgeInCycle(intmat G, int v, intvec visited, intvec path) { static proc inOutCommingEdgesInCycles(intmat G, int v, intvec visited, intvec path) { // Mark the current vertex as visited visited[v] = 1; } int inFlag, outFlag; int inFlag, outFlag, inOutFlag; for (int w = 1; w <= ncols(G) && (inFlag + outFlag) != 3; w++) { if (G[v,w] == 1) { if (visited[w] == 1) { // new cycle if (v == w) { if (visited[w] == 1) { // new cycle int tmpInFlag; int tmpOutFlag; if (v == w) { // cycle is a loop for (int u = 1; u <= ncols(G); u++) { if (G[v,u] && u != v) { outFlag = 2; outFlag = 1; tmpOutFlag = 1; } if (G[u,v] && u != v) { inFlag = 1; tmpInFlag = 1; } } kill u; if (path[i] != v) { if (u != path[i+1]) { // and u is not the next element in the cycle outFlag = 2; outFlag = 1; tmpOutFlag = 1; } } else { if (u != w) { outFlag = 2; outFlag = 1; tmpOutFlag = 1; } } if (u != path[i-1]) { // and u is not the previous element in the cylce inFlag = 1; tmpInFlag = 1; } } else { if (u != v) { inFlag = 1; tmpInFlag = 1; } } } kill i; } if (tmpInFlag > 0 && tmpOutFlag > 0) { // there are both in and outcomming edges in this cycle inOutFlag = 1; } kill tmpInFlag; kill tmpOutFlag; } else { int inOutFlags = inOrOutCommingEdgeInCycle(G, w, visited, path); int inOutFlags = inOutCommingEdgesInCycles(G, w, visited, path); if (inOutFlags == 1) { inFlag = 1; } if (inOutFlags == 2) { outFlag = 2; outFlag = 1; } if (inOutFlags == 3) { inFlag = 1; outFlag = 2; outFlag = 1; } if (inOutFlags == 4) { inOutFlag = 1; } if (inOutFlags == 5) { inFlag = 1; inOutFlag = 1; } if (inOutFlags == 6) { outFlag = 1; inOutFlag = 1; } if (inOutFlags == 7) { inFlag = 1; outFlag = 1; inOutFlag = 1; } kill inOutFlags; } kill w; return (inFlag + outFlag); return (1*inFlag + 2*outFlag + 4*inOutFlag); } ASSUME: - basering is a Letterplace ring - G is a Groebner basis THEORY: lpIsSemiPrime works with the monomial algebra A/. A positive answer holds for both A/ and A/, while a negative answer applies only to A/ and not necessarily to A/. " { ASSUME: - basering is a Letterplace ring - G is a Groebner basis THEORY: lpIsPrime works with the monomial algebra A/. A positive answer holds for both A/ and A/, while a negative answer applies only to A/ and not necessarily to A/. " {
• ## Singular/LIB/freegb.lib

 r458174a if (N >1) { for(i=1; i<=N; i++) for(i=1; i<=N-1; i++) { q = lieBracket(a,q); setring RS; fsRel; } /* intmat A[2][2] = 2, -1, -3, 2; // G_2 Cartan matrix */ static proc varIdeal2intvec(ideal I)
• ## Singular/dyn_modules/cohomo/cohomo.cc

 r458174a extern "C" int SI_MOD_INIT(stanleyreisnerlib)(SModulFunctions* p) extern "C" int SI_MOD_INIT(cohomo)(SModulFunctions* p) { firstorderdef_setup(p);
• ## Singular/dyn_modules/syzextra/mod_main.cc

 r458174a #include "Singular/mod_lib.h" #if GOOGLE_PROFILE_ENABLED #include #endif // #if GOOGLE_PROFILE_ENABLED } // proc SchreyerSyzygyNF(vector syz_lead, vector syz_2, def L, def T, list #) static BOOLEAN _SchreyerSyzygyNF(leftv res, leftv h) { const SchreyerSyzygyComputationFlags attributes(currRingHdl); //   const BOOLEAN OPT__SYZCHECK   = attributes.OPT__SYZCHECK; //   const BOOLEAN OPT__LEAD2SYZ   = attributes.OPT__LEAD2SYZ; const BOOLEAN OPT__HYBRIDNF   = attributes.OPT__HYBRIDNF; const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ; const char* usage = "SchreyerSyzygyNF(, , , [,]) expected"; const ring r = attributes.m_rBaseRing; NoReturn(res); assume( OPT__HYBRIDNF ); // ??? if ((h==NULL) || (h->Typ() != VECTOR_CMD) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } const poly syz_lead = (poly) h->Data(); assume (syz_lead != NULL); h = h->Next(); if ((h==NULL) || (h->Typ() != VECTOR_CMD) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } const poly syz_2 = (poly) h->Data(); assume (syz_2 != NULL); h = h->Next(); if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } const ideal L = (ideal) h->Data(); assume( IDELEMS(L) > 0 ); h = h->Next(); if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } const ideal T = (ideal) h->Data(); assume( IDELEMS(L) == IDELEMS(T) ); ideal LS = NULL; h = h->Next(); if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL)) { LS = (ideal)h->Data(); h = h->Next(); } #ifndef SING_NDEBUG if( LIKELY( OPT__TAILREDSYZ) ) assume (LS != NULL); #endif assume( h == NULL ); res->rtyp = VECTOR_CMD; res->data = SchreyerSyzygyNF(syz_lead, (syz_2!=NULL)? p_Copy(syz_2, r): syz_2, L, T, LS, attributes); return FALSE; } /// proc SSReduceTerm(poly m, def t, def syzterm, def L, def T, list #) static BOOLEAN _ReduceTerm(leftv res, leftv h) { const SchreyerSyzygyComputationFlags attributes(currRingHdl); //  const BOOLEAN OPT__SYZCHECK   = attributes.OPT__SYZCHECK; //   const BOOLEAN OPT__LEAD2SYZ   = attributes.OPT__LEAD2SYZ; //   const BOOLEAN OPT__HYBRIDNF   = attributes.OPT__HYBRIDNF; const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ; const char* usage = "ReduceTerm(, , , , [,]) expected"; const ring r = attributes.m_rBaseRing; NoReturn(res); if ((h==NULL) || (h->Typ() !=POLY_CMD) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } const poly multiplier = (poly) h->Data(); assume (multiplier != NULL); h = h->Next(); if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } const poly term4reduction = (poly) h->Data(); assume( term4reduction != NULL ); poly syztermCheck = NULL; h = h->Next(); if ((h==NULL) || !((h->Typ()==VECTOR_CMD) || (h->Data() == NULL)) ) { WerrorS(usage); return TRUE; } if(h->Typ()==VECTOR_CMD) syztermCheck = (poly) h->Data(); h = h->Next(); if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } const ideal L = (ideal) h->Data(); assume( IDELEMS(L) > 0 ); h = h->Next(); if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } const ideal T = (ideal) h->Data(); assume( IDELEMS(L) == IDELEMS(T) ); ideal LS = NULL; h = h->Next(); if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL)) { LS = (ideal)h->Data(); h = h->Next(); } #ifndef SING_NDEBUG if( LIKELY( OPT__TAILREDSYZ) ) assume (LS != NULL); #endif assume( h == NULL ); res->rtyp = VECTOR_CMD; res->data = ReduceTerm(multiplier, term4reduction, syztermCheck, L, T, LS, attributes); return FALSE; } // proc SSTraverseTail(poly m, def @tail, def L, def T, list #) static BOOLEAN _TraverseTail(leftv res, leftv h) { const SchreyerSyzygyComputationFlags attributes(currRingHdl); //   const BOOLEAN OPT__SYZCHECK   = attributes.OPT__SYZCHECK; //   const BOOLEAN OPT__LEAD2SYZ   = attributes.OPT__LEAD2SYZ; //   const BOOLEAN OPT__HYBRIDNF   = attributes.OPT__HYBRIDNF; const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ; const char* usage = "TraverseTail(, , , [,]) expected"; const ring r = attributes.m_rBaseRing; NoReturn(res); if ((h==NULL) || (h->Typ() !=POLY_CMD) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } const poly multiplier = (poly) h->Data(); assume (multiplier != NULL); h = h->Next(); if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD)) { WerrorS(usage); return TRUE; } const poly tail = (poly) h->Data(); h = h->Next(); if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } const ideal L = (ideal) h->Data(); assume( IDELEMS(L) > 0 ); h = h->Next(); if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } const ideal T = (ideal) h->Data(); assume( IDELEMS(L) == IDELEMS(T) ); h = h->Next(); ideal LS = NULL; if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL)) { LS = (ideal)h->Data(); h = h->Next(); } #ifndef SING_NDEBUG if( LIKELY( OPT__TAILREDSYZ) ) assume (LS != NULL); #endif assume( h == NULL ); res->rtyp = VECTOR_CMD; res->data = TraverseTail(multiplier, tail, L, T, LS, attributes); return FALSE; } static BOOLEAN _ComputeResolution(leftv res, leftv h) { const SchreyerSyzygyComputationFlags attributes(currRingHdl); const char* usage = "ComputeResolution(, , [,int]) expected"; const ring r = attributes.m_rBaseRing; NoReturn(res); // input if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } const int type = h->Typ(); ideal M = (ideal)(h->CopyD()); // copy for resolution...!??? int size = IDELEMS(M); assume( size >= 0 ); h = h->Next(); // lead if ((h==NULL) || (h->Typ()!=type) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } ideal L = (ideal)(h->CopyD()); // no copy! assume( IDELEMS(L) == size ); h = h->Next(); if ((h==NULL) || (h->Typ()!=type) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } ideal T = (ideal)(h->CopyD()); // no copy! assume( IDELEMS(T) == size ); h = h->Next(); // length..? long length = 0; if ((h!=NULL) && (h->Typ()==INT_CMD)) { length = (long)(h->Data()); h = h->Next(); } assume( h == NULL ); if( length <= 0 ) length = 1 + rVar(r); syStrategy _res=(syStrategy)omAlloc0(sizeof(ssyStrategy)); //  class ssyStrategy; typedef ssyStrategy * syStrategy; //  typedef ideal *            resolvente; _res->length = length + 1; // index + 1; _res->fullres = (resolvente)omAlloc0((_res->length+1)*sizeof(ideal)); int index = 0; _res->fullres[index++] = M; //  if (UNLIKELY(attributes.OPT__TREEOUTPUT)) //    Print("{ \"RESOLUTION: HYBRIDNF:%d, TAILREDSYZ: %d, LEAD2SYZ: %d, IGNORETAILS: %d\": [\n", attributes.OPT__HYBRIDNF, attributes.OPT__TAILREDSYZ, attributes.OPT__LEAD2SYZ, attributes.OPT__IGNORETAILS); while( (!idIs0(L)) && (index < length)) { attributes.nextSyzygyLayer(); ideal LL, TT; ComputeSyzygy(L, T, LL, TT, attributes); size = IDELEMS(LL); assume( size == IDELEMS(TT) ); id_Delete(&L, r); id_Delete(&T, r); L = LL; T = TT; // id_Add(T, L, r); M = idInit(size, 0); for( int i = size-1; i >= 0; i-- ) { M->m[i] = p_Add_q(p_Copy(T->m[i], r), p_Copy(L->m[i], r), r); // TODO: :((( } M->rank = id_RankFreeModule(M, r); _res->fullres[index++] = M; // ??? } //  if ( UNLIKELY(attributes.OPT__TREEOUTPUT) ) //    PrintS("] }\n"); id_Delete(&L, r); id_Delete(&T, r); res->data = _res; res->rtyp = RESOLUTION_CMD; //  omFreeSize(_res, sizeof(ssyStrategy)); return FALSE; } /// module (LL, TT) = SSComputeSyzygy(L, T); /// Compute Syz(L ++ T) = N = LL ++ TT // proc SSComputeSyzygy(def L, def T) static BOOLEAN _ComputeSyzygy(leftv res, leftv h) { const SchreyerSyzygyComputationFlags attributes(currRingHdl); //   const BOOLEAN OPT__SYZCHECK   = attributes.OPT__SYZCHECK; //   const BOOLEAN OPT__LEAD2SYZ   = attributes.OPT__LEAD2SYZ; //   const BOOLEAN OPT__HYBRIDNF   = attributes.OPT__HYBRIDNF; //   const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ; const char* usage = "ComputeSyzygy(, ) expected"; const ring r = attributes.m_rBaseRing; NoReturn(res); if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } const ideal L = (ideal) h->Data(); assume( IDELEMS(L) > 0 ); h = h->Next(); if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) { WerrorS(usage); return TRUE; } const ideal T = (ideal) h->Data(); assume( IDELEMS(L) == IDELEMS(T) ); h = h->Next(); assume( h == NULL ); ideal LL, TT; ComputeSyzygy(L, T, LL, TT, attributes); lists l = (lists)omAllocBin(slists_bin); l->Init(2); l->m[0].rtyp = MODUL_CMD; l->m[0].data = reinterpret_cast(LL); l->m[1].rtyp = MODUL_CMD; l->m[1].data = reinterpret_cast(TT); res->data = l; res->rtyp = LIST_CMD; return FALSE; } /// Get leading component static BOOLEAN leadcomp(leftv res, leftv h) { NoReturn(res); if ((h!=NULL) && (h->Typ()==VECTOR_CMD || h->Typ()==POLY_CMD)) { res->data = reinterpret_cast(jjLONG2N(iComp)); } else } else res->data = reinterpret_cast(jjLONG2N(0)); static BOOLEAN MakeInducedSchreyerOrdering(leftv res, leftv h) { NoReturn(res); int sign = 1; if ((h!=NULL) && (h->Typ()==INT_CMD)) static BOOLEAN GetInducedData(leftv res, leftv h) { NoReturn(res); const ring r = currRing; static BOOLEAN SetInducedReferrence(leftv res, leftv h) { res->Init(); NoReturn(res); return TRUE; } // F & componentWeights belong to that ordering block of currRing now: // #define ADD(A,B,C,D,E) ADD0(iiAddCproc, "", C, D, E) //#define ADD0(A,B,C,D,E) A(B, (char*)C, D, E) // #define ADD(A,B,C,D,E) ADD0(A->iiAddCproc, B, C, D, E) ADD("ClearContent", FALSE, _ClearContent); ADD("ClearDenominators", FALSE, _ClearDenominators); ADD("Tail", FALSE, Tail); ADD("ReduceTerm", FALSE, _ReduceTerm); ADD("TraverseTail", FALSE, _TraverseTail); ADD("SchreyerSyzygyNF", FALSE, _SchreyerSyzygyNF); ADD("ComputeSyzygy", FALSE, _ComputeSyzygy); ADD("ComputeResolution", FALSE, _ComputeResolution); //  ADD("", FALSE, ); #undef ADD return MAX_TOK;
• ## Singular/dyn_modules/syzextra/singularxx_defs.h

 r458174a //#ifdef HAVE_NAMESPACES // //#define BEGIN_NAMESPACE(a) namespace a { //#define END_NAMESPACE } // //#define USING_NAMESPACE(a) using namespace a; //#define FROM_NAMESPACE(a, s) a :: s // //#else // //#define BEGIN_NAMESPACE(a) //#define END_NAMESPACE // //#define USING_NAMESPACE(a) #define FROM_NAMESPACE(a, s) s //#endif //#define SINGULARXXNAME Singular // //#define BEGIN_NAMESPACE_SINGULARXX BEGIN_NAMESPACE(SINGULARXXNAME) //#define END_NAMESPACE_SINGULARXX END_NAMESPACE // //#define USING_NAMESPACE_SINGULARXX USING_NAMESPACE(SINGULARXXNAME) //#define FROM_NAMESPACE_SINGULARXXNAME(s) FROM_NAMESPACE(SINGULARXXNAME, s) // //#define BEGIN_NAMESPACE_NONAME BEGIN_NAMESPACE() // #ifndef HAVE_THROW #endif // #include "CSingularTypes.h" #endif /* SINGULAR_singular_defs_h_ */