Changeset 8f1473 in git


Ignore:
Timestamp:
Sep 29, 1998, 11:14:46 PM (25 years ago)
Author:
Thomas Siebert <siebert@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
c616d1a866332e51b67371d164a1d853e45e3434
Parents:
c898336d2b07c6834ddddbc81515f8b883795ba3
Message:
*** empty log message ***


git-svn-id: file:///usr/local/Singular/svn/trunk@2528 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Singular/ideals.cc

    rc89833 r8f1473  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.36 1998-09-04 16:04:51 Singular Exp $ */
     4/* $Id: ideals.cc,v 1.37 1998-09-29 21:14:43 siebert Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    23192319  {
    23202320    idDelete((ideal*)&a);
     2321    idDelete((ideal*)&nextStep);
    23212322    return;
    23222323  }
  • Singular/matpol.cc

    rc89833 r8f1473  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: matpol.cc,v 1.18 1998-09-04 16:06:30 Singular Exp $ */
     4/* $Id: matpol.cc,v 1.19 1998-09-29 21:14:45 siebert Exp $ */
    55
    66/*
     
    396396    Bareiss->mpElimBareiss(div);
    397397    div = Bareiss->mpGetElem(Bareiss->mpGetRdim(), Bareiss->mpGetCdim());
     398    pDelete(H);
    398399    *H = pCopy(div);
    399400    *c = Bareiss->mpGetCol()+1;
     
    404405  else
    405406  {
     407    pDelete(H);
    406408    *H = NULL;
    407409    *c = *r = 0;
  • Singular/syz.cc

    rc89833 r8f1473  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: syz.cc,v 1.9 1998-04-29 07:05:30 siebert Exp $ */
     4/* $Id: syz.cc,v 1.10 1998-09-29 21:14:46 siebert Exp $ */
    55
    66/*
     
    220220{
    221221  int syzIndex=first;
     222  intvec * dummy;
    222223
    223224  if (syzIndex<1) syzIndex=1;
     225  if ((syzIndex==1) && (idHomModule(res[0],currQuotient,&dummy)))
     226  {
     227    delete dummy;
     228    resolvente res1=syFastMin(res,length);
     229    int i;
     230    for (i=0;i<length;i++)
     231    {
     232      idDelete(&res[i]);
     233      res[i] = res1[i];
     234    }
     235    Free((ADDRESS)res1,length*sizeof(ideal));
     236    return;
     237  }
    224238  while ((syzIndex<length-1) && (res[syzIndex]!=NULL) && (res[syzIndex+1]!=NULL))
    225239  {
     
    10141028  return j;
    10151029}
     1030
     1031/*2
     1032* determines the generators of a minimal resolution
     1033* contained in res
     1034*/
     1035static int ** syScanRes(resolvente res, int length)
     1036{
     1037  int i=0,j,k;
     1038  int **result=(int**)Alloc0(length*sizeof(int*));
     1039  poly p;
     1040  ideal tid;
     1041
     1042  while ((i<length) && (!idIs0(res[i])))
     1043  {
     1044    result[i] = (int*)Alloc0(IDELEMS(res[i])*sizeof(int));
     1045    for (j=IDELEMS(res[i])-1;j>=0;j--)
     1046    {
     1047      if (res[i]->m[j]==NULL) (result[i])[j] = -1;
     1048    }
     1049    if (i>0)
     1050    {
     1051      tid = idJet(res[i],0);
     1052      Print("Der %d-te 0-jet ist:\n",i);
     1053      for (j=0;j<IDELEMS(tid);j++)
     1054      {
     1055        if (tid->m[j]!=0)
     1056        {
     1057          Print("poly %d :",j);pWrite(tid->m[j]);
     1058        }
     1059      }
     1060      for (j=0;j<IDELEMS(tid);j++)
     1061      {
     1062        p = tid->m[j];
     1063        while (p!=NULL)
     1064        {
     1065          pNorm(p);
     1066          k = (result[i-1])[pGetComp(p)-1];
     1067          if ((k==0) || (k==-2))
     1068          {
     1069            (result[i-1])[pGetComp(p)-1] = j+1;
     1070            (result[i])[j] = -2;
     1071            break;
     1072          }
     1073          else if (k>0)
     1074          {
     1075            p = pSub(p,pCopy(tid->m[k-1]));
     1076          }
     1077          else if (k==-1)
     1078          {
     1079            Print("Something is rotten in the state of Denmark\n");
     1080          }
     1081        }
     1082        tid->m[j] = p;
     1083      }
     1084      Print("Der %d-te 0-jet ist:\n",i);
     1085      for (j=0;j<IDELEMS(tid);j++)
     1086      {
     1087        if (tid->m[j]!=0)
     1088        {
     1089          Print("poly %d :",j);pWrite(tid->m[j]);
     1090        }
     1091      }
     1092      idDelete(&tid);
     1093    }
     1094    i++;
     1095  }
     1096  Print("Die gescannte Struktur ist:\n");
     1097  for (i=0;i<length;i++)
     1098  {
     1099    Print("Fuer den %d-ten Module:\n",i);
     1100    if (!idIs0(res[i]))
     1101      for (j=0;j<IDELEMS(res[i]);j++) Print(" %d",(result[i])[j]);
     1102    Print("\n");
     1103  }
     1104  return result;
     1105}
     1106
     1107static void syReduce(ideal toRed,poly redWith,int redComp)
     1108{
     1109  int i;
     1110  poly p=redWith,pp,ppp;
     1111  number n;
     1112
     1113  while ((p!=NULL) && (pGetComp(p)!=redComp)) pIter(p);
     1114  if (p==NULL)
     1115  {
     1116    Print("Hier ist was faul!\n");
     1117  }
     1118  else
     1119  {
     1120    n = nCopy(pGetCoeff(p));
     1121  }
     1122  p = redWith;
     1123  for (i=0;i<IDELEMS(toRed);i++)
     1124  {
     1125    pp = toRed->m[i];
     1126    while ((pp!=NULL) && (pGetComp(pp)!=redComp)) pIter(pp);
     1127    if (pp!=NULL)
     1128    {
     1129      ppp = pMultCopyN(p,pGetCoeff(pp));
     1130      pMultN(toRed->m[i],n);
     1131      toRed->m[i] = pSub(toRed->m[i],ppp);
     1132    }
     1133  }
     1134  nDelete(&n);
     1135}
     1136
     1137resolvente syFastMin(resolvente res,int length)
     1138{
     1139  int **res_shape=syScanRes(res,length);
     1140  int i,j,k;
     1141  poly p;
     1142  resolvente result=(ideal*)Alloc0(length*sizeof(ideal));
     1143 
     1144  for (i=0;(i<length) && !idIs0(res[i]);i++)
     1145  {
     1146    k = 0;
     1147    result[i] = idInit(IDELEMS(res[i]),res[i]->rank);
     1148    for (j=IDELEMS(res[i])-1; j>=0;j--)
     1149    {
     1150      if ((res_shape[i])[j]==0)
     1151      {
     1152        result[i]->m[k] = pCopy(res[i]->m[j]);
     1153        k++;
     1154      }
     1155    }
     1156    if (i>0)
     1157    {
     1158      for (j=IDELEMS(res[i-1])-1;j>=0;j--)
     1159      {
     1160        if ((res_shape[i-1])[j]>0)
     1161        {
     1162          k = (res_shape[i-1])[j]-1;
     1163          syReduce(result[i],res[i]->m[k],j+1);
     1164        }
     1165      }
     1166    }
     1167  }
     1168  return result;
     1169}
  • Singular/syz.h

    rc89833 r8f1473  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: syz.h,v 1.9 1998-04-29 16:28:18 Singular Exp $ */
     6/* $Id: syz.h,v 1.10 1998-09-29 21:14:46 siebert Exp $ */
    77/*
    88* ABSTRACT: Resolutions
     
    6868void syMinimizeResolvente(resolvente res, int length, int first);
    6969
     70resolvente syFastMin(resolvente res,int length);
     71
    7072intvec * syBetti(resolvente res,int length, int * regularity,
    7173                 intvec* weights=NULL);
Note: See TracChangeset for help on using the changeset viewer.