Changeset 645a19 in git for kernel/p_polys.cc


Ignore:
Timestamp:
Jul 20, 2009, 2:01:13 PM (15 years ago)
Author:
Motsak Oleksandr <motsak@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
195b03db00f5e08ad6a891adcf3a7794a5dd00bf
Parents:
45c67dc7a3eec0097d1ad6ff5635d960cc089937
Message:
*motsak: deep kernel implementation of induced Schreyer ordering + helpers


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

Legend:

Unmodified
Added
Removed
  • kernel/p_polys.cc

    r45c67dc r645a19  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_polys.cc,v 1.17 2009-06-10 15:34:50 Singular Exp $
     9 *  Version: $Id: p_polys.cc,v 1.18 2009-07-20 12:00:51 motsak Exp $
    1010 *******************************************************************/
    1111
     
    173173          break;
    174174        }
     175        // Prefix for Induced Schreyer ordering
     176        case ro_isTemp: // Do nothing?? (to be removed into suffix later on...?)
     177        {
     178          assume(p != NULL);
     179
     180#ifndef NDEBUG
     181#if MYTEST
     182          Print("isTemp ord in rSetm: pos: %d, p: ", pos);  p_DebugPrint(p, r, r, 0);
     183#endif
     184#endif
     185          int c = p_GetComp(p, r);
     186
     187          assume( c >= 0 );
     188          const int limit = o->data.is.limit;
     189
     190          assume( limit >= 0 );
     191
     192          // Let's simulate case ro_syz above....
     193          // Should accumulate (by Suffix) and be a level indicator
     194          const int* const pVarOffset = o->data.isTemp.pVarOffset;
     195
     196          assume( pVarOffset != NULL );
     197
     198          if( c > limit )
     199            p->exp[o->data.isTemp.start] = 1;
     200          else
     201          {
     202            p->exp[o->data.isTemp.start] = 0;
     203          }
     204
     205          // TODO: Can this be done in the suffix???
     206          for( int i = 1; i <= r->N; i++ ) // No v[0] here!!!
     207          {
     208            const int vo = pVarOffset[i];
     209            if( vo != -1) // TODO: optimize: can be done once!
     210            {
     211              p_SetExp(p, p_GetExp(p, i, r), r, vo); // copy put them verbatim
     212              assume( p_GetExp(p, r, vo) == p_GetExp(p, i, r) ); // copy put them verbatim
     213            }
     214          }
     215
     216       
     217
     218#ifndef NDEBUG
     219          for( int i = 1; i <= r->N; i++ ) // No v[0] here!!!
     220          {
     221            const int vo = pVarOffset[i];
     222            if( vo != -1) // TODO: optimize: can be done once!
     223            {
     224              assume( p_GetExp(p, r, vo) == p_GetExp(p, i, r) ); // copy put them verbatim
     225            }
     226          }
     227
     228#if MYTEST
     229//          if( p->exp[o->data.isTemp.start] > 0 )
     230//          {
     231//            PrintS("Initial Value: "); p_DebugPrint(p, r, r, 1);
     232//          }
     233#endif
     234#endif
     235
     236          break;
     237        }
     238
     239        // Suffix for Induced Schreyer ordering
     240        case ro_is:
     241        {
     242          assume(p != NULL);
     243
     244          int c = p_GetComp(p, r);
     245
     246          assume( c >= 0 );
     247          const ideal F = o->data.is.F;
     248          const int limit = o->data.is.limit;
     249
     250          if( F != NULL && c > limit )
     251          {
     252#ifndef NDEBUG
     253#if MYTEST
     254            Print("is ord in rSetm: pos: %d, c: %d, limit: %d\n", c, pos, limit); // p_DebugPrint(p, r, r, 1);
     255#endif
     256#endif
     257
     258            c -= limit;
     259            assume( c > 0 );
     260            c--;
     261
     262            assume( c < IDELEMS(F) ); // What about others???
     263
     264            const poly pp = F->m[c]; // get reference monomial!!!
     265
     266
     267#ifndef NDEBUG
     268#if MYTEST
     269            Print("Respective F[c - %d: %d] pp: ", limit, c);
     270            p_DebugPrint(pp, r, r, 1);
     271#endif
     272#endif
     273
     274
     275            if(pp == NULL) break;
     276
     277            const int start = o->data.is.start;
     278            const int end = o->data.is.end;
     279
     280            assume(start <= end);
     281            assume(pp != NULL);
     282
     283            for( int i = start; i <= end; i++) // v[0] may be here...
     284              p->exp[i] += pp->exp[i]; // !!!!!!!! ADD corresponding LT(F)
     285
     286#ifndef NDEBUG
     287            const int* const pVarOffset = o->data.is.pVarOffset;
     288
     289            assume( pVarOffset != NULL );
     290
     291            for( int i = 1; i <= r->N; i++ ) // No v[0] here!!!
     292            {
     293              const int vo = pVarOffset[i];
     294              if( vo != -1) // TODO: optimize: can be done once!
     295                assume( p_GetExp(p, r, vo) == (p_GetExp(p, i, r) + p_GetExp(pp, r, vo)) );
     296            }
     297            // TODO: how to check this for computed values???
     298#endif
     299#ifndef NDEBUG
     300#if MYTEST
     301            PrintS("IS::Suffix::Result: "); // p_Write(p, r, r);
     302            p_DebugPrint(p, r, r, 1);
     303#endif
     304#endif
     305
     306          } else
     307          {
     308            const int* const pVarOffset = o->data.is.pVarOffset;
     309
     310            // What about v[0] - component: it will be added later by
     311            // suffix!!!
     312            // TODO: Test it!
     313            const int vo = pVarOffset[0];
     314            if( vo != -1 )
     315              p->exp[vo] = c; // initial component v[0]!
     316          }
     317
     318          break;
     319        }
    175320        default:
    176321          dReportError("wrong ord in rSetm:%d\n",o->ord_typ);
     
    337482      case ringorder_S:
    338483      case ringorder_s:
     484      case ringorder_IS:
    339485      case ringorder_aa:
    340486        break;
Note: See TracChangeset for help on using the changeset viewer.