Changeset 32df82 in git


Ignore:
Timestamp:
Apr 2, 1997, 5:08:00 PM (27 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '648d28f488f6ff08f5607ff229b9ad9e4a5b93c2')
Children:
66415e17ae21ff35e3ac0a169983c4dec9b0cf98
Parents:
b47a610f465c2a5987a179e88171ece741f8d755
Message:
* hannes: removed rcsid and Log: entries,
          added assignment module=poly
          corected type conversion int->module


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

Legend:

Unmodified
Added
Removed
  • Singular/algmap.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: algmap.cc,v 1.2 1997-03-24 14:24:27 Singular Exp $";
     4/* $Id: algmap.cc,v 1.3 1997-04-02 15:06:53 Singular Exp $ */
    55/*
    66* ABSTRACT - the mapping of polynomials from rings with
  • Singular/attrib.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: attrib.cc,v 1.2 1997-03-24 14:24:30 Singular Exp $";
     4/* $Id: attrib.cc,v 1.3 1997-04-02 15:06:53 Singular Exp $ */
    55
    66/*
  • Singular/binom.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
     4/* $Id: binom.cc,v 1.3 1997-04-02 15:06:55 Singular Exp $ */
    45
    56/*
     
    1718
    1819#ifdef TEST_MAC_ORDER
    19 static char rcsid[] = "$Id: binom.cc,v 1.2 1997-03-24 14:24:32 Singular Exp $";
     20static char rcsid[] = "$Id: binom.cc,v 1.3 1997-04-02 15:06:55 Singular Exp $";
    2021
    2122extern int  pComponentOrder;
  • Singular/cntrlc.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: cntrlc.cc,v 1.4 1997-03-24 14:24:33 Singular Exp $";
     4/* $Id: cntrlc.cc,v 1.5 1997-04-02 15:06:56 Singular Exp $ */
    55/*
    66* ABSTRACT - interupt handling
  • Singular/extra.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 static char rcsid[] = "$Id: extra.cc,v 1.5 1997-03-28 21:44:26 obachman Exp $";
     4/* $Id: extra.cc,v 1.6 1997-04-02 15:06:57 Singular Exp $ */
    55/*
    66* ABSTRACT: general interface to internals of Singular ("system" command)
  • Singular/febase.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: febase.cc,v 1.5 1997-03-26 17:07:16 Singular Exp $";
     4/* $Id: febase.cc,v 1.6 1997-04-02 15:06:58 Singular Exp $ */
    55/*
    66* ABSTRACT: i/o system, handling of 'voices'
  • Singular/feread.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: feread.cc,v 1.2 1997-03-24 14:24:38 Singular Exp $";
     4/* $Id: feread.cc,v 1.3 1997-04-02 15:06:59 Singular Exp $ */
    55/*
    66* ABSTRACT: input from ttys, simulating fgets
  • Singular/ffields.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: ffields.cc,v 1.4 1997-03-26 16:31:48 obachman Exp $";
     4/* $Id: ffields.cc,v 1.5 1997-04-02 15:07:00 Singular Exp $ */
    55/*
    66* ABSTRACT: finite fields with a none-prime number of elements (via tables)
  • Singular/hdegree.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char  rcsid[] = "$Id: hdegree.cc,v 1.3 1997-03-24 14:24:42 Singular Exp $";
     4/* $Id: hdegree.cc,v 1.4 1997-04-02 15:07:01 Singular Exp $ */
    55/*
    66*  ABSTRACT -  dimension, multiplicity, HC, kbase
  • Singular/hilb.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char  rcsid[] = "$Id: hilb.cc,v 1.3 1997-03-24 14:24:43 Singular Exp $";
     4/* $Id: hilb.cc,v 1.4 1997-04-02 15:07:02 Singular Exp $ */
    55/*
    66*  ABSTRACT -  Hilbert series
  • Singular/hutil.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: hutil.cc,v 1.2 1997-03-24 14:24:44 Singular Exp $";
     4/* $Id: hutil.cc,v 1.3 1997-04-02 15:07:03 Singular Exp $ */
    55/*
    66* ABSTRACT: Utilities for staircase operations
  • Singular/ideals.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: ideals.cc,v 1.2 1997-03-24 14:24:46 Singular Exp $";
     4/* $Id: ideals.cc,v 1.3 1997-04-02 15:07:04 Singular Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
  • Singular/intvec.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 static char rcsid[] = "$Id: intvec.cc,v 1.3 1997-03-24 14:24:48 Singular Exp $";
     4/* $Id: intvec.cc,v 1.4 1997-04-02 15:07:05 Singular Exp $ */
    55/*
    66* ABSTRACT: class intvec: lists/vectors of integers
  • Singular/iparith.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: iparith.cc,v 1.13 1997-03-28 21:44:28 obachman Exp $";
     4/* $Id: iparith.cc,v 1.14 1997-04-02 15:07:07 Singular Exp $ */
    55/*
    66* ABSTRACT: table driven kernel interface, used by interpreter
  • Singular/ipassign.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Header: /exports/cvsroot-2/cvsroot/Singular/ipassign.cc,v 1.5 1997-03-27 20:23:41 obachman Exp $";
    5 /* $Log: not supported by cvs2svn $
    6 // Revision 1.4  1997/03/26  14:57:56  obachman
    7 // Wed Mar 26 14:02:15 1997  Olaf Bachmann
    8 // <obachman@ratchwum.mathematik.uni-kl.de (Olaf Bachmann)>
    9 //
    10 //      * added reference counter to links, updated slKill, slCopy, slInit
    11 //      * various small bug fixes for Batch mode
    12 //
    13 // Revision 1.2  1997/03/21  13:19:03  Singular
    14 // fixed assignment of lists, det(constants), comparision of intmats
    15 //
    16 */
     4/* $Id: ipassign.cc,v 1.6 1997-04-02 15:07:09 Singular Exp $ */
    175
    186/*
     
    348336  return FALSE;
    349337}
     338static BOOLEAN jiA_MODUL_P(leftv res, leftv a, Subexpr e)
     339{
     340  if (res->data!=NULL) idDelete((ideal*)&res->data);
     341  ideal I=idInit(1,1);
     342  I->m[0]=(poly)a->CopyD();
     343  if (I->m[0]!=NULL) pSetComp(I->m[0],1);
     344  res->data=(void *)I;
     345  return FALSE;
     346}
    350347static BOOLEAN jiA_IDEAL_M(leftv res, leftv a, Subexpr e)
    351348{
     
    452449,{jiA_MAP,      MAP_CMD,        MAP_CMD }
    453450,{jiA_IDEAL,    MODUL_CMD,      MODUL_CMD }
     451,{jiA_MODUL_P,  MODUL_CMD,      POLY_CMD }
    454452,{jiA_POLY,     POLY_CMD,       POLY_CMD }
    455453,{jiA_1x1MATRIX,POLY_CMD,       MATRIX_CMD }
  • Singular/ipconv.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: ipconv.cc,v 1.3 1997-03-28 21:44:31 obachman Exp $";
     4/* $Id: ipconv.cc,v 1.4 1997-04-02 15:07:10 Singular Exp $ */
    55/*
    66* ABSTRACT: automatic type conversions
     
    184184//  int -> matrix
    185185   { INT_CMD,         MATRIX_CMD,     iiI2Id },
    186 //  int -> module
    187    { INT_CMD,         MODUL_CMD,     iiI2Id },
    188186//  int -> intvec
    189187   { INT_CMD,         INTVEC_CMD,     iiI2Iv },
  • Singular/ipid.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Header: /exports/cvsroot-2/cvsroot/Singular/ipid.cc,v 1.3 1997-03-26 14:57:57 obachman Exp $";
    5 /* $Log: not supported by cvs2svn $
    6 // Revision 1.1.1.1  1997/03/19  13:18:42  obachman
    7 // Imported Singular sources
    8 //
    9 */
     4/* $Id: ipid.cc,v 1.4 1997-04-02 15:07:10 Singular Exp $ */
    105
    116/*
  • Singular/iplib.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: iplib.cc,v 1.2 1997-03-24 14:24:57 Singular Exp $";
     4/* $Id: iplib.cc,v 1.3 1997-04-02 15:07:11 Singular Exp $ */
    55/*
    66* ABSTRACT:
  • Singular/ipprint.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: ipprint.cc,v 1.2 1997-03-24 14:24:58 Singular Exp $";
     4/* $Id: ipprint.cc,v 1.3 1997-04-02 15:07:12 Singular Exp $ */
    55/*
    66* ABSTRACT:
  • Singular/ipshell.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: ipshell.cc,v 1.3 1997-03-24 14:25:00 Singular Exp $";
     4/* $Id: ipshell.cc,v 1.4 1997-04-02 15:07:13 Singular Exp $ */
    55/*
    66* ABSTRACT:
  • Singular/khstd.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: khstd.cc,v 1.3 1997-03-27 12:42:46 Singular Exp $";
     4/* $Id: khstd.cc,v 1.4 1997-04-02 15:07:14 Singular Exp $ */
    55/*
    66* ABSTRACT:utils for hilbert driven std
  • Singular/kstd1.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: kstd1.cc,v 1.4 1997-03-27 12:42:47 Singular Exp $";
     4/* $Id: kstd1.cc,v 1.5 1997-04-02 15:07:15 Singular Exp $ */
    55/*
    66* ABSTRACT:
  • Singular/kstd2.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: kstd2.cc,v 1.2 1997-03-24 14:25:05 Singular Exp $";
     4/* $Id: kstd2.cc,v 1.3 1997-04-02 15:07:16 Singular Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
  • Singular/kstdfac.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: kstdfac.cc,v 1.3 1997-03-26 14:37:15 Singular Exp $";
     4/* $Id: kstdfac.cc,v 1.4 1997-04-02 15:07:17 Singular Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: factorizing alg. of Buchberger
  • Singular/kutil.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: kutil.cc,v 1.2 1997-03-24 14:25:09 Singular Exp $";
     4/* $Id: kutil.cc,v 1.3 1997-04-02 15:07:19 Singular Exp $ */
    55/*
    66* ABSTRACT:
  • Singular/lists.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
     4/* $Id: lists.cc,v 1.3 1997-04-02 15:07:20 Singular Exp $ */
    45/*
    56* ABSTRACT: handling of the list type
    67*/
    7 /* $Id: lists.cc,v 1.2 1997-03-24 14:25:11 Singular Exp $ */
    88#include "mod2.h"
    99#include "tok.h"
  • Singular/longalg.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: longalg.cc,v 1.2 1997-03-24 14:25:13 Singular Exp $";
     4/* $Id: longalg.cc,v 1.3 1997-04-02 15:07:21 Singular Exp $ */
    55/*
    66* ABSTRACT:   algebraic numbers
  • Singular/longrat.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: longrat.cc,v 1.2 1997-03-24 14:25:15 Singular Exp $";
     4/* $Id: longrat.cc,v 1.3 1997-04-02 15:07:22 Singular Exp $ */
    55/*
    66* ABSTRACT: computation with long rational numbers (Hubert Grassmann)
  • Singular/longrat0.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: longrat0.cc,v 1.2 1997-03-24 14:25:18 Singular Exp $";
     4/* $Id: longrat0.cc,v 1.3 1997-04-02 15:07:23 Singular Exp $ */
    55/*
    66* ABSTRACT -
  • Singular/maps.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: maps.cc,v 1.4 1997-03-25 15:40:19 Singular Exp $";
     4/* $Id: maps.cc,v 1.5 1997-04-02 15:07:24 Singular Exp $ */
    55/*
    66* ABSTRACT - the mapping of polynomials to other rings
  • Singular/matpol.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: matpol.cc,v 1.2 1997-03-24 14:25:20 Singular Exp $";
     4/* $Id: matpol.cc,v 1.3 1997-04-02 15:07:25 Singular Exp $ */
     5
    56/*
    67* ABSTRACT:
     
    910#include <stdio.h>
    1011#include <limits.h>
     12#include <math.h>
    1113
    1214#include "mod2.h"
     
    1921#include "ipid.h"
    2022#include "subexpr.h"
     23#include "intvec.h"
    2124#include "matpol.h"
    2225
    2326/*0 implementation*/
     27
     28typedef int perm[100];
     29static poly mpDivide(poly a, poly b);
     30static void mpReplace(int j, int n, int &sign, int *perm);
     31static float mpPolyWeight(poly p);
     32static int nextperm(perm * z, int max);
     33static poly mpLeibnitz(matrix a);
     34static poly minuscopy (poly p);
     35static poly pInsert(poly p1, poly p2);
     36static poly select (poly fro, monomial what);
     37static poly exdiv ( poly m, monomial d);
    2438
    2539/*2
     
    6882matrix mpCopy (matrix a)
    6983{
    70   int i,j;
    71   matrix b;
    72   int m=MATROWS(a);
    73   int n=MATCOLS(a);
    74 
    75   b = mpNew(m, n);
    76   for (i=1; i<=m; i++)
    77   {
    78     for (j=1; j<=n; j++)
    79     {
    80       poly t=MATELEM(a,i,j);
    81       pNormalize(t);
     84  poly t;
     85  int i, m=MATROWS(a), n=MATCOLS(a);
     86  matrix b = mpNew(m, n);
     87
     88  for (i=m*n-1; i>=0; i--)
     89  {
     90    t = a->m[i];
     91    pNormalize(t);
    8292#ifdef MDEBUG
    83 //      MATELEM(b,i,j) = pDBCopy(t,f,l) ;
    84       MATELEM(b,i,j) = pCopy(t) ;
     93//    b->m[i] = pDBCopy(t,f,l);
     94    b->m[i] = pCopy(t);
    8595#else
    86       MATELEM(b,i,j) = pCopy(t) ;
     96    b->m[i] = pCopy(t);
    8797#endif
    88     }
    8998  }
    9099  b->rank=a->rank;
     
    98107{
    99108  matrix rc = mpNew(r,c);
    100   int i=min(r,c);
     109  int i=min(r,c), n = c*(i-1)+i-1, inc = c+1;
    101110
    102111  pNormalize(p);
    103   while (i>1)
    104   {
    105     MATELEM(rc,i,i)=pCopy(p);
    106     i--;
     112  while (n>0)
     113  {
     114    rc->m[n] = pCopy(p);
     115    n -= inc;
    107116  }
    108117  rc->m[0]=p;
     
    123132matrix mpMultI(matrix a, int f)
    124133{
    125   int    i, j, k = 0, n = a->rows(), m = a->cols();
     134  int k, n = a->nrows, m = a->ncols;
    126135  poly p = pISet(f);
    127136  matrix c = mpNew(n,m);
    128137
    129   for (i=0; i<n; i++)
    130   {
    131     for (j=0; j<m; j++)
    132     {
    133       c->m[k] = pMult(pCopy(a->m[k]), pCopy(p));
    134       k++;
    135     }
    136   }
    137   pDelete(&p);
     138  for (k=m*n-1; k>0; k--)
     139    c->m[k] = pMult(pCopy(a->m[k]), pCopy(p));
     140  c->m[0] = pMult(pCopy(a->m[0]), p);
    138141  return c;
    139142}
     
    144147matrix mpMultP(matrix a, poly p)
    145148{
    146   int    i, j, k = 0, n = a->rows(), m = a->cols();
     149  int k, n = a->nrows, m = a->ncols;
    147150
    148151  pNormalize(p);
    149   for (i=0; i<n; i++)
    150   {
    151     for (j=0; j<m; j++)
    152     {
    153       a->m[k] = pMult(a->m[k], pCopy(p));
    154       k++;
    155     }
    156   }
    157   pDelete(&p);
     152  for (k=m*n-1; k>0; k--)
     153    a->m[k] = pMult(a->m[k], pCopy(p));
     154  a->m[0] = pMult(a->m[0], p);
    158155  return a;
    159156}
     
    161158matrix mpAdd(matrix a, matrix b)
    162159{
    163   int    i, j, k = 0, n = a->rows(), m = a->cols();
    164   if ((n != b->rows()) || (m != b->cols()))
     160  int k, n = a->nrows, m = a->ncols;
     161  if ((n != b->nrows) || (m != b->ncols))
    165162  {
    166163/*
     
    171168  }
    172169  matrix c = mpNew(n,m);
    173   for (i=0; i<n; i++)
    174   {
    175     for (j=0; j<m; j++)
    176     {
    177       c->m[k] = pAdd(pCopy(a->m[k]), pCopy(b->m[k]));
    178       k++;
    179     }
    180   }
     170  for (k=m*n-1; k>=0; k--)
     171    c->m[k] = pAdd(pCopy(a->m[k]), pCopy(b->m[k]));
    181172  return c;
    182173}
     
    184175matrix mpSub(matrix a, matrix b)
    185176{
    186   int    i, j, k = 0, n = a->rows(), m = a->cols();
    187   if ((n != b->rows()) || (m != b->cols()))
     177  int k, n = a->nrows, m = a->ncols;
     178  if ((n != b->nrows) || (m != b->ncols))
    188179  {
    189180/*
     
    194185  }
    195186  matrix c = mpNew(n,m);
    196   for (i=0; i<n; i++)
    197   {
    198     for (j=0; j<m; j++)
    199     {
    200       c->m[k] = pSub(pCopy(a->m[k]), pCopy(b->m[k]));
    201       k++;
    202     }
    203   }
     187  for (k=m*n-1; k>=0; k--)
     188    c->m[k] = pSub(pCopy(a->m[k]), pCopy(b->m[k]));
    204189  return c;
    205190}
     
    292277}
    293278
    294 /*2
    295 * res:= a / b;  a destroyed, b NOT destroyed
    296 */
    297 static poly mpDivide(poly a, poly b)
    298 {
    299   int i, k;
    300   number x;
    301   poly res, tail, t, h, h0;
    302 
    303   res = a;
    304   tail = pNext(b);
    305   if (tail == NULL)
    306   {
    307     k = pTotaldegree(b);
    308     do
    309     {
    310       if (k!=0)
    311       {
    312         for (i=pVariables; i>0; i--)
    313           pGetExp(a,i) -= pGetExp(b,i);
    314         pSetm(a);
    315       }
    316       x = nDiv(pGetCoeff(a), pGetCoeff(b));
    317       nNormalize(x);
    318       pSetCoeff(a,x);
    319       pIter(a);
    320     } while (a != NULL);
    321     return res;
    322   }
    323   do
    324   {
    325     for (i=pVariables; i>0; i--)
    326       pGetExp(a,i) -= pGetExp(b,i);
    327     pSetm(a);
    328     x = nDiv(pGetCoeff(a), pGetCoeff(b));
    329     nNormalize(x);
    330     pSetCoeff(a,x);
    331     t = tail;
    332     h = NULL;
    333     do
    334     {
    335       if (h == NULL)
    336         h = h0 = pNew();
    337       else
    338         h = pNext(h) = pNew();
    339       for (i=pVariables; i>0; i--)
    340         pSetExp(h,i, pGetExp(a,i)+pGetExp(t,i));
    341       pSetm(h);
    342       x = nMult(pGetCoeff(a), pGetCoeff(t));
    343       pSetCoeff0(h,nNeg(x));
    344       pIter(t);
    345     } while (t != NULL);
    346     pNext(h) = NULL;
    347     pNext(a) = pAdd(pNext(a),h0);
    348     pIter(a);
    349   } while (a != NULL);
     279/*
     280* C++ classes for Bareiss algorithm
     281*/
     282class row_col_weight
     283{
     284  private:
     285  int ym, yn;
     286  public:
     287  float *wrow, *wcol;
     288  row_col_weight() : ym(0) {}
     289  row_col_weight(int, int);
     290  ~row_col_weight();
     291};
     292
     293/*2
     294*  a submatrix M of a matrix X[m,n]:
     295*    0 <= i < s_m <= a_m
     296*    0 <= j < s_n <= a_n
     297*    M = ( Xarray[qrow[i],qcol[j]] )
     298*    if a_m = a_n and s_m = s_n
     299*      det(X) = sign*div^(s_m-1)*det(M)
     300*    resticted pivot for elimination
     301*      0 <= j < piv_s
     302*/
     303class mp_permmatrix
     304{
     305  private:
     306  int       a_m, a_n, s_m, s_n, sign, piv_s;
     307  int       *qrow, *qcol;
     308  poly      *Xarray;
     309  void mpInitMat();
     310  poly * mpRowAdr(int);
     311  poly * mpColAdr(int);
     312  void mpRowWeight(float *);
     313  void mpColWeight(float *);
     314  void mpRowSwap(int, int);
     315  void mpColSwap(int, int);
     316  public:
     317  mp_permmatrix() : a_m(0) {}
     318  mp_permmatrix(matrix);
     319  mp_permmatrix(mp_permmatrix *);
     320  ~mp_permmatrix();
     321  int mpGetRdim();
     322  int mpGetCdim();
     323  int mpGetSign();
     324  void mpSetSearch(int s);
     325  void mpSaveArray();
     326  poly mpGetElem(int, int);
     327  void mpSetElem(poly, int, int);
     328  void mpDelElem(int, int);
     329  void mpElimBareiss(poly);
     330  int mpPivotBareiss(row_col_weight *);
     331  void mpToIntvec(intvec *);
     332  void mpRowReorder();
     333  void mpColReorder();
     334};
     335
     336/*2
     337*  caller of 'Bareiss' algorithm
     338*  return an list of ...
     339*/
     340matrix mpBareiss (matrix a, BOOLEAN sw)
     341{
     342  poly div;
     343  matrix c = mpCopy(a);
     344  mp_permmatrix *Bareiss = new mp_permmatrix(c);
     345  row_col_weight w(Bareiss->mpGetRdim(), Bareiss->mpGetCdim());
     346  intvec *v = new intvec(Bareiss->mpGetCdim());
     347//  lists res=(lists)Alloc(sizeof(slists));
     348
     349  if (sw) PrintS("not implemented");
     350  /* Bareiss */
     351  div = NULL;
     352  while(Bareiss->mpPivotBareiss(&w))
     353  {
     354    Bareiss->mpElimBareiss(div);
     355    div = Bareiss->mpGetElem(Bareiss->mpGetRdim(), Bareiss->mpGetCdim());
     356  }
     357  Bareiss->mpToIntvec(v);
     358  Bareiss->mpRowReorder();
     359  Bareiss->mpColReorder();
     360  Bareiss->mpSaveArray();
     361  delete Bareiss;
     362/*
     363  res->Init(2);
     364  res->m[0].rtyp=MATRIX_CMD;
     365  res->m[0].data=(void *)c;
     366  res->m[1].rtyp=INTVEC_CMD;
     367  res->m[1].data=(void *)v;
    350368  return res;
    351 }
    352 
    353 /*2
    354 * pivot strategy for Bareiss algorithm
    355 * search at all positions (qr[i],qc[j]) with
    356 *   1 <= j <= m, 1 <= i <= n and ((z[j] == 0)&&(f[i] == 0))
    357 * looks in the polynomials for
    358 *   1. minimal length
    359 *   2. minimal degree
    360 * (qr[k],qc[k]) will be the optimal position of a nonzero element
    361 * if all element are zero -> *r = 0
    362 */
    363 static void mpPivot(matrix a, int k, int *r, int *qr, int *qc)
    364 {
    365   int i, ii, j, iopt, jopt, l, lopt, d, dopt;
    366   poly p;
    367   int n = MATCOLS(a), m = MATROWS(a);
    368 
    369   lopt = INT_MAX;
    370   for(i=k; i<=m; i++)
    371   {
    372     ii = qr[i];
    373     for(j=k; j<=n; j++)
    374     {
    375       p = MATELEM(a,ii,qc[j]);
    376       if (p != NULL)
    377       {
    378         l = pLength(p);
    379         if (l<lopt)
    380         {
    381           iopt = i;
    382           jopt = j;
    383           lopt = l;
    384           dopt = pTotaldegree(p);
    385         }
    386         else if (l == lopt)
    387         {
    388           d = pTotaldegree(p);
    389           if (d < dopt)
    390           {
    391             iopt = i;
    392             jopt = j;
    393             dopt = d;
    394           }
    395         }
    396       }
    397     }
    398   }
    399   if (lopt < INT_MAX)
    400   {
    401     ii = qr[k];
    402     qr[k] = qr[iopt];
    403     qr[iopt] = ii;
    404     ii = qc[k];
    405     qc[k] = qc[jopt];
    406     qc[jopt] = ii;
    407     *r = 1;
    408   }
    409   else
    410     *r = 0;
    411 }
    412 
    413 /*2
    414 * Bareiss' algorithm is applied for backward elimination in mpBar
    415 */
    416 static matrix mpBarBack(matrix res, int *qr, int *qc, int mn)
    417 {
    418   int i, ii, i1, j, jj, j1, k;
    419   poly p1, p2, q1, q2, t, c;
    420   int n = MATCOLS(res);
    421 
    422   /* backward elimination, clean upper triangular nonzeros */
    423   c = NULL;
    424   for(k=mn; k>1; k--)
    425   {
    426     ii = qr[k];
    427     jj = qc[k];
    428     p1 = MATELEM(res,ii,jj);
    429     for (i=1; i<k; i++)
    430     {
    431       i1 = qr[i];
    432       p2 = pNeg(MATELEM(res,i1,jj));
    433       for (j=n; j>mn; j--)
    434       {
    435         j1 = qc[j];
    436         q1 = pMult(pCopy(p1),MATELEM(res,i1,j1));
    437         q2 = pMult(pCopy(MATELEM(res,ii,j1)),pCopy(p2));
    438         t = pAdd(q1, q2);
    439         if ((c != NULL) &&(t != NULL))
    440           t = mpDivide(t, c);
    441         MATELEM(res,i1,j1) = t;
    442       }
    443       for (j=1; j<k; j++)
    444       {
    445         j1 = qc[j];
    446         q1 = pMult(pCopy(p1),MATELEM(res,i1,j1));
    447         q2 = pMult(pCopy(MATELEM(res,ii,j1)),pCopy(p2));
    448         t = pAdd(q1, q2);
    449         if ((c != NULL) &&(t != NULL))
    450           t = mpDivide(t, c);
    451         MATELEM(res,i1,j1) = t;
    452       }
    453       pDelete(&(MATELEM(res,i1,jj)));
    454     }
    455     c = p1;
    456   }
    457   return res;
    458 }
    459 
    460 /*2
    461 *Bareiss' algorithm is applied to the mxn matrix a
    462 */
    463 static matrix mpBar(matrix a, int *qr, int *qc, int *ra, BOOLEAN sw)
    464 {
    465   int i, ii, i1, j, jj, j1;
    466   poly p1, p2, q1, q2, t, c;
    467   int n = MATCOLS(a),
    468       m = MATROWS(a),
    469       mn = min(m, n), k = 2;
    470   matrix res = mpCopy(a);
    471 
    472   if (mn < 2)
    473     return res;
    474   /* elimination, upper triangular structure */
    475   mpPivot(res,1,&ii,qr,qc);
    476   if (ii==0)
    477   {
    478     *ra = 0;
    479     return res;
    480   }
    481   ii = qr[1];
    482   jj = qc[1];
    483   p1 = MATELEM(res,ii,jj);
    484   for(i=m; i>1; i--)
    485   {
    486     i1 = qr[i];
    487     p2 = pNeg(MATELEM(res,i1,jj));
    488     for (j=n; j>1; j--)
    489     {
    490       j1 = qc[j];
    491       q1 = pMult(pCopy(p1),MATELEM(res,i1,j1));
    492       q2 = pMult(pCopy(MATELEM(res,ii,j1)),pCopy(p2));
    493       MATELEM(res,i1,j1) = pAdd(q1, q2);
    494     }
    495     pDelete(&(MATELEM(res,i1,jj)));
    496   }
    497   c = p1;
    498   loop
    499   {
    500     mpPivot(res,k,&ii,qr,qc);
    501     if (ii==0)
    502     {
    503       k--;
    504       break;
    505     }
    506     ii = qr[k];
    507     jj = qc[k];
    508     p1 = MATELEM(res,ii,jj);
    509     for(i=m; i>k; i--)
    510     {
    511       i1 = qr[i];
    512       p2 = pNeg(MATELEM(res,i1,jj));
    513       for (j=n; j>k; j--)
    514       {
    515         j1 = qc[j];
    516         q1 = pMult(pCopy(p1),MATELEM(res,i1,j1));
    517         q2 = pMult(pCopy(MATELEM(res,ii,j1)),pCopy(p2));
    518         t = pAdd(q1, q2);
    519         if (t != NULL)
    520           t = mpDivide(t, c);
    521         MATELEM(res,i1,j1) = t;
    522       }
    523       pDelete(&(MATELEM(res,i1,jj)));
    524     }
    525     if (k == mn)
    526       break;
    527     c = p1;
    528     k++;
    529   }
    530   *ra = k;
    531   /* backward elimination, clean upper triangular nonzeros */
    532   if (sw)
    533   {
    534     mpBarBack(res, qr, qc, k);
    535   }
    536   return res;
    537 }
    538 
    539 /*2
    540 *  caller of 'Bareiss' algorithm,
    541 *  the position of the 'pivots' is as follows:
    542 *  (qc[i], qr[i]) for i=1,..,r (r the rank of a)
    543 *  the switch sw:
    544 *    TRUE -> full elimination
    545 *    FALSE -> only upper 'tridiagonal'
    546 */
    547 matrix mpBareiss (matrix a, BOOLEAN sw)
    548 {
    549   matrix res;
    550   int *qc, *qr, r;
    551   int n = MATCOLS(a), m = MATROWS(a);
    552 
    553   qr = (int *)Alloc((m+1)*sizeof(int));
    554   qc = (int *)Alloc((n+1)*sizeof(int));
    555   for (r=m; r>0; r--)
    556     qr[r] = r;
    557   for (r=n; r>0; r--)
    558     qc[r] = r;
    559   res = mpBar(a, qr, qc, &r, sw);
    560   Free((ADDRESS)qc, (n+1)*sizeof(int));
    561   Free((ADDRESS)qr, (m+1)*sizeof(int));
    562   return res;
    563 }
    564 
    565 typedef int perm[100];
    566 
    567 static int nextperm(perm * z, int max)
    568 {
    569   int s, i, k, t;
    570   s = max;
    571   do
    572   {
    573     s--;
    574   }
    575   while ((s > 0) && ((*z)[s] >= (*z)[s+1]));
    576   if (s==0)
    577     return 0;
    578   do
    579   {
    580     (*z)[s]++;
    581     k = 0;
    582     do
    583     {
    584       k++;
    585     }
    586     while (((*z)[k] != (*z)[s]) && (k!=s));
    587   }
    588   while (k < s);
    589   for (i=s+1; i <= max; i++)
    590   {
    591     (*z)[i]=0;
    592     do
    593     {
    594       (*z)[i]++;
    595       k=0;
    596       do
    597       {
    598         k++;
    599       }
    600       while (((*z)[k] != (*z)[i]) && (k != i));
    601     }
    602     while (k < i);
    603   }
    604   s = max+1;
    605   do
    606   {
    607     s--;
    608   }
    609   while ((s > 0) && ((*z)[s] > (*z)[s+1]));
    610   t = 1;
    611   for (i=1; i<max; i++)
    612     for (k=i+1; k<=max; k++)
    613       if ((*z)[k] < (*z)[i])
    614         t = -t;
    615   (*z)[0] = t;
    616   return s;
    617 }
    618 
    619 static poly mpLeibnitz(matrix a)
    620 {
    621   int i, e, n;
    622   poly p, d;
    623   perm z;
    624 
    625   n = MATROWS(a);
    626   memset(&z,0,(n+2)*sizeof(int));
    627   p = pOne();
    628   for (i=1; i <= n; i++)
    629     p = pMult(p, pCopy(MATELEM(a, i, i)));
    630   d = p;
    631   for (i=1; i<= n; i++)
    632     z[i] = i;
    633   z[0]=1;
    634   e = 1;
    635   if (n!=1)
    636   {
    637     while (e)
    638     {
    639       e = nextperm((perm *)&z, n);
    640       p = pOne();
    641       for (i = 1; i <= n; i++)
    642         p = pMult(p, pCopy(MATELEM(a, i, z[i])));
    643       if (z[0] > 0)
    644         d = pAdd(d, p);
    645       else
    646         d = pSub(d, p);
    647     }
    648   }
    649   return d;
    650 }
    651 
    652 /*2
    653 * compute sign for determinat in Bareiss method
    654 */
    655 /*
    656 *static int mpSign(int *qc, int n)
    657 *{
    658 *  int i, j, s=1;
    659 *
    660 *  for (i=1; i<n; i++)
    661 *  {
    662 *    if (i != qc[i])
    663 *    {
    664 *      s = -s;
    665 *      j = i;
    666 *      loop
    667 *      {
    668 *        j++;
    669 *        if (i == qc[j])
    670 *       {
    671 *          qc[j] = qc[i];
    672 *          qc[i] = i;
    673 *        }
    674 *      }
    675 *    }
    676 *  }
    677 *  return s;
    678 *}
    679 */
    680 
    681 /*2
    682 * returns the determinant of the n X n matrix m;
    683 * uses Bareiss method:
    684 * if m is regular, then for the matrix a (the result of mpBar)
    685 * the determinant equals up to sign the last 'pivot'
    686 */
    687 /*
    688 *poly mpDet (matrix m)
    689 *{
    690 *  int *qc, *qr, r, s;
    691 *  int n = MATCOLS(m);
    692 *  matrix b;
    693 *  number e;
    694 *  poly res;
    695 *
    696 *  if (n != MATROWS(m))
    697 *  {
    698 *    Werror("det of %d x %d matrix",n,MATCOLS(m));
    699 *    return NULL;
    700 *  }
    701 *#ifdef SRING
    702 *  if(pSRING)
    703 *    return mpLeibnitz(m);
    704 *#endif
    705 *  qc = (int *)Alloc0((n+1)*sizeof(int));
    706 *  qr = (int *)Alloc0((n+1)*sizeof(int));
    707 *  b = mpBar(m, qc, qr, &r, FALSE);
    708 *  if (r<n)
    709 *    res = NULL;
    710 *  else
    711 *  {
    712 *    res = MATELEM(b,qr[n],qc[n]);
    713 *    MATELEM(b,qr[n],qc[n]) = NULL;
    714 *  }
    715 *  s = mpSign(qc, n);
    716 *  if (s < 0)
    717 *  {
    718 *    e = nInit(s);
    719 *    pMultN(res, e);
    720 *    nDelete(&e);
    721 *  }
    722 *  Free((ADDRESS)qc, (n+1)*sizeof(int));
    723 *  Free((ADDRESS)qr, (n+1)*sizeof(int));
    724 *  idDelete((ideal *)&b);
    725 *  return res;
    726 *}
    727 */
    728 
    729 static poly minuscopy (poly p)
    730 {
    731   poly w;
    732   number  e;
    733   e = nInit(-1);
    734   w = pCopy(p);
    735   pMultN(w, e);
    736   nDelete(&e);
    737   return w;
     369*/
     370  delete v;
     371  return c;
    738372}
    739373
     
    836470  poly p;
    837471
    838   i = binom(a->rows(),ar);
    839   j = binom(a->cols(),ar);
     472  i = binom(a->nrows,ar);
     473  j = binom(a->ncols,ar);
    840474
    841475  rowchoise=(int *)Alloc(ar*sizeof(int));
     
    844478  tmp=mpNew(ar,ar);
    845479  l = 1; /* k,l:the index in result*/
    846   idInitChoise(ar,1,a->rows(),&rowch,rowchoise);
     480  idInitChoise(ar,1,a->nrows,&rowch,rowchoise);
    847481  while (!rowch)
    848482  {
    849483    k=1;
    850     idInitChoise(ar,1,a->cols(),&colch,colchoise);
     484    idInitChoise(ar,1,a->ncols,&colch,colchoise);
    851485    while (!colch)
    852486    {
     
    862496      MATELEM(result,l,k) = p;
    863497      k++;
    864       idGetNextChoise(ar,a->cols(),&colch,colchoise);
    865     }
    866     idGetNextChoise(ar,a->rows(),&rowch,rowchoise);
     498      idGetNextChoise(ar,a->ncols,&colch,colchoise);
     499    }
     500    idGetNextChoise(ar,a->nrows,&rowch,rowchoise);
    867501    l++;
    868502  }
     
    1060694}
    1061695
    1062 /*2
    1063 * insert a monomial into a list, avoid duplicates
    1064 * arguments are destroyed
    1065 */
    1066 static poly pInsert(poly p1, poly p2)
    1067 {
    1068   static poly a1, p, a2, a;
    1069   int c;
    1070 
    1071   if (p1==NULL) return p2;
    1072   if (p2==NULL) return p1;
    1073   a1 = p1;
    1074   a2 = p2;
    1075   a = p  = pOne();
    1076   loop
    1077   {
    1078     c = pComp(a1, a2);
    1079     if (c == 1)
    1080     {
    1081       a = pNext(a) = a1;
    1082       pIter(a1);
    1083       if (a1==NULL)
    1084       {
    1085         pNext(a) = a2;
    1086         break;
    1087       }
    1088     }
    1089     else if (c == -1)
    1090     {
    1091       a = pNext(a) = a2;
    1092       pIter(a2);
    1093       if (a2==NULL)
    1094       {
    1095         pNext(a) = a1;
    1096         break;
    1097       }
    1098     }
    1099     else
    1100     {
    1101       pDelete1(&a2);
    1102       a = pNext(a) = a1;
    1103       pIter(a1);
    1104       if (a1==NULL)
    1105       {
    1106         pNext(a) = a2;
    1107         break;
    1108       }
    1109       else if (a2==NULL)
    1110       {
    1111         pNext(a) = a1;
    1112         break;
    1113       }
    1114     }
    1115   }
    1116   pDelete1(&p);
    1117   return p;
    1118 }
    1119 
    1120 /*2
    1121 *if what == xy the result is the list of all different power products
    1122 *    x^i*y^j (i, j >= 0) that appear in fro
    1123 */
    1124 static poly select (poly fro, monomial what)
    1125 {
    1126   int i;
    1127   poly h, res;
    1128   res = NULL;
    1129   while (fro!=NULL)
    1130   {
    1131     h = pOne();
    1132     for (i=1; i<=pVariables; i++)
    1133       pSetExp(h,i, pGetExp(fro,i) * what[i]);
    1134     pGetComp(h)=pGetComp(fro);
    1135     pSetm(h);
    1136     res = pInsert(h, res);
    1137     fro = fro->next;
    1138   }
    1139   return res;
    1140 }
    1141 
    1142 /*2
    1143 *exact divisor: let d  == x^i*y^j, m is thought to have only one term;
    1144 *    return m/d iff d divides m, and no x^k*y^l (k>i or l>j) divides m
    1145 */
    1146 static poly exdiv ( poly m, monomial d)
    1147 {
    1148   int i;
    1149   poly h = pHead(m);
    1150   for (i=1; i<=pVariables; i++)
    1151   {
    1152     if (d[i] > 0)
    1153     {
    1154       if (d[i] != pGetExp(h,i))
    1155       {
    1156         pDelete(&h);
    1157         return NULL;
    1158       }
    1159       pSetExp(h,i,0);
    1160     }
    1161   }
    1162   pSetm(h);
    1163   return h;
    1164 }
    1165 
    1166696matrix mpCoeffProc (poly f, poly vars)
    1167697{
     
    1302832  return TRUE;
    1303833}
     834
     835/* --------------- internal stuff ------------------- */
     836
     837row_col_weight::row_col_weight(int i, int j)
     838{
     839  ym = i;
     840  yn = j;
     841  wrow = (float *)Alloc(i*sizeof(float));
     842  wcol = (float *)Alloc(j*sizeof(float));
     843}
     844
     845row_col_weight::~row_col_weight()
     846{
     847  if (ym)
     848  {
     849    Free((ADDRESS)wcol, yn*sizeof(float));
     850    Free((ADDRESS)wrow, ym*sizeof(float));
     851  }
     852}
     853
     854mp_permmatrix::mp_permmatrix(matrix A) : sign(1)
     855{
     856  a_m = A->nrows;
     857  a_n = A->ncols;
     858  this->mpInitMat();
     859  Xarray = A->m;
     860}
     861
     862mp_permmatrix::mp_permmatrix(mp_permmatrix *M)
     863{
     864  poly p, *athis, *aM;
     865  int i, j;
     866
     867  a_m = M->s_m;
     868  a_n = M->s_n;
     869  sign = M->sign;
     870  this->mpInitMat();
     871  Xarray = (poly *)Alloc0(a_m*a_n*sizeof(poly));
     872  for (i=a_m-1; i>=0; i--)
     873  {
     874    athis = this->mpRowAdr(i);
     875    aM = M->mpRowAdr(i);
     876    for (j=a_n-1; j>=0; j--)
     877    {
     878      p = aM[M->qcol[j]];
     879      if (p)
     880      {
     881        athis[j] = pCopy(p);
     882      }
     883    }
     884  }
     885}
     886
     887mp_permmatrix::~mp_permmatrix()
     888{
     889  int k;
     890
     891  if (a_m != 0)
     892  {
     893    Free((ADDRESS)qrow,a_m*sizeof(int));
     894    Free((ADDRESS)qcol,a_n*sizeof(int));
     895    if (Xarray != NULL)
     896    {
     897      for (k=a_m*a_n-1; k>=0; k--)
     898        pDelete(&Xarray[k]);
     899      Free((ADDRESS)Xarray,a_m*a_n*sizeof(poly));
     900    }
     901  }
     902}
     903
     904int mp_permmatrix::mpGetRdim() { return s_m; }
     905
     906int mp_permmatrix::mpGetCdim() { return s_n; }
     907
     908int mp_permmatrix::mpGetSign() { return sign; }
     909
     910void mp_permmatrix::mpSetSearch(int s) { piv_s = s; }
     911
     912void mp_permmatrix::mpSaveArray() { Xarray = NULL; }
     913
     914poly mp_permmatrix::mpGetElem(int r, int c)
     915{
     916  return Xarray[a_n*qrow[r]+qcol[c]];
     917}
     918
     919void mp_permmatrix::mpSetElem(poly p, int r, int c)
     920{
     921  Xarray[a_n*qrow[r]+qcol[c]] = p;
     922}
     923
     924void mp_permmatrix::mpDelElem(int r, int c)
     925{
     926  pDelete(&Xarray[a_n*qrow[r]+qcol[c]]);
     927}
     928
     929/*
     930* the Bareiss-type elimination with division by div (div != NULL)
     931*/
     932void mp_permmatrix::mpElimBareiss(poly div)
     933{
     934  poly piv, elim, q1, q2, *ap, *a;
     935  int i, j, jj;
     936
     937  ap = this->mpRowAdr(s_m);
     938  piv = ap[qcol[s_n]];
     939  for(i=s_m-1; i>=0; i--)
     940  {
     941    a = this->mpRowAdr(i);
     942    elim = a[qcol[s_n]];
     943    if (elim != NULL)
     944    {
     945      for (j=s_n-1; j>=0; j--)
     946      {
     947        q2 = NULL;
     948        jj = qcol[j];
     949        q1 = a[jj];
     950        if (ap[jj] != NULL)
     951        {
     952          q2 = pNeg(pCopy(ap[jj]));
     953          q2 = pMult(q2, pCopy(elim));
     954          if (q1 != NULL)
     955          {
     956            q1 = pMult(q1,pCopy(piv));
     957            q2 = pAdd(q2, q1);
     958          }
     959        }
     960        else if (q1 != NULL)
     961        {
     962          q2 = pMult(q1, pCopy(piv));
     963        }
     964        if (q2 && div)
     965          q2 = mpDivide(q2, div);
     966        a[jj] = q2;
     967      }
     968      pDelete(&a[qcol[s_n]]);
     969    }
     970    else
     971    {
     972      for (j=s_n-1; j>=0; j--)
     973      {
     974        jj = qcol[j];
     975        q1 = a[jj];
     976        if (q1 != NULL)
     977        {
     978          q1 = pMult(q1, pCopy(piv));
     979          if (div)
     980            q1 = mpDivide(q1, div);
     981          a[jj] = q1;
     982        }
     983      }
     984    }
     985  }
     986}
     987
     988/*2
     989* pivot strategy for Bareiss algorithm
     990*/
     991int mp_permmatrix::mpPivotBareiss(row_col_weight *C)
     992{
     993  poly p, *a;
     994  int i, j, iopt, jopt;
     995  float f, fo, r, ro, lp;
     996  float *dr = C->wrow, *dc = C->wcol;
     997
     998  fo = 1.0e20;
     999  ro = 0.0;
     1000  iopt = jopt = -1;
     1001 
     1002  s_n--;
     1003  s_m--;
     1004  if (s_m == 0)
     1005    return 0;
     1006  if (s_n == 0)
     1007  {
     1008    for(i=s_m; i>=0; i--)
     1009    {
     1010      p = this->mpRowAdr(i)[qcol[0]];
     1011      if (p)
     1012      {
     1013        f = mpPolyWeight(p);
     1014        if (f < fo)
     1015        {
     1016          fo = f;
     1017          if (iopt >= 0)
     1018            pDelete(&(this->mpRowAdr(iopt)[qcol[0]]));
     1019          iopt = i;
     1020        }
     1021        else
     1022          pDelete(&(this->mpRowAdr(i)[qcol[0]]));
     1023      }
     1024    }
     1025    if (iopt >= 0)
     1026      mpReplace(iopt, s_m, sign, qrow);
     1027    return 0;
     1028  }
     1029  this->mpRowWeight(dr);
     1030  this->mpColWeight(dc);
     1031  for(i=s_m; i>=0; i--)
     1032  {
     1033    r = dr[i];
     1034    a = this->mpRowAdr(i);
     1035    for(j=s_n; j>=0; j--)
     1036    {
     1037      p = a[qcol[j]];
     1038      if (p)
     1039      {
     1040        lp = mpPolyWeight(p);
     1041        f = (dc[j]-lp) * (r-lp);
     1042        f = sqrt(f) * lp;
     1043        if (f < fo)
     1044        {
     1045          fo = f;
     1046          ro = r;
     1047          iopt = i;
     1048          jopt = j;
     1049        }
     1050        else if ((f == fo) && (r > ro))
     1051        {
     1052          ro = r;
     1053          iopt = i;
     1054          jopt = j;
     1055        }
     1056      }
     1057    }
     1058  }
     1059  if (iopt < 0)
     1060    return 0;
     1061  mpReplace(iopt, s_m, sign, qrow);
     1062  mpReplace(jopt, s_n, sign, qcol);
     1063  return 1;
     1064}
     1065
     1066void mp_permmatrix::mpToIntvec(intvec *v)
     1067{
     1068  int i;
     1069
     1070  for (i=v->rows()-1; i>=0; i--)
     1071    (*v)[i] = qcol[i];
     1072}
     1073
     1074void mp_permmatrix::mpRowReorder()
     1075{
     1076  int k, i, i1, i2;
     1077
     1078  if (a_m > a_n)
     1079    k = a_m - a_n;
     1080  else
     1081    k = 0;
     1082  for (i=a_m-1; i>=k; i--)
     1083  {
     1084    i1 = qrow[i];
     1085    if (i1 != i)
     1086    {
     1087      this->mpRowSwap(i1, i);
     1088      i2 = 0;
     1089      while (qrow[i2] != i) i2++;
     1090      qrow[i2] = i1;
     1091    }
     1092  }
     1093}
     1094
     1095void mp_permmatrix::mpColReorder()
     1096{
     1097  int k, j, j1, j2;
     1098
     1099  if (a_n > a_m)
     1100    k = a_n - a_m;
     1101  else
     1102    k = 0;
     1103  for (j=a_n-1; j>=k; j--)
     1104  {
     1105    j1 = qcol[j];
     1106    if (j1 != j)
     1107    {
     1108      this->mpColSwap(j1, j);
     1109      j2 = 0;
     1110      while (qcol[j2] != j) j2++;
     1111      qcol[j2] = j1;
     1112    }
     1113  }
     1114}
     1115
     1116// private
     1117void mp_permmatrix::mpInitMat()
     1118{
     1119  int k;
     1120
     1121  s_m = a_m;
     1122  s_n = a_n;
     1123  piv_s = 0;
     1124  qrow = (int *)Alloc(a_m*sizeof(int));
     1125  qcol = (int *)Alloc(a_n*sizeof(int));
     1126  for (k=a_m-1; k>=0; k--) qrow[k] = k;
     1127  for (k=a_n-1; k>=0; k--) qcol[k] = k;
     1128}
     1129
     1130poly * mp_permmatrix::mpRowAdr(int r)
     1131{
     1132  return &(Xarray[a_n*qrow[r]]);
     1133}
     1134
     1135poly * mp_permmatrix::mpColAdr(int c)
     1136{
     1137  return &(Xarray[qcol[c]]);
     1138}
     1139
     1140void mp_permmatrix::mpRowWeight(float *wrow)
     1141{
     1142  poly p, *a;
     1143  int i, j;
     1144  float count;
     1145
     1146  for (i=s_m; i>=0; i--)
     1147  {
     1148    a = this->mpRowAdr(i);
     1149    count = 0.0;
     1150    for(j=s_n; j>=0; j--)
     1151    {
     1152      p = a[qcol[j]];
     1153      if (p)
     1154        count += mpPolyWeight(p);
     1155    }
     1156    wrow[i] = count;
     1157  }
     1158}
     1159
     1160void mp_permmatrix::mpColWeight(float *wcol)
     1161{
     1162  poly p, *a;
     1163  int i, j;
     1164  float count;
     1165
     1166  for (j=s_n; j>=0; j--)
     1167  {
     1168    a = this->mpColAdr(j);
     1169    count = 0.0;
     1170    for(i=s_m; i>=0; i--)
     1171    {
     1172      p = a[a_n*qrow[i]];
     1173      if (p)
     1174        count += mpPolyWeight(p);
     1175    }
     1176    wcol[j] = count;
     1177  }
     1178}
     1179
     1180void mp_permmatrix::mpRowSwap(int i1, int i2)
     1181{
     1182   poly p, *a1, *a2;
     1183   int j;
     1184
     1185   a1 = &(Xarray[a_n*i1]);
     1186   a2 = &(Xarray[a_n*i2]);
     1187   for (j=a_n-1; j>= 0; j--)
     1188   {
     1189     p = a1[j];
     1190     a1[j] = a2[j];
     1191     a2[j] = p;
     1192   }
     1193}
     1194
     1195void mp_permmatrix::mpColSwap(int j1, int j2)
     1196{
     1197   poly p, *a1, *a2;
     1198   int i, k = a_n*a_m;
     1199
     1200   a1 = &(Xarray[j1]);
     1201   a2 = &(Xarray[j2]);
     1202   for (i=0; i< k; i+=a_n)
     1203   {
     1204     p = a1[i];
     1205     a1[i] = a2[i];
     1206     a2[i] = p;
     1207   }
     1208}
     1209
     1210/*2
     1211* exact division a/b, used in Bareiss algorithm
     1212* a destroyed, b NOT destroyed
     1213*/
     1214static poly mpDivide(poly a, poly b)
     1215{
     1216  number x, y, z;
     1217  poly r, tail, t, h, h0;
     1218  int i, deg;
     1219
     1220  r = a;
     1221  x = pGetCoeff(b);
     1222  deg = pTotaldegree(b);
     1223  tail = pNext(b);
     1224  if (tail == NULL)
     1225  {
     1226    do
     1227    {
     1228      if (deg != 0)
     1229      {
     1230        for (i=pVariables; i!=0; i--)
     1231          pGetExp(r,i) -= pGetExp(b,i);
     1232        pSetm(r);
     1233      }
     1234      y = nIntDiv(pGetCoeff(r),x);
     1235      pSetCoeff(r,y);
     1236      pIter(r);
     1237    } while (r != NULL);
     1238    return a;
     1239  }
     1240  h0 = pNew();
     1241  do
     1242  {
     1243    if (deg != 0)
     1244    {
     1245      for (i=pVariables; i>0; i--)
     1246        pGetExp(r,i) -= pGetExp(b,i);
     1247      pSetm(r);
     1248    }
     1249    y = nDiv(pGetCoeff(r), x);
     1250    nNormalize(y);
     1251    pSetCoeff(r,y);
     1252    t = tail;
     1253    h = h0;
     1254    do
     1255    {
     1256      h = pNext(h) = pNew();
     1257      for (i=pVariables; i>0; i--)
     1258        pSetExp(h,i, pGetExp(r,i)+pGetExp(t,i));
     1259      pSetm(h);
     1260      z = nMult(y, pGetCoeff(t));
     1261      pSetCoeff0(h,nNeg(z));
     1262      pIter(t);
     1263    } while (t != NULL);
     1264    pNext(h) = NULL;
     1265    r = pNext(r) = pAdd(pNext(r),pNext(h0));
     1266  } while (r!=NULL);
     1267  pFree1(h0);
     1268  return a;
     1269}
     1270
     1271/*
     1272* perform replacement for pivot strategy in Bareiss algorithm
     1273* change sign of determinant
     1274*/
     1275static void mpReplace(int j, int n, int &sign, int *perm)
     1276{
     1277  int k;
     1278
     1279  if (j != n)
     1280  {
     1281    k = perm[n];
     1282    perm[n] = perm[j];
     1283    perm[j] = k;
     1284    sign = -sign;
     1285  }
     1286}
     1287
     1288/*
     1289* weigth of a polynomial, for pivot strategy
     1290* modify this for characteristic 0 !!!
     1291*/
     1292static float mpPolyWeight(poly p)
     1293{
     1294  return (float)pLength(p);
     1295}
     1296
     1297static int nextperm(perm * z, int max)
     1298{
     1299  int s, i, k, t;
     1300  s = max;
     1301  do
     1302  {
     1303    s--;
     1304  }
     1305  while ((s > 0) && ((*z)[s] >= (*z)[s+1]));
     1306  if (s==0)
     1307    return 0;
     1308  do
     1309  {
     1310    (*z)[s]++;
     1311    k = 0;
     1312    do
     1313    {
     1314      k++;
     1315    }
     1316    while (((*z)[k] != (*z)[s]) && (k!=s));
     1317  }
     1318  while (k < s);
     1319  for (i=s+1; i <= max; i++)
     1320  {
     1321    (*z)[i]=0;
     1322    do
     1323    {
     1324      (*z)[i]++;
     1325      k=0;
     1326      do
     1327      {
     1328        k++;
     1329      }
     1330      while (((*z)[k] != (*z)[i]) && (k != i));
     1331    }
     1332    while (k < i);
     1333  }
     1334  s = max+1;
     1335  do
     1336  {
     1337    s--;
     1338  }
     1339  while ((s > 0) && ((*z)[s] > (*z)[s+1]));
     1340  t = 1;
     1341  for (i=1; i<max; i++)
     1342    for (k=i+1; k<=max; k++)
     1343      if ((*z)[k] < (*z)[i])
     1344        t = -t;
     1345  (*z)[0] = t;
     1346  return s;
     1347}
     1348
     1349static poly mpLeibnitz(matrix a)
     1350{
     1351  int i, e, n;
     1352  poly p, d;
     1353  perm z;
     1354
     1355  n = MATROWS(a);
     1356  memset(&z,0,(n+2)*sizeof(int));
     1357  p = pOne();
     1358  for (i=1; i <= n; i++)
     1359    p = pMult(p, pCopy(MATELEM(a, i, i)));
     1360  d = p;
     1361  for (i=1; i<= n; i++)
     1362    z[i] = i;
     1363  z[0]=1;
     1364  e = 1;
     1365  if (n!=1)
     1366  {
     1367    while (e)
     1368    {
     1369      e = nextperm((perm *)&z, n);
     1370      p = pOne();
     1371      for (i = 1; i <= n; i++)
     1372        p = pMult(p, pCopy(MATELEM(a, i, z[i])));
     1373      if (z[0] > 0)
     1374        d = pAdd(d, p);
     1375      else
     1376        d = pSub(d, p);
     1377    }
     1378  }
     1379  return d;
     1380}
     1381
     1382static poly minuscopy (poly p)
     1383{
     1384  poly w;
     1385  number  e;
     1386  e = nInit(-1);
     1387  w = pCopy(p);
     1388  pMultN(w, e);
     1389  nDelete(&e);
     1390  return w;
     1391}
     1392
     1393/*2
     1394* insert a monomial into a list, avoid duplicates
     1395* arguments are destroyed
     1396*/
     1397static poly pInsert(poly p1, poly p2)
     1398{
     1399  poly a1, p, a2, a;
     1400  int c;
     1401
     1402  if (p1==NULL) return p2;
     1403  if (p2==NULL) return p1;
     1404  a1 = p1;
     1405  a2 = p2;
     1406  a = p  = pOne();
     1407  loop
     1408  {
     1409    c = pComp(a1, a2);
     1410    if (c == 1)
     1411    {
     1412      a = pNext(a) = a1;
     1413      pIter(a1);
     1414      if (a1==NULL)
     1415      {
     1416        pNext(a) = a2;
     1417        break;
     1418      }
     1419    }
     1420    else if (c == -1)
     1421    {
     1422      a = pNext(a) = a2;
     1423      pIter(a2);
     1424      if (a2==NULL)
     1425      {
     1426        pNext(a) = a1;
     1427        break;
     1428      }
     1429    }
     1430    else
     1431    {
     1432      pDelete1(&a2);
     1433      a = pNext(a) = a1;
     1434      pIter(a1);
     1435      if (a1==NULL)
     1436      {
     1437        pNext(a) = a2;
     1438        break;
     1439      }
     1440      else if (a2==NULL)
     1441      {
     1442        pNext(a) = a1;
     1443        break;
     1444      }
     1445    }
     1446  }
     1447  pDelete1(&p);
     1448  return p;
     1449}
     1450
     1451/*2
     1452*if what == xy the result is the list of all different power products
     1453*    x^i*y^j (i, j >= 0) that appear in fro
     1454*/
     1455static poly select (poly fro, monomial what)
     1456{
     1457  int i;
     1458  poly h, res;
     1459  res = NULL;
     1460  while (fro!=NULL)
     1461  {
     1462    h = pOne();
     1463    for (i=1; i<=pVariables; i++)
     1464      pSetExp(h,i, pGetExp(fro,i) * what[i]);
     1465    pGetComp(h)=pGetComp(fro);
     1466    pSetm(h);
     1467    res = pInsert(h, res);
     1468    fro = fro->next;
     1469  }
     1470  return res;
     1471}
     1472
     1473/*2
     1474*exact divisor: let d  == x^i*y^j, m is thought to have only one term;
     1475*    return m/d iff d divides m, and no x^k*y^l (k>i or l>j) divides m
     1476*/
     1477static poly exdiv ( poly m, monomial d)
     1478{
     1479  int i;
     1480  poly h = pHead(m);
     1481  for (i=1; i<=pVariables; i++)
     1482  {
     1483    if (d[i] > 0)
     1484    {
     1485      if (d[i] != pGetExp(h,i))
     1486      {
     1487        pDelete(&h);
     1488        return NULL;
     1489      }
     1490      pSetExp(h,i,0);
     1491    }
     1492  }
     1493  pSetm(h);
     1494  return h;
     1495}
     1496
  • Singular/matpol.h

    rb47a61 r32df82  
    2020  inline int& rows() { return nrows; }
    2121  inline int& cols() { return ncols; }
    22   inline poly& elem(int i, int j) { return m[cols() * i + j]; }
    23 //  friend matrix operator +(ip_smatrix * a, ip_smatrix * b);
    2422
    2523  #define MATROWS(i) ((i)->nrows)
  • Singular/misc.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: misc.cc,v 1.3 1997-03-27 20:23:42 obachman Exp $";
     4/* $Id: misc.cc,v 1.4 1997-04-02 15:07:27 Singular Exp $ */
    55/*
    66* ABSTRACT:
  • Singular/mmalloc.c

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Header: /exports/cvsroot-2/cvsroot/Singular/mmalloc.c,v 1.1.1.1 1997-03-19 13:18:57 obachman Exp $";
    5 /* $Log: not supported by cvs2svn $
    6 */
     4/* $Id: mmalloc.c,v 1.2 1997-04-02 15:07:28 Singular Exp $ */
    75
    86/*
  • Singular/mmheap.c

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Header: /exports/cvsroot-2/cvsroot/Singular/mmheap.c,v 1.1.1.1 1997-03-19 13:18:58 obachman Exp $";
    5 /* $Log: not supported by cvs2svn $
    6 */
     4/* $Id: mmheap.c,v 1.2 1997-04-02 15:07:32 Singular Exp $ */
    75
    86/*
  • Singular/mminit.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: mminit.cc,v 1.2 1997-03-24 14:25:24 Singular Exp $";
     4/* $Id: mminit.cc,v 1.3 1997-04-02 15:07:32 Singular Exp $ */
    55/*
    66* ABSTRACT:
  • Singular/modulop.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: modulop.cc,v 1.2 1997-03-24 14:25:26 Singular Exp $";
     4/* $Id: modulop.cc,v 1.3 1997-04-02 15:07:35 Singular Exp $ */
    55/*
    66* ABSTRACT:
  • Singular/mpsr_Error.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
     4/* $Id: mpsr_Error.cc,v 1.4 1997-04-02 15:07:36 Singular Exp $ */
    45
    56/***************************************************************
  • Singular/mpsr_Get.cc

    rb47a61 r32df82  
     1/****************************************
     2*  Computer Algebra System SINGULAR     *
     3****************************************/
     4
     5/* $Id: mpsr_Get.cc,v 1.6 1997-04-02 15:07:37 Singular Exp $ */
    16/***************************************************************
    27 *
  • Singular/mpsr_GetMisc.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
     4/* $Id: mpsr_GetMisc.cc,v 1.4 1997-04-02 15:07:38 Singular Exp $ */
    45
    56/***************************************************************
  • Singular/mpsr_GetPoly.cc

    rb47a61 r32df82  
     1/****************************************
     2*  Computer Algebra System SINGULAR     *
     3****************************************/
     4
     5/* $Id: mpsr_GetPoly.cc,v 1.4 1997-04-02 15:07:39 Singular Exp $ */
     6
    17/***************************************************************
    28 *
  • Singular/mpsr_Put.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
     4/* $Id: mpsr_Put.cc,v 1.5 1997-04-02 15:07:40 Singular Exp $ */
     5
    46
    57/***************************************************************
  • Singular/mpsr_PutPoly.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
     4
     5/* $Id: mpsr_PutPoly.cc,v 1.4 1997-04-02 15:07:41 Singular Exp $ */
    46
    57/***************************************************************
  • Singular/mpsr_Timer.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
     4
     5/* $Id: mpsr_Timer.cc,v 1.3 1997-04-02 15:07:42 Singular Exp $ */
    46
    57/***************************************************************
  • Singular/mpsr_Tok.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
     4
     5/* $Id: mpsr_Tok.cc,v 1.6 1997-04-02 15:07:43 Singular Exp $ */
    46
    57/***************************************************************
  • Singular/numbers.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 static char rcsid[] = "$Id: numbers.cc,v 1.2 1997-03-24 14:25:34 Singular Exp $";
     4/* $Id: numbers.cc,v 1.3 1997-04-02 15:07:43 Singular Exp $ */
     5
    56/*
    67* ABSTRACT: interface to coefficient aritmetics
  • Singular/polys.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: polys.cc,v 1.2 1997-03-24 14:25:36 Singular Exp $";
     4/* $Id: polys.cc,v 1.3 1997-04-02 15:07:44 Singular Exp $ */
     5
    56/*
    67* ABSTRACT - all basic methods to manipulate polynomials
  • Singular/polys0.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: polys0.cc,v 1.2 1997-03-24 14:25:38 Singular Exp $";
     4/* $Id: polys0.cc,v 1.3 1997-04-02 15:07:45 Singular Exp $ */
     5
    56/*
    67* ABSTRACT - all basic methods to convert polynomials to strings
  • Singular/polys1.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: polys1.cc,v 1.2 1997-03-24 14:25:39 Singular Exp $";
     4/* $Id: polys1.cc,v 1.3 1997-04-02 15:07:46 Singular Exp $ */
     5
    56/*
    67* ABSTRACT - all basic methods to manipulate polynomials:
  • Singular/ring.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: ring.cc,v 1.3 1997-03-27 12:42:48 Singular Exp $";
     4/* $Id: ring.cc,v 1.4 1997-04-02 15:07:48 Singular Exp $ */
     5
    56/*
    67* ABSTRACT - the interpreter related ring operations
  • Singular/shortfl.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: shortfl.cc,v 1.2 1997-03-24 14:25:44 Singular Exp $";
     4/* $Id: shortfl.cc,v 1.3 1997-04-02 15:07:49 Singular Exp $ */
     5
    56/*
    67* ABSTRACT:
  • Singular/silink.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
     4/* $Id: silink.cc,v 1.6 1997-04-02 15:07:50 Singular Exp $ */
     5
    46/*
    57* ABSTRACT
    6 */
    7 /* $Log: not supported by cvs2svn $
    8 // Revision 1.4  1997/03/28  21:44:36  obachman
    9 // Fri Mar 28 14:12:05 1997  Olaf Bachmann
    10 // <obachman@ratchwum.mathematik.uni-kl.de (Olaf Bachmann)>
    11 //
    12 //      * Added routines dump(link) and getdump(link) for ascii and MP
    13 //        links
    14 //
    15 //      * ipconv.cc (dConvertTypes): added int->module conversion so that
    16 //        'module m = 0' works
    17 //
    18 //      * iparith.cc (jjVAR1): added LINK_CMD to list of typeof(...)
    19 //
    20 // Revision 1.3  1997/03/26  14:58:02  obachman
    21 // Wed Mar 26 14:02:15 1997  Olaf Bachmann
    22 // <obachman@ratchwum.mathematik.uni-kl.de (Olaf Bachmann)>
    23 //
    24 //      * added reference counter to links, updated slKill, slCopy, slInit
    25 //      * various small bug fixes for Batch mode
    26 //
    27 // Revision 1.1.1.1  1997/03/19  13:18:42  obachman
    28 // Imported Singular sources
    29 //
    308*/
    319
  • Singular/silink.h

    rb47a61 r32df82  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
     6/* $Id: silink.h,v 1.5 1997-04-02 15:07:51 Singular Exp $ */
    67/*
    78* ABSTRACT
    8 */
    9 /* $Log: not supported by cvs2svn $
    10  * Revision 1.3  1997/03/26  14:58:03  obachman
    11  * Wed Mar 26 14:02:15 1997  Olaf Bachmann
    12  * <obachman@ratchwum.mathematik.uni-kl.de (Olaf Bachmann)>
    13  *
    14  *      * added reference counter to links, updated slKill, slCopy, slInit
    15  *      * various small bug fixes for Batch mode
    16  *
    17  * Revision 1.1.1.1  1997/03/19  13:18:41  obachman
    18  * Imported Singular sources
    19  *
    209*/
    2110
  • Singular/sing_dld.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 static char rcsid[] = "$Id: sing_dld.cc,v 1.2 1997-03-24 14:25:48 Singular Exp $";
     4/* $Id: sing_dld.cc,v 1.3 1997-04-02 15:07:51 Singular Exp $ */
     5
    56/*
    67* ABSTRACT: interface to dynamic loading
  • Singular/sing_mp.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
     4/* $Id: sing_mp.cc,v 1.6 1997-04-02 15:07:52 Singular Exp $ */
     5
    46/*
    57* ABSTRACT
    6 */
    7 /* $Log: not supported by cvs2svn $
    8 // Revision 1.4  1997/03/26  14:58:05  obachman
    9 // Wed Mar 26 14:02:15 1997  Olaf Bachmann
    10 // <obachman@ratchwum.mathematik.uni-kl.de (Olaf Bachmann)>
    11 //
    12 //      * added reference counter to links, updated slKill, slCopy, slInit
    13 //      * various small bug fixes for Batch mode
    14 //
    15 // Revision 1.2  1997/03/20  16:59:58  obachman
    16 // Various minor bug-fixes in mpsr interface
    17 //
    18 // Thu Mar 20 11:57:00 1997  Olaf Bachmann  <obachman@schlupp.mathematik.uni-kl.de (Olaf Bachmann)>
    19 //
    20 //      * sing_mp.cc (slInitBatchLink): initialized silink such that
    21 //        l->argv[0] == "MP:connect" (otherwise, slInitMP failed)
    22 //
    23 // Wed Mar 19 15:38:08 1997  Olaf Bachmann  <obachman@schlupp.mathematik.uni-kl.de (Olaf Bachmann)>
    24 //
    25 //      * hannes fixed maFindPerm to reflect new names <->parameter scheme
    26 //
    27 //      * sing_mp.cc (mpsr_IsMPLink): fixed it
    28 //
    29 //      * Makefile (tags): added target tags
    30 //
    31 // Revision 1.1.1.1  1997/03/19  13:18:41  obachman
    32 // Imported Singular sources
    33 //
    348*/
    359
  • Singular/spolys.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char  rcsid[] = "$Id: spolys.cc,v 1.2 1997-03-24 14:25:52 Singular Exp $";
     4/* $Id: spolys.cc,v 1.3 1997-04-02 15:07:53 Singular Exp $ */
     5
    56/*
    67* ABSTRACT - s-polynomials and reduction for char p
  • Singular/spolys0.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char  rcsid[] = "$Id: spolys0.cc,v 1.2 1997-03-24 14:25:54 Singular Exp $";
     4/* $Id: spolys0.cc,v 1.3 1997-04-02 15:07:54 Singular Exp $ */
     5
    56/*
    67* ABSTRACT - s-polynomials and reduction in general
  • Singular/subexpr.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Header: /exports/cvsroot-2/cvsroot/Singular/subexpr.cc,v 1.9 1997-03-27 20:26:03 obachman Exp $";
    5 /* $Log: not supported by cvs2svn $
    6 // Revision 1.8  1997/03/27  12:42:50  Singular
    7 // * hannes: added rString, sleftv->String for RING_CMD, QRING_CMD,
    8 //             string(ring), string(qring) in iparith.cc
    9 //             TEST_OPT_PROT for hilbert driven std
    10 //
    11 // Revision 1.7  1997/03/26  17:07:27  Singular
    12 // * hannes/wichmann: added fglm
    13 //
    14 // Revision 1.6  1997/03/26  14:58:06  obachman
    15 // Wed Mar 26 14:02:15 1997  Olaf Bachmann
    16 // <obachman@ratchwum.mathematik.uni-kl.de (Olaf Bachmann)>
    17 //
    18 //      * added reference counter to links, updated slKill, slCopy, slInit
    19 //      * various small bug fixes for Batch mode
    20 //
    21 // Revision 1.4  1997/03/21  14:58:56  obachman
    22 // Fixed little bugs in sleftv::Eval and mpsr_GetMisc
    23 //
    24 // Revision 1.3  1997/03/21  14:06:52  Singular
    25 // * hannes: changed return value for Eval(assignment) to 'nothing'
    26 //
    27 // Revision 1.2  1997/03/21  13:19:05  Singular
    28 // fixed assignment of lists, det(constants), comparision of intmats
    29 //
    30 */
     4/* $Id: subexpr.cc,v 1.10 1997-04-02 15:07:55 Singular Exp $ */
    315
    326/*
  • Singular/syz.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: syz.cc,v 1.2 1997-03-24 14:26:01 Singular Exp $";
     4/* $Id: syz.cc,v 1.3 1997-04-02 15:07:56 Singular Exp $ */
     5
    56/*
    67* ABSTRACT: resolutions
  • Singular/syz0.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: syz0.cc,v 1.2 1997-03-24 14:26:02 Singular Exp $";
     4/* $Id: syz0.cc,v 1.3 1997-04-02 15:07:57 Singular Exp $ */
     5
    56/*
    67* ABSTRACT: resolutions
  • Singular/tesths.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: tesths.cc,v 1.4 1997-03-27 20:26:04 obachman Exp $";
     4/* $Id: tesths.cc,v 1.5 1997-04-02 15:07:58 Singular Exp $ */
     5
    56/*
    67* ABSTRACT - initialize SINGULARs components, run Script and start SHELL
     
    1819#include <stdlib.h>
    1920#include <time.h>
     21#include <errno.h>
    2022
    2123#include "mod2.h"
  • Singular/timer.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: timer.cc,v 1.5 1997-03-28 21:44:40 obachman Exp $";
     4/* $Id: timer.cc,v 1.6 1997-04-02 15:07:59 Singular Exp $ */
     5
    56/*
    67*  ABSTRACT - get the computing time
  • Singular/weight.cc

    rb47a61 r32df82  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Id: weight.cc,v 1.2 1997-03-24 14:26:08 Singular Exp $";
     4/* $Id: weight.cc,v 1.3 1997-04-02 15:08:00 Singular Exp $ */
     5
    56/*
    67* ABSTRACT:
Note: See TracChangeset for help on using the changeset viewer.