Changeset 4d22d3 in git


Ignore:
Timestamp:
Nov 29, 2010, 1:27:32 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
af71455603162123e6412ac27852bb08ea8f5126
Parents:
9b3de5f869ff6e2bd56ac42abe6a8bf462e8153b
Message:
intvec for ssiLink

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

Legend:

Unmodified
Added
Removed
  • Singular/ssiLink.cc

    r9b3de5 r4d22d3  
    3232#include <kernel/longrat.h>
    3333#include <kernel/ideals.h>
     34#include <kernel/intvec.h>
    3435#include "subexpr.h"
    3536#include "silink.h"
     
    248249  {
    249250    ssiWrite(l,&(dd->m[i]));
     251  }
     252}
     253void ssiWriteIntvec(ssiInfo *d,intvec * v)
     254{
     255  fprintf(d->f_write,"%d ",v->length());
     256  int i;
     257  for(i=0;i<v->length();i++)
     258  {
     259    fprintf(d->f_write,"%d ",(*v)[i]);
    250260  }
    251261}
     
    505515  return L;
    506516}
     517intvec* ssiReadIntvec(ssiInfo *d)
     518{
     519  int nr;
     520  fscanf(d->f_read,"%d",&nr);
     521  intvec *v=new intvec(nr);
     522  for(int i=0;i<nr;i++)
     523  {
     524    fscanf(d->f_read,"%d",&((*v)[i]));
     525  }
     526  return v;
     527}
    507528
    508529//**************************************************************************/
     
    549570      {
    550571        link_list hh=(link_list)ssiToBeClosed->next;
    551         /* we know: l is the first entry in ssiToBeClosed-list */
     572        /* we know: l is the first entry in ssiToBeClosed-list */
    552573        while(hh!=NULL)
    553574        {
     
    559580          hh->l->data=NULL;
    560581          SI_LINK_SET_CLOSE_P(hh->l);
    561           link_list nn=(link_list)hh->next;
    562           omFree(hh);
    563           hh=nn;
     582          link_list nn=(link_list)hh->next;
     583          omFree(hh);
     584          hh=nn;
    564585        }
    565         ssiToBeClosed->next=NULL;
     586        ssiToBeClosed->next=NULL;
    566587        close(pc[1]); close(cp[0]);
    567588        d->f_read=fdopen(pc[0],"r");
     
    935956    case 16: res->rtyp=NONE; res->data=NULL;
    936957             break;
     958    case 17: res->rtyp=INTVEC_CMD;
     959             res->data=ssiReadIntvec(d);
     960             break;
    937961    case 99: ssiClose(l); exit(0);
    938962    case 0: if (feof(d->f_read))
     
    10311055                   ssiWriteList(l,(lists)dd);
    10321056                   break;
     1057          case INTVEC_CMD:
     1058                   fprintf(d->f_write,"17 ");
     1059                   ssiWriteIntvec(d,(intvec *)dd);
     1060                   break;
    10331061          default: Werror("not implemented (t:%d, rtyp:%d)",tt, data->rtyp);
    10341062                   d->level=0;
     
    12231251// 15 setring .......
    12241252// 16 nothing
     1253// 17 intvec <len> ...
    12251254//
    12261255// 99: quit Singular
Note: See TracChangeset for help on using the changeset viewer.