Changeset 5523b05 in git


Ignore:
Timestamp:
Feb 12, 2019, 10:15:38 AM (5 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '3720ae8bfcff4a4649ee98a15552089151d2d59b')
Children:
4f66c93aaadb157ea3891d5b402351d3b747c266
Parents:
d4544a591cc6bf2a1fba681067422f3056ef5eab6dec960990df047d162538a2bdcc48be39657b52
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2019-02-12 10:15:38+01:00
git-committer:
GitHub <noreply@github.com>2019-02-12 10:15:38+01:00
Message:
Merge pull request #912 from kabouzeid/bracket

Bracket
Location:
Singular
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/freegb.lib

    rd4544a r5523b05  
    2626lpDegBound(R);                   returns the degree bound of a letterplace ring
    2727lpVarBlockSize(R);               returns the size of the letterplace blocks
    28 letplaceGBasis(I);               (deprecated) two-sided Groebner basis of a letterplace ideal I
    2928lpDivision(f,I);                 two-sided division with remainder
    3029lpGBPres2Poly(L,I);              reconstructs a polynomial from the output of lpDivision
    31 lieBracket(a,b[, N]);            Lie bracket ab-ba of two letterplace polynomials
    3230isOrderingShiftInvariant(i);     tests shift-invariance of the monomial ordering
    33 isVar(p);                        check whether p is a power of a single variable
    34 makeLetterplaceRing(d);          (deprecated) creates a Letterplace ring out of given data
     31makeLetterplaceRing(d);          (deprecated, use freeAlgebra) creates a Letterplace ring out of given data
     32letplaceGBasis(I);               (deprecated, use twostd) two-sided Groebner basis of a letterplace ideal I
     33lieBracket(a,b[, N]);            (deprecated, use bracket) Lie bracket ab-ba of two letterplace polynomials
    3534setLetterplaceAttributes(R,d,b); (for testing purposes) supplies ring R with the letterplace structure
    3635
     
    7271  example lieBracket;
    7372  example lpPrint;
    74   example isVar;
    7573
    7674  example ivL2lpI;
     
    323321}
    324322
    325 proc isVar(poly p)
     323static proc isVar(poly p)
    326324"USAGE:  isVar(p);  poly p
    327325RETURN:  int
     
    416414"
    417415{
    418   if (lpAssumeViolation())
    419   {
    420     //    ERROR("Either 'uptodeg' or 'lV' global variables are not set!");
    421     ERROR("Incomplete Letterplace structure on the basering!");
    422   }
    423   // alias ppLiebr;
    424   //if int N is given compute [a,[...[a,b]]]] left normed bracket
    425416  int N=1;
    426417  if (size(#)>0)
     
    431422    }
    432423  }
    433   if (N<=0) { return(q); }
    434   poly q = a*b - b*a;
    435   if (N >1)
    436   {
    437     for(int i=1; i<=N-1; i++)
    438     {
    439       q = lieBracket(a,q);
    440     }
    441   }
    442   return(q);
     424  return (bracket(a,b,N));
     425
     426  /* if (lpAssumeViolation()) */
     427  /* { */
     428  /*   //    ERROR("Either 'uptodeg' or 'lV' global variables are not set!"); */
     429  /*   ERROR("Incomplete Letterplace structure on the basering!"); */
     430  /* } */
     431  /* // alias ppLiebr; */
     432  /* //if int N is given compute [a,[...[a,b]]]] left normed bracket */
     433  /* int N=1; */
     434  /* if (size(#)>0) */
     435  /* { */
     436  /*   if (typeof(#[1])=="int") */
     437  /*   { */
     438  /*     N = int(#[1]); */
     439  /*   } */
     440  /* } */
     441  /* if (N<=0) { return(q); } */
     442  /* poly q = a*b - b*a; */
     443  /* if (N >1) */
     444  /* { */
     445  /*   for(int i=1; i<=N-1; i++) */
     446  /*   { */
     447  /*     q = lieBracket(a,q); */
     448  /*   } */
     449  /* } */
     450  /* return(q); */
    443451}
    444452example
  • Singular/iparith.cc

    rd4544a r5523b05  
    28752875  res->data=NULL;
    28762876
    2877   if (rIsPluralRing(currRing))
     2877  if (rIsPluralRing(currRing) || rIsLPRing(currRing))
    28782878  {
    28792879    const poly q = (poly)b->Data();
     
    28832883      if( (poly)a->Data() != NULL )
    28842884      {
    2885         poly p = (poly)a->CopyD(POLY_CMD); // p = copy!
    2886         res->data = nc_p_Bracket_qq(p,q, currRing); // p will be destroyed!
     2885        if (rIsPluralRing(currRing))
     2886        {
     2887          poly p = (poly)a->CopyD(POLY_CMD); // p = copy!
     2888          res->data = nc_p_Bracket_qq(p,q, currRing); // p will be destroyed!
     2889        }
     2890        else if (rIsLPRing(currRing))
     2891        {
     2892          const poly p = (poly)a->Data();
     2893          res->data = pAdd(ppMult_qq(p,q), pNeg(ppMult_qq(q,p)));
     2894        }
     2895      }
     2896    }
     2897  }
     2898  return FALSE;
     2899}
     2900static BOOLEAN jjBRACKET_REC(leftv res, leftv a, leftv b, leftv c)
     2901{
     2902  res->data=NULL;
     2903
     2904  if (rIsLPRing(currRing) || rIsPluralRing(currRing))
     2905  {
     2906    const poly q = (poly)b->Data();
     2907    if(q != NULL)
     2908    {
     2909      if((poly)a->Data() != NULL)
     2910      {
     2911        const poly p = (poly)a->Data();
     2912        int k=(int)(long)c->Data();
     2913        if (k > 0)
     2914        {
     2915          poly qq = pCopy(q);
     2916          for (int i = 0; i < k; i++)
     2917          {
     2918            poly qq_ref = qq;
     2919            if (rIsLPRing(currRing))
     2920            {
     2921              qq = pAdd(ppMult_qq(p,qq), pNeg(ppMult_qq(qq,p)));
     2922            }
     2923            else if (rIsPluralRing(currRing))
     2924            {
     2925              qq = nc_p_Bracket_qq(pCopy(p), qq, currRing);
     2926            }
     2927            pDelete(&qq_ref);
     2928            if (qq == NULL) break;
     2929          }
     2930          res->data = qq;
     2931        }
     2932        else
     2933        {
     2934          Werror("invalid number of iterations");
     2935        }
    28872936      }
    28882937    }
  • Singular/table.h

    rd4544a r5523b05  
    593593,{D(jjBETTI2_ID), BETTI_CMD,      INTMAT_CMD,     IDEAL_CMD,  INT_CMD, ALLOW_PLURAL | ALLOW_RING}
    594594,{D(jjBETTI2_ID), BETTI_CMD,      INTMAT_CMD,     MODUL_CMD,  INT_CMD, ALLOW_PLURAL | ALLOW_RING}
    595 #ifdef HAVE_PLURAL
    596 ,{D(jjBRACKET),   BRACKET_CMD,    POLY_CMD,       POLY_CMD,   POLY_CMD, ALLOW_PLURAL | NO_RING}
     595#if defined(HAVE_PLURAL) || defined(HAVE_SHIFTBBA)
     596,{D(jjBRACKET),   BRACKET_CMD,    POLY_CMD,       POLY_CMD,   POLY_CMD, ALLOW_NC | NO_RING}
    597597#endif
    598598,{D(jjCHINREM_BI),CHINREM_CMD,    BIGINT_CMD,     INTVEC_CMD, INTVEC_CMD, ALLOW_PLURAL |ALLOW_RING}
     
    787787,{D(jjBRACK_Ma_IV_I),  '[',        POLY_CMD,   MATRIX_CMD, INTVEC_CMD, INT_CMD, ALLOW_NC |ALLOW_RING}
    788788,{D(jjBRACK_Ma_IV_IV), '[',        POLY_CMD,   MATRIX_CMD, INTVEC_CMD, INTVEC_CMD, ALLOW_NC |ALLOW_RING}
     789#if defined(HAVE_SHIFTBBA) || defined(HAVE_PLURAL)
     790,{D(jjBRACKET_REC),    BRACKET_CMD,POLY_CMD,   POLY_CMD,   POLY_CMD,   INT_CMD, ALLOW_NC | NO_RING}
     791#endif
    789792,{D(jjRING_2),         '[',        RING_CMD,   CRING_CMD,  ANY_TYPE,   ANY_TYPE, ALLOW_NC |ALLOW_RING}
    790793#ifdef SINGULAR_4_2
     
    986989  { "bigintmat",   0, BIGINTMAT_CMD ,     BIGINTMAT_CMD},
    987990  { "branchTo",    0, BRANCHTO_CMD ,      CMD_M},
    988   #ifdef HAVE_PLURAL
    989   { "bracket",     0, BRACKET_CMD ,       CMD_2},
     991  #if defined(HAVE_SHIFTBBA) || defined(HAVE_PLURAL)
     992  { "bracket",     0, BRACKET_CMD ,       CMD_23},
    990993  #endif
    991994  { "break",       0, BREAK_CMD ,         BREAK_CMD},
Note: See TracChangeset for help on using the changeset viewer.