Changeset 8078c8 in git for Singular/ipshell.cc


Ignore:
Timestamp:
Feb 22, 2008, 12:14:16 PM (16 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
6f801b4e767f113dae2ed6a6e8b95d7227f2c3db
Parents:
d6e849378be41014886cff67801e4f404ef983ca
Message:
hannes: better alg. for OrdSgn


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

Legend:

Unmodified
Added
Removed
  • Singular/ipshell.cc

    rd6e849 r8078c8  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipshell.cc,v 1.177 2008-02-06 20:22:41 wienand Exp $ */
     4/* $Id: ipshell.cc,v 1.178 2008-02-22 11:14:16 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    41954195  R->wvhdl=(int**)omAlloc0(n*sizeof(int_ptr));
    41964196
     4197  int *weights=(int*)omAlloc0((R->N+1)*sizeof(int));
     4198
    41974199  // init order, so that rBlocks works correctly
    41984200  for (j=0; j < n-1; j++)
     
    42184220       */
    42194221      R->order[n] = (*iv)[1];
     4222      typ=1;
    42204223      switch ((*iv)[1])
    42214224      {
     
    42264229          case ringorder_Wp:
    42274230            R->wvhdl[n]=(int*)omAlloc((iv->length()-1)*sizeof(int));
     4231            R->block0[n] = last+1;
    42284232            for (i=2; i<iv->length(); i++)
    42294233            {
    42304234              R->wvhdl[n][i-2] = (*iv)[i];
     4235              last++;
     4236              if (weights[last]==0) weights[last]=(*iv)[i]*typ;
    42314237            }
    4232             R->block0[n] = last+1;
    4233             last += iv->length()-2;
    42344238            R->block1[n] = last;
    42354239            break;
     
    42494253            if (R->block0[n]>R->block1[n]) return TRUE;
    42504254            if (rCheckIV(iv)) return TRUE;
     4255            for(i=R->block0[n];i<=R->block1[n];i++)
     4256            {
     4257              if (weights[i]==0) weights[i]=typ;
     4258            }
    42514259            break;
    42524260          case ringorder_S:
     
    42634271            {
    42644272              R->wvhdl[n][i-2]=(*iv)[i];
    4265               if ((*iv)[i]<0) typ=-1;
     4273              last++;
     4274              if (weights[last]==0) weights[last]=(*iv)[i]*typ;
    42664275            }
     4276            last=R->block0[n]-1;
    42674277            break;
    42684278          case ringorder_a64:
     
    42754285            {
    42764286              w[i-2]=(*iv)[i];
    4277               if ((*iv)[i]<0) typ=-1;
     4287              last++;
     4288              if (weights[last]==0) weights[last]=(*iv)[i]*typ;
    42784289            }
     4290            last=R->block0[n]-1;
    42794291            break;
    42804292          }
     
    42844296            if (Mtyp==0) return TRUE;
    42854297            if (Mtyp==-1) typ = -1;
     4298            for(i=R->block0[n];i<=R->block1[n];i++)
     4299            {
     4300              if (weights[i]==0) weights[i]=typ;
     4301            }
    42864302
    42874303            R->wvhdl[n] =( int *)omAlloc((iv->length()-1)*sizeof(int));
     
    43324348    }
    43334349  }
    4334   R->OrdSgn = typ;
     4350  // find OrdSgn:
     4351  R->OrdSgn = 1;
     4352  for(i=1;i<=R->N;i++)
     4353  { if (weights[i]<0) { R->OrdSgn=-1;break; }}
     4354  omFree(weights);
    43354355  return FALSE;
    43364356}
Note: See TracChangeset for help on using the changeset viewer.