Changeset 46d945 in git


Ignore:
Timestamp:
Feb 11, 2019, 8:46:20 PM (5 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '3720ae8bfcff4a4649ee98a15552089151d2d59b')
Children:
e5c5654e20688cb941272427f370c757f08c21b1
Parents:
e7ba75b3c38508e0d686d4edb02c3fac3c0bdf63
Message:
Add recursive bracket to Plural and Letterplace, add normal bracket for
Letterplace
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

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

    re7ba75 r46d945  
    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.