Changeset 03b1019 in git


Ignore:
Timestamp:
May 1, 2005, 9:56:36 PM (18 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
a0ddf2ce9398ab9d21db077c3aab6d162a7a76ad
Parents:
1e975e5126b0e8c7606f27ce3d820fad6d693183
Message:
*levandov: added dots for nc relations if r is not a currRing and other minor fixes


git-svn-id: file:///usr/local/Singular/svn/trunk@7978 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/ring.cc

    r1e975e r03b1019  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.34 2005-04-29 17:35:18 Singular Exp $ */
     4/* $Id: ring.cc,v 1.35 2005-05-01 19:56:36 levandov Exp $ */
    55
    66/*
     
    325325  }
    326326#ifdef HAVE_PLURAL
    327   if ((r->nc!=NULL) && (r==currRing))
    328   {
    329     poly pl=NULL;
    330     int nl;
     327  if (r->nc!=NULL)
     328  {
    331329    PrintS("\n//   noncommutative relations:");
    332     //    Print("\n//   noncommutative relations (type %d):",(int)r->nc->type);
    333     for (int i = 1; i<r->N; i++)
    334     {
    335       for (int j = i+1; j<=r->N; j++)
    336       {
    337         nl=nIsOne(p_GetCoeff(MATELEM(r->nc->C,i,j),r));
    338         if ((MATELEM(r->nc->D,i,j)!=NULL)||(!nl))
    339         {
    340           Print("\n//    %s%s=",r->names[j-1],r->names[i-1]);
    341           pl=MATELEM(r->nc->MT[UPMATELEM(i,j,r->N)],1,1);
    342           pWrite0(pl);
    343         }
    344       }
    345     }
     330    if (r==currRing)
     331    {
     332      poly pl=NULL;
     333      int nl;
     334      int i,j;
     335      //    Print("\n//   noncommutative relations (type %d):",(int)r->nc->type);
     336      for (i = 1; i<r->N; i++)
     337      {
     338        for (j = i+1; j<=r->N; j++)
     339        {
     340          nl = nIsOne(p_GetCoeff(MATELEM(r->nc->C,i,j),r));
     341          if ( (MATELEM(r->nc->D,i,j)!=NULL) || (!nl) )
     342          {
     343            Print("\n//    %s%s=",r->names[j-1],r->names[i-1]);
     344            pl = MATELEM(r->nc->MT[UPMATELEM(i,j,r->N)],1,1);
     345            pWrite0(pl);
     346          }
     347        }
     348      }
     349    }
     350    else PrintS(" ...");
    346351#ifdef PDEBUG
    347352    Print("\n//   noncommutative type:%d",r->nc->type);
     
    10971102    if ( !R1_is_nc ) nc_rCreateNCcomm(R1);
    10981103    if ( !R2_is_nc ) nc_rCreateNCcomm(R2);
    1099     /* nc types */
     1104    /* nc->type's */
    11001105    sum->nc->type = nc_undef;
    11011106    nc_type t1 = R1->nc->type, t2 = R2->nc->type;
     
    11401145    if (sum->nc->type == nc_undef)
    11411146      WarnS("Error on recognizing nc types");
    1142     /* multiplication matrices */
    1143 //     ring old_ring = currRing;
    1144 //     rChangeCurrRing(sum);
    1145 /* find permutations of vars and pars */
     1147    /* multiplication matrices business: */
     1148    /* find permutations of vars and pars */
    11461149    int *perm1 = (int *)omAlloc0((rVar(R1)+1)*sizeof(int));
    11471150    int *par_perm1 = NULL;
     
    11501153    int *par_perm2 = NULL;
    11511154    if (rPar(R2)!=0) par_perm2=(int *)omAlloc0((rPar(R2)+1)*sizeof(int));
    1152     //    maFindPerm(char **preim_names, int preim_n, char **preim_par, int preim_p,
    1153     //                char **names,       int n,       char **par,       int nop,
    1154     //                int * perm, int *par_perm, int ch);
    11551155    maFindPerm(R1->names,  rVar(R1),  R1->parameter,  rPar(R1),
    11561156               sum->names, rVar(sum), sum->parameter, rPar(sum),
     
    12071207    rDelete(R1);
    12081208    rDelete(R2);
    1209     /* TODO: delete perm arrays */
     1209    /* delete perm arrays */
    12101210    if (perm1!=NULL) omFree((ADDRESS)perm1);
    12111211    if (perm2!=NULL) omFree((ADDRESS)perm2);
     
    38323832    return r;
    38333833  }
     3834  if ( rIsPluralRing(src) )
    38343835  {
    38353836  rChangeCurrRing(r);  /* we were not in r */
     
    38773878  rChangeCurrRing(save);
    38783879  }
    3879 #endif
     3880#endif /* HAVE_PLURAL */
    38803881  return r;
    38813882}
     
    38903891  if ( stat <=0 )
    38913892    WarnS("Error in rEnvelope at rSum");
    3892   /* now create the qideal for qrings */
    3893 //    if (R->qideal != NULL)
    3894 //    {
    3895 //      ring save = currRing;
    3896 //      rChangeCurrRing(Ropp);
    3897 //      ideal Q = idCopy(R->qideal);
    3898 //      ideal Qop = idOppose(R,Q);
    3899 //      rChangeCurrRing(Renv);
    3900 //      ideal Qenv = idInit(Q->ncols+Qop->ncols,1);
    3901 //      int i;
    3902 //      for (i=0; i< Q->ncols; i++)
    3903 //      {
    3904 //        Qenv->m[i] = maIMap(R,Q->m[i]);
    3905 //      }
    3906 //      for (i=0; i<= Qop->ncols; i++)
    3907 //      {
    3908 //        Qenv->m[Q->ncols+i] = maIMap(Ropp,Qop->m[i]);
    3909 //      }
    3910 //      /* should we run twostd on the result? */
    3911 //      Renv->qideal = Qenv;
    3912 //      rChangeCurrRing(save);
    3913 //    }
    39143893  rTest(Renv);
    39153894  return Renv;
Note: See TracChangeset for help on using the changeset viewer.