Changeset 7d9b62 in git


Ignore:
Timestamp:
Aug 13, 2009, 7:25:55 PM (15 years ago)
Author:
Motsak Oleksandr <motsak@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b52fc4b2495505785981d640dcf7eb3e456778ef')
Children:
e024c6c7d55e55f6cf66fb9de0d37e618f6e601a
Parents:
f5da374c614ef679bad9ff3b7d6e407d7f0dc8b0
Message:
*motsak: regiester variables + bug fixed (D was ignored...)


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

Legend:

Unmodified
Added
Removed
  • kernel/sca.cc

    rf5da37 r7d9b62  
    77 *  Author:  motsak (Oleksandr Motsak)
    88 *  Created: 2006/12/18
    9  *  Version: $Id: sca.cc,v 1.38 2009-05-29 16:23:17 Singular Exp $
     9 *  Version: $Id: sca.cc,v 1.39 2009-08-13 17:25:55 motsak Exp $
    1010 *******************************************************************/
    1111
     
    8484
    8585////////////////////////////////////////////////////////////////////////////////////////////////////
    86 // Super Commutative Algabra extension by Motsak
     86// Super Commutative Algebra extension by Oleksandr
    8787////////////////////////////////////////////////////////////////////////////////////////////////////
    8888
     
    112112    const unsigned int iLastAltVar  = scaLastAltVar(rRing);
    113113
    114     unsigned int tpower = 0;
    115     unsigned int cpower = 0;
    116 
    117     for( unsigned int j = iLastAltVar; j >= iFirstAltVar; j-- )
     114    register unsigned int tpower = 0;
     115    register unsigned int cpower = 0;
     116
     117    for( register unsigned int j = iLastAltVar; j >= iFirstAltVar; j-- )
    118118    {
    119119      const unsigned int iExpM  = p_GetExp(pMonomM,  j, rRing);
     
    125125#endif
    126126
    127       if( iExpMM != 0 )
     127      if( iExpMM != 0 ) // TODO: think about eliminating there if-s...
    128128      {
    129129        if( iExpM != 0 )
     
    163163    const unsigned int iLastAltVar = scaLastAltVar(rRing);
    164164
    165     unsigned int tpower = 0;
    166     unsigned int cpower = 0;
    167 
    168     for( unsigned int j = iLastAltVar; j >= iFirstAltVar; j-- )
     165    register unsigned int tpower = 0;
     166    register unsigned int cpower = 0;
     167
     168    for( register unsigned int j = iLastAltVar; j >= iFirstAltVar; j-- )
    169169    {
    170170      const unsigned int iExpM  = p_GetExp(pMonomM,  j, rRing);
     
    227227    const unsigned int iLastAltVar = scaLastAltVar(rRing);
    228228
    229     unsigned int tpower = 0;
    230     unsigned int cpower = 0;
    231 
    232     for( unsigned int j = iLastAltVar; j >= iFirstAltVar; j-- )
     229    register unsigned int tpower = 0;
     230    register unsigned int cpower = 0;
     231
     232    for( register unsigned int j = iLastAltVar; j >= iFirstAltVar; j-- )
    233233    {
    234234      const unsigned int iExpMM = p_GetExp(pMonomMM, j, rRing);
     
    292292    const unsigned int iLastAltVar = scaLastAltVar(rRing);
    293293
    294     unsigned int tpower = 0;
    295     unsigned int cpower = 0;
    296 
    297     for( unsigned int j = iLastAltVar; j >= iFirstAltVar; j-- )
     294    register unsigned int tpower = 0;
     295    register unsigned int cpower = 0;
     296
     297    for( register unsigned int j = iLastAltVar; j >= iFirstAltVar; j-- )
    298298    {
    299299      const unsigned int iExp1 = p_GetExp(pMonom1, j, rRing);
     
    364364    const unsigned int iFirstAltVar = scaFirstAltVar(rRing);
    365365
    366     unsigned int cpower = 0;
    367 
    368     for( unsigned int j = iFirstAltVar; j < i ; j++ )
     366    register unsigned int cpower = 0;
     367
     368    for( register unsigned int j = iFirstAltVar; j < i ; j++ )
    369369      cpower ^= p_GetExp(pMonom, j, rRing);
    370370
     
    13041304  assume(rIsPluralRing(rG));
    13051305
    1306 #if MYTEST
     1306#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
    13071307  PrintS("sca_SetupQuotient(rGR, rG, bCopy)");
    13081308
     
    13601360  int iAltVarStart   = N+1;
    13611361
    1362   const ring rBase = rG->GetNC()->basering;
    1363   const matrix C   = rG->GetNC()->C; // live in rBase!
     1362  const nc_struct* NC = rG->GetNC();
     1363  const ring rBase = NC->basering;
     1364  const matrix C   = NC->C; // live in rBase!
     1365  const matrix D   = NC->D; // live in rBase!
    13641366
    13651367#if OUTPUT
     
    13711373    for(int j = i + 1; j <= N; j++)
    13721374    {
     1375      if( MATELEM(D,i,j) != NULL) // !!!???
     1376      {
     1377#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
     1378        Print("Nonzero D[%d, %d]\n", i, j);
     1379#endif
     1380        return false;
     1381      }
     1382     
     1383     
    13731384      assume(MATELEM(C,i,j) != NULL); // after CallPlural!
    13741385      number c = p_GetCoeff(MATELEM(C,i,j), rBase);
     
    13851396        if( !n_IsOne(c, rBase) )
    13861397        {
    1387 #if OUTPUT
     1398#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
    13881399          Print("Wrong Coeff at: [%d, %d]\n", i, j);
    1389 #endif
    1390 #if MYTEST
    1391            Print("Wrong Coeff at: [%d, %d]\n", i, j);
    13921400#endif
    13931401          return false;
     
    13971405  }
    13981406
    1399 #if MYTEST
     1407#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
    14001408  Print("AltVars?1: [%d, %d]\n", iAltVarStart, iAltVarEnd);
    14011409#endif
     
    14171425        if( !n_IsMOne(c, rBase) )
    14181426        {
    1419 #ifdef PDEBUG
    1420 #if OUTPUT
    1421            Print("Wrong Coeff at: [%d, %d]\n", i, j);
    1422 #endif
    1423 #endif
    1424 
    1425 #if MYTEST
     1427#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
    14261428           Print("Wrong Coeff at: [%d, %d]\n", i, j);
    14271429#endif
     
    14321434        if( !n_IsOne(c, rBase) )
    14331435        {
    1434 #ifdef PDEBUG
    1435 #if OUTPUT
    1436           Print("Wrong Coeff at: [%d, %d]\n", i, j);
    1437 #endif
    1438 #endif
    1439 #if MYTEST
     1436#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
    14401437           Print("Wrong Coeff at: [%d, %d]\n", i, j);
    14411438#endif
     
    14461443  }
    14471444
    1448 #if MYTEST
     1445#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
    14491446  Print("AltVars!?: [%d, %d]\n", iAltVarStart, iAltVarEnd);
    14501447#endif
     
    14651462
    14661463
    1467 #if MYTEST
     1464#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
    14681465  PrintS("Analyzing quotient ideal:\n");
    14691466  idPrint(idQuotient); // in rG!!!
     
    14851482    e = si_max(e, scaLastAltVar(rG));
    14861483
    1487 #if MYTEST
     1484#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
    14881485    Print("AltVars!?: [%d, %d]\n", b, e);
    14891486#endif
     
    15171514
    15181515
    1519 #ifdef PDEBUG
    1520 #if OUTPUT
     1516#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
    15211517  Print("ScaVars!: [%d, %d]\n", iAltVarStart, iAltVarEnd);
    1522 #endif
    15231518#endif
    15241519
     
    15301525
    15311526
    1532 #ifdef PDEBUG
    1533 #if OUTPUT
     1527#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
    15341528  PrintS("Quotient: \n");
    15351529  iiWriteMatrix((matrix)idQuotient,"__",1);
    15361530  PrintS("tempSCAQuotient: \n");
    15371531  iiWriteMatrix((matrix)tempQ,"__",1);
    1538 #endif
    15391532#endif
    15401533 
     
    15541547
    15551548
    1556 #ifdef PDEBUG
    1557 #if OUTPUT
     1549#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
    15581550  PrintS("SCAQuotient: \n");
    15591551  if(tempQ != NULL)
     
    15611553  else
    15621554    PrintS("(NULL)\n");
    1563 #endif
    15641555#endif
    15651556 
Note: See TracChangeset for help on using the changeset viewer.