Changeset 86016d in git for kernel/ring.cc


Ignore:
Timestamp:
Feb 1, 2007, 12:51:25 AM (17 years ago)
Author:
Motsak Oleksandr <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
c591ad0eb4ed9f5be86c0c85d2412be2ad6be556
Parents:
1cc61e18c0d6c70b177099c23a52159afb280bb4
Message:
*motsak:
 !+!: factors of SCA, debug print for SCA, "kill squares" in std.
  * : ncRingType, naming, formatting, unified NC setup.


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

Legend:

Unmodified
Added
Removed
  • kernel/ring.cc

    r1cc61e r86016d  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.55 2007-01-29 18:08:21 Singular Exp $ */
     4/* $Id: ring.cc,v 1.56 2007-01-31 23:51:24 motsak Exp $ */
    55
    66/*
     
    2626#ifdef HAVE_PLURAL
    2727#include "gring.h"
     28#include "sca.h"
    2829#endif
    2930#include "maps.h"
     
    390391    else PrintS(" ...");
    391392#ifdef PDEBUG
    392     Print("\n//   noncommutative type:%d",r->nc->type);
     393    Print("\n//   noncommutative type:%d", (int)ncRingType(r));
    393394    Print("\n//   is skew constant:%d",r->nc->IsSkewConstant);
     395    if( rIsSCA(r) )
     396    {
     397      Print("\n//   alternating variables: [%d, %d]", scaFirstAltVar(r), scaLastAltVar(r));
     398      const ideal Q = r->nc->SCAQuotient(); // resides within r!
     399      if (Q!=NULL)
     400      {
     401        PrintS("\n//   quotient of sca by ideal");
     402        if (r==currRing)
     403        {
     404          PrintLn();
     405          iiWriteMatrix((matrix)Q,"__",1);
     406        }
     407        else PrintS(" ...");
     408      }
     409    }
    394410    Print("\n//   ref:%d",r->nc->ref);
    395411#endif
     
    11571173    if ( !R2_is_nc ) nc_rCreateNCcomm(R2);
    11581174    /* nc->type's */
    1159     sum->nc->type = nc_undef;
    1160     nc_type t1 = R1->nc->type, t2 = R2->nc->type;
    1161     if ( t1==t2) sum->nc->type = t1;
     1175    ncRingType(sum, nc_undef);
     1176    nc_type t1 = ncRingType(R1), t2 = ncRingType(R2);
     1177    if ( t1==t2) ncRingType(sum, t1);
    11621178    else
    11631179    {
    1164       if ( (t1==nc_general) || (t2==nc_general) ) sum->nc->type = nc_general;
    1165     }
    1166     if (sum->nc->type == nc_undef) /* not yet done */
     1180      if ( (t1==nc_general) || (t2==nc_general) ) ncRingType(sum, nc_general);
     1181    }
     1182    if (ncRingType(sum) == nc_undef) /* not yet done */
    11671183    {
    11681184      switch (t1)
    11691185      {
    11701186        case nc_comm:
    1171           sum->nc->type = t2;
     1187          ncRingType(sum, t2);
    11721188          break;
    11731189        case nc_lie:
     
    11751191          {
    11761192            case nc_skew:
    1177               sum->nc->type = nc_general;  break;
     1193              ncRingType(sum, nc_general);  break;
    11781194            case nc_comm:
    1179               sum->nc->type = nc_lie;  break;
     1195              ncRingType(sum, nc_lie);  break;
    11801196            default:
    11811197              /*sum->nc->type = nc_undef;*/  break;
     
    11861202          {
    11871203            case nc_lie:
    1188               sum->nc->type = nc_lie;  break;
     1204              ncRingType(sum, nc_lie);  break;
    11891205            case nc_comm:
    1190               sum->nc->type = nc_skew;  break;
     1206              ncRingType(sum, nc_skew);  break;
    11911207            default:
    11921208              /*sum->nc->type = nc_undef;*/  break;
     
    11971213      }
    11981214    }
    1199     if (sum->nc->type == nc_undef)
     1215    if (ncRingType(sum) == nc_undef)
    12001216      WarnS("Error on recognizing nc types");
    12011217    /* multiplication matrices business: */
     
    39503966  r->nc->ref      = 1; /* in spite of rCopy(src)? */
    39513967  r->nc->basering = r;
    3952   r->nc->type     =  src->nc->type;
     3968  ncRingType(r, ncRingType(src));
    39533969  int *perm       = (int *)omAlloc0((rVar(r)+1)*sizeof(int));
    39543970  int *par_perm   = NULL;
Note: See TracChangeset for help on using the changeset viewer.