Changeset d8b0f69 in git for Singular


Ignore:
Timestamp:
Feb 28, 2012, 7:14:51 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
f323dd1d5224b28e86385dbae25bbc736620b24c
Parents:
52d4806a5a94e095e70d7f1fb00cc88836d13e0f8db30eef10dd120583257c43df0c2cb4d8cbd028
Message:
Merge pull request #76 from mmklee/factory_libfac_sw

chg: use libfac's neworder if we have libfac
Location:
Singular
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    r52d480 rd8b0f69  
    984984      if(strcmp(sys_cmd,"neworder")==0)
    985985      {
    986 #if 1
     986#if defined(HAVE_LIBFAC)
     987        if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
     988        {
     989          res->rtyp=STRING_CMD;
     990          res->data=(void *)singclap_neworder((ideal)h->Data(), currRing);
     991          return FALSE;
     992        }
     993        else
     994          WerrorS("ideal expected");
     995#else
    987996  Werror("Sorry: not yet re-factored: see libpolys/polys/clapsing.cc");
    988997  return FALSE;
    989 #else
    990         if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
    991         {
    992           res->rtyp=STRING_CMD;
    993           res->data=(void *)singclap_neworder((ideal)h->Data(), currRing);
    994           return FALSE;
    995         }
    996         else
    997           WerrorS("ideal expected");
    998998#endif
    999999      }
  • Singular/ipassign.cc

    r8db30e rd8b0f69  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id$ */
    5 
    64/*
    75* ABSTRACT: interpreter:
     
    189187    WarnS("Set minpoly over non-transcendental ground field to 0?!");
    190188#endif
    191     return FALSE;   
    192   }
    193    
    194    
     189    return FALSE;
     190  }
     191
     192
    195193  if ( !nCoeff_is_transExt(currRing->cf) )
    196194  {
     
    204202  {
    205203//    return TRUE;
    206 #ifndef NDEBUG     
     204#ifndef NDEBUG
    207205    idhdl p = currRing->idroot;
    208206
     
    213211      Print(p->String(TRUE)); PrintLn();
    214212      p = p->next;
    215     }   
     213    }
    216214#endif
    217215  }
    218216
    219217  assume (currRing->idroot==NULL);
    220  
     218
    221219  number p = (number)a->CopyD(NUMBER_CMD);
    222220
     
    225223    n_Delete(&p, currRing);
    226224
    227    
     225
    228226    if( nCoeff_is_transExt(currRing->cf) )
    229227    {
    230 #ifndef NDEBUG     
     228#ifndef NDEBUG
    231229      WarnS("minpoly is already 0...");
    232230#endif
     
    235233
    236234    WarnS("cannot set minpoly to 0 / alg. extension?");
    237    
     235
    238236//    return TRUE;
    239237  }
     
    247245    killhdl2(currRing->idroot,&(currRing->idroot),currRing);
    248246  }
    249  
     247
    250248  n_Normalize(p, currRing->cf);
    251249
    252250  AlgExtInfo A;
    253  
     251
    254252  A.r = currRing->cf->extRing; // Use the same ground field!
    255253  A.i = idInit(1,1);
    256254
    257255  assume( DEN((fractionObject *)(p)) == NULL ); // minpoly must be a poly...!?
    258  
     256
    259257  A.i->m[0] = NUM((fractionObject *)p);
    260258
     
    268266
    269267  NUM((fractionObject *)p) = NULL; n_Delete(&p, currRing->cf);
    270  
     268
    271269  coeffs new_cf = nInitChar(n_algExt, &A);
    272  
     270
    273271  if (new_cf==NULL)
    274272  {
     
    692690  if (rField_is_Ring(currRing))
    693691  {
    694     int constIndex = idPosConstant(id);
    695     if (constIndex != -1)
    696     WerrorS("ideal contains constant; please modify ground field/ring instead");
    697     return TRUE;
     692    if (idPosConstant(id) != -1)
     693    {
     694      WerrorS("constant in q-ideal; please modify ground field/ring instead");
     695      return TRUE;
     696    }
    698697  }
    699698#endif
     
    17481747      {
    17491748        case IDEAL_CMD:
    1750         case MODUL_CMD:
     1749        case MODUL_CMD:
    17511750        {
    17521751          ideal F=idInit(1,1);
  • Singular/ssiLink.cc

    r8db30e rd8b0f69  
    55 * File:    ssiLink.h
    66 *  Purpose: declaration of sl_link routines for ssi
    7  *  Version: $Id$
    87 ***************************************************************/
    98#include <stdio.h>
     
    6564//#endif
    6665
    67 #define SSI_VERSION 2
     66#define SSI_VERSION 3
    6867
    6968typedef struct
     
    220219  {
    221220    fprintf(d->f_write,"%d %d %d ",r->order[i],r->block0[i], r->block1[i]);
     221    switch(r->order[i])
     222    {
     223      case ringorder_a:
     224      case ringorder_wp:
     225      case ringorder_Wp:
     226      case ringorder_ws:
     227      case ringorder_Ws:
     228      case ringorder_aa:
     229      {
     230        int ii;
     231        for(ii=r->block0[i];ii<=r->block1[i];ii++)
     232          fprintf(d->f_write,"%d ",r->wvhdl[i][ii-r->block0[i]]);
     233      }
     234      break;
     235      case ringorder_a64:
     236      case ringorder_M:
     237      case ringorder_L:
     238      case ringorder_IS:
     239        Werror("ring oder not implemented for ssi:%d",r->order[i]);
     240        break;
     241
     242      default: break;
     243    }
    222244    i++;
    223245  }
     
    469491  int *block1=(int *)omAlloc0((num_ord+1)*sizeof(int));
    470492  SSI_BLOCK_CHLD;
     493  int **wvhdl=(int**)omAlloc0((num_ord+1)*sizeof(int*));
    471494  for(i=0;i<num_ord;i++)
    472495  {
    473      fscanf(d->f_read,"%d %d %d",&ord[i],&block0[i],&block1[i]);
    474   }
    475   SSI_UNBLOCK_CHLD;
    476   return rDefault(ch,N,names,num_ord,ord,block0,block1);
     496    fscanf(d->f_read,"%d %d %d",&ord[i],&block0[i],&block1[i]);
     497    switch(ord[i])
     498    {
     499      case ringorder_a:
     500      case ringorder_wp:
     501      case ringorder_Wp:
     502      case ringorder_ws:
     503      case ringorder_Ws:
     504      case ringorder_aa:
     505      {
     506        wvhdl[i]=(int*)omAlloc((block1[i]-block0[i]+1)*sizeof(int));
     507        int ii;
     508        for(ii=block0[i];ii<=block1[i];ii++)
     509          fscanf(d->f_read,"%d",&(wvhdl[i][ii-block0[i]]));
     510      }
     511      break;
     512
     513      case ringorder_a64:
     514      case ringorder_M:
     515      case ringorder_L:
     516      case ringorder_IS:
     517        Werror("ring oder not implemented for ssi:%d",ord[i]);
     518        break;
     519
     520      default: break;
     521    }
     522  }
     523  SSI_UNBLOCK_CHLD;
     524  return rDefault(ch,N,names,num_ord,ord,block0,block1,wvhdl);
    477525}
    478526
     
    922970        struct sockaddr_in serv_addr;
    923971        struct hostent *server;
    924  
     972
    925973        sscanf(l->name,"%255[^:]:%d",host,&portno);
    926974        //Print("connect to host %s, port %d\n",host,portno);mflush();
     
    945993          d->fd_write=sockfd;
    946994          SI_LINK_SET_RW_OPEN_P(l);
    947           d->send_quit_at_exit=1;
     995          d->send_quit_at_exit=1;
    948996          omFree(host);
    949997        }
     
    9611009        FILE *outfile;
    9621010        char *filename=l->name;
    963  
     1011
    9641012        if(filename[0]=='>')
    9651013        {
     
    10311079        }
    10321080        if (d->send_quit_at_exit)
    1033         { 
     1081        {
    10341082          fputs("99\n",d->f_write);fflush(d->f_write);
    10351083        }
     
    14181466
    14191467  /* check the links and fill in fdmask */
     1468  /* check ssi links for ungetc_buf */
    14201469  for(i=L->nr; i>=0; i--)
    14211470  {
     
    14401489        d=(ssiInfo*)l->data;
    14411490        d_fd=d->fd_read;
     1491        if (d->ungetc_buf=='\0')
     1492        {
     1493          FD_SET(d_fd, &fdmask);
     1494          if (d_fd > max_fd) max_fd=d_fd;
     1495        }
     1496        else
     1497          return i+1;
    14421498      }
    14431499      else
     
    14451501        dd=(MP_Link_pt)l->data;
    14461502        d_fd=((MP_TCP_t *)dd->transp.private1)->sock;
     1503        FD_SET(d_fd, &fdmask);
     1504        if (d_fd > max_fd) max_fd=d_fd;
    14471505      }
    14481506    #else
    14491507      d=(ssiInfo*)l->data;
    14501508      d_fd=d->fd_read;
     1509      if (d->ungetc_buf=='\0')
     1510      {
     1511        FD_SET(d_fd, &fdmask);
     1512        if (d_fd > max_fd) max_fd=d_fd;
     1513      }
     1514      else
     1515        return i+1;
    14511516    #endif
    1452       FD_SET(d_fd, &fdmask);
    1453       if (d_fd > max_fd) max_fd=d_fd;
    14541517    }
    14551518  }
     
    15161579    }
    15171580    // only ssi links:
    1518     if (d->ungetc_buf) return i+1;
    15191581    loop
    15201582    {
Note: See TracChangeset for help on using the changeset viewer.