Changeset 63374c in git


Ignore:
Timestamp:
Jul 9, 1999, 4:06:52 PM (24 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
Children:
609ba11e29d4d3c44b5785da0728121bbc8e0065
Parents:
b2bae572c5a909bcd83de47db4dc59dce546641d
Message:
* moved mpsr_RingEqual to rEqual
* controled access to qideal in qrings


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/general.lib

    rb2bae5 r63374c  
    1 // $Id: general.lib,v 1.15 1999-07-06 15:32:47 Singular Exp $
     1// $Id: general.lib,v 1.16 1999-07-09 14:06:52 obachman Exp $
    22//system("random",787422842);
    33//GMG, last modified 18.6.99
    44///////////////////////////////////////////////////////////////////////////////
    55
    6 version="$Id: general.lib,v 1.15 1999-07-06 15:32:47 Singular Exp $";
     6version="$Id: general.lib,v 1.16 1999-07-09 14:06:52 obachman Exp $";
    77info="
    88LIBRARY:  general.lib   PROCEDURES OF GENERAL TYPE
     
    545545"USAGE:   sort(id[v,o,n]); id=ideal/module/intvec/list (of intvec's or int's)
    546546         sort may be called with 1, 2 or 3 arguments in the following way:
    547          sort(id[v,n]); v=intvec of positive integers, n=integer,
    548          sort(id[o,n]); o=string (any allowed ordstr of a ring), n=integer
     547         sort(id[v,n]); v=intvec of positive integers, n=integer,
     548         sort(id[o,n]); o=string (any allowed ordstr of a ring), n=integer
    549549RETURN:  a list of two elements:
    550550         [1]: object of same type as input but sorted in the following manner:
  • Singular/iparith.cc

    rb2bae5 r63374c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iparith.cc,v 1.156 1999-07-08 10:18:09 wenk Exp $ */
     4/* $Id: iparith.cc,v 1.157 1999-07-09 14:06:45 obachman Exp $ */
    55
    66/*
     
    26532653  {
    26542654    ring q=(ring)v->Data();
    2655     if ((rInternalChar(q)==rInternalChar(currRing))
    2656     && (q->N==currRing->N)) /* && varnames equ. */
     2655    if (rEqual(currRing, q, 0))
    26572656    {
    26582657      if (q->qideal==NULL)
     
    26632662    }
    26642663  }
     2664  WerrorS("can only get ideal from identical qring");
    26652665  return TRUE;
    26662666}
  • Singular/mpsr_Get.cc

    rb2bae5 r63374c  
    33****************************************/
    44
    5 /* $Id: mpsr_Get.cc,v 1.24 1999-06-08 08:02:35 Singular Exp $ */
     5/* $Id: mpsr_Get.cc,v 1.25 1999-07-09 14:06:47 obachman Exp $ */
    66/***************************************************************
    77 *
     
    719719
    720720  idhdl h = mpsr_FindIdhdl(name, r2);
    721   if (h == NULL || IDTYP(h) != RING_CMD || ! mpsr_RingEqual(IDRING(h), r))
     721  if (h == NULL || IDTYP(h) != RING_CMD || ! rEqual(IDRING(h), r))
    722722  {
    723723    h = mpsr_InitIdhdl(RING_CMD, r, name);
  • Singular/mpsr_Get.h

    rb2bae5 r63374c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr_Get.h,v 1.5 1998-12-16 18:43:42 Singular Exp $ */
     4/* $Id: mpsr_Get.h,v 1.6 1999-07-09 14:06:47 obachman Exp $ */
    55/***************************************************************
    66 *
     
    4949extern int mpsr_rDefault(short ch, char *name, ring &r);
    5050extern ring mpsr_rDefault(short ch);
    51 extern BOOLEAN mpsr_RingEqual(ring r1, ring r2);
    5251extern mpsr_Status_t mpsr_MergeLeftv(mpsr_leftv mlv1, mpsr_leftv mlv2);
    5352extern void mpsr_MapLeftv(leftv l, ring from_ring, ring to_ring);
  • Singular/mpsr_GetMisc.cc

    rb2bae5 r63374c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr_GetMisc.cc,v 1.14 1999-04-29 11:38:52 Singular Exp $ */
     4/* $Id: mpsr_GetMisc.cc,v 1.15 1999-07-09 14:06:48 obachman Exp $ */
    55
    66/***************************************************************
     
    9999}
    100100
    101 // returns TRUE, if r1 equals r2
    102 // FALSE, otherwise
    103 // Equality is determined componentwise
    104 BOOLEAN mpsr_RingEqual(ring r1, ring r2)
    105 {
    106   int i, j;
    107 
    108   if (r1 == r2) return 1;
    109 
    110   if (r1 == NULL || r2 == NULL) return 0;
    111 
    112   if ((rInternalChar(r1) != rInternalChar(r2))
    113   // orig: r1->ch == r2->ch ???
    114   || (r1->N != r2->N) || (r1->OrdSgn != r2->OrdSgn)
    115       || (rPar(r1) != rPar(r2)))
    116     return 0;
    117 
    118   for (i=0; i<r1->N; i++)
    119     if (strcmp(r1->names[i], r2->names[i])) return 0;
    120 
    121   i=0;
    122   while (r1->order[i] != 0)
    123   {
    124     if (r2->order[i] == 0) return 0;
    125     if ((r1->order[i] != r2->order[i]) ||
    126         (r1->block0[i] != r2->block0[i]) || (r2->block0[i] != r1->block0[i]))
    127       return 0;
    128     if (r1->wvhdl[i] != NULL)
    129     {
    130       if (r2->wvhdl[i] == NULL)
    131         return 0;
    132       for (j=0; j<r1->block1[i]-r1->block0[i]+1; j++)
    133         if (r2->wvhdl[i][j] != r1->wvhdl[i][j])
    134           return 0;
    135     }
    136     else if (r2->wvhdl[i] != NULL) return 0;
    137     i++;
    138   }
    139 
    140   for (i=0; i<rPar(r1);i++)
    141   {
    142       if (strcmp(r1->parameter[i], r2->parameter[i])!=0)
    143         return 0;
    144   }
    145 
    146   if (r1->minpoly != NULL)
    147   {
    148     if (r2->minpoly == NULL) return 0;
    149     mpsr_SetCurrRing(r1, FALSE);
    150     if (! naEqual(r1->minpoly, r2->minpoly)) return 0;
    151   }
    152   else if (r2->minpoly != NULL) return 0;
    153 
    154   if (r1->qideal != NULL)
    155   {
    156     ideal id1 = r1->qideal, id2 = r2->qideal;
    157     int i, n;
    158     poly *m1, *m2;
    159 
    160     if (id2 == NULL) return 0;
    161     if ((n = IDELEMS(id1)) != IDELEMS(id2)) return 0;
    162 
    163     mpsr_SetCurrRing(r1, FALSE);
    164     m1 = id1->m;
    165     m2 = id2->m;
    166     for (i=0; i<n; i++)
    167       if (! pEqualPolys(m1[i],m2[i])) return 0;
    168   }
    169   else if (r2->qideal != NULL) return 0;
    170 
    171   return 1;
    172 }
    173 
    174 
    175101// returns TRUE, if r1 less or equals r2
    176102// FALSE, otherwise
     
    225151  leftv lv;
    226152
    227   if (mpsr_RingEqual(r1,r2))
     153  if (rEqual(r1,r2))
    228154  {
    229155    if (r2 != NULL) rKill(r2);
     
    372298  {
    373299    if ((IDTYP(h) == RING_CMD || IDTYP(h) == QRING_CMD) &&
    374         (mpsr_RingEqual(IDRING(h), r)))
     300        (rEqual(IDRING(h), r)))
    375301    {
    376302      // found one
  • Singular/mpsr_GetPoly.cc

    rb2bae5 r63374c  
    33****************************************/
    44
    5 /* $Id: mpsr_GetPoly.cc,v 1.21 1999-03-08 17:30:47 Singular Exp $ */
     5/* $Id: mpsr_GetPoly.cc,v 1.22 1999-07-09 14:06:49 obachman Exp $ */
    66
    77/***************************************************************
     
    956956  lv = mlv->lv;
    957957
    958   if (! mpsr_RingEqual(r1, r)) return mpsr_Failure;
     958  if (! rEqual(r1, r)) return mpsr_Failure;
    959959
    960960  if (lv->rtyp == POLY_CMD)
  • Singular/ring.cc

    rb2bae5 r63374c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.58 1999-07-08 17:16:29 Singular Exp $ */
     4/* $Id: ring.cc,v 1.59 1999-07-09 14:06:50 obachman Exp $ */
    55
    66/*
     
    18221822}
    18231823
     1824// returns TRUE, if r1 equals r2 FALSE, otherwise Equality is
     1825// determined componentwise, if qr == 1, then qrideal equality is
     1826// tested, as well
     1827BOOLEAN rEqual(ring r1, ring r2, BOOLEAN qr)
     1828{
     1829  int i, j;
     1830
     1831  if (r1 == r2) return 1;
     1832
     1833  if (r1 == NULL || r2 == NULL) return 0;
     1834
     1835  if ((rInternalChar(r1) != rInternalChar(r2))
     1836  // orig: r1->ch == r2->ch ???
     1837  || (r1->N != r2->N) || (r1->OrdSgn != r2->OrdSgn)
     1838      || (rPar(r1) != rPar(r2)))
     1839    return 0;
     1840
     1841  for (i=0; i<r1->N; i++)
     1842    if (strcmp(r1->names[i], r2->names[i])) return 0;
     1843
     1844  i=0;
     1845  while (r1->order[i] != 0)
     1846  {
     1847    if (r2->order[i] == 0) return 0;
     1848    if ((r1->order[i] != r2->order[i]) ||
     1849        (r1->block0[i] != r2->block0[i]) || (r2->block0[i] != r1->block0[i]))
     1850      return 0;
     1851    if (r1->wvhdl[i] != NULL)
     1852    {
     1853      if (r2->wvhdl[i] == NULL)
     1854        return 0;
     1855      for (j=0; j<r1->block1[i]-r1->block0[i]+1; j++)
     1856        if (r2->wvhdl[i][j] != r1->wvhdl[i][j])
     1857          return 0;
     1858    }
     1859    else if (r2->wvhdl[i] != NULL) return 0;
     1860    i++;
     1861  }
     1862
     1863  for (i=0; i<rPar(r1);i++)
     1864  {
     1865      if (strcmp(r1->parameter[i], r2->parameter[i])!=0)
     1866        return 0;
     1867  }
     1868
     1869  if (r1->minpoly != NULL)
     1870  {
     1871    if (r2->minpoly == NULL) return 0;
     1872    if (currRing == r1 || currRing == r2)
     1873    {
     1874      if (! nEqual(r1->minpoly, r2->minpoly)) return 0;
     1875    }
     1876  }
     1877  else if (r2->minpoly != NULL) return 0;
     1878
     1879  if (qr)
     1880  {
     1881    if (r1->qideal != NULL)
     1882    {
     1883      ideal id1 = r1->qideal, id2 = r2->qideal;
     1884      int i, n;
     1885      poly *m1, *m2;
     1886
     1887      if (id2 == NULL) return 0;
     1888      if ((n = IDELEMS(id1)) != IDELEMS(id2)) return 0;
     1889
     1890      if (currRing == r1 || currRing == r2)
     1891      {
     1892        m1 = id1->m;
     1893        m2 = id2->m;
     1894        for (i=0; i<n; i++)
     1895          if (! pEqualPolys(m1[i],m2[i])) return 0;
     1896      }
     1897    }
     1898    else if (r2->qideal != NULL) return 0;
     1899  }
     1900
     1901  return 1;
     1902}
     1903
    18241904rOrderType_t rGetOrderType(ring r)
    18251905{
  • Singular/ring.h

    rb2bae5 r63374c  
    77* ABSTRACT - the interpreter related ring operations
    88*/
    9 /* $Id: ring.h,v 1.29 1999-07-08 13:38:42 Singular Exp $ */
     9/* $Id: ring.h,v 1.30 1999-07-09 14:06:51 obachman Exp $ */
    1010
    1111/* includes */
     
    4747int    rIsExtension();
    4848int    rSum(ring r1, ring r2, ring &sum);
     49BOOLEAN rEqual(ring r1, ring r2, BOOLEAN qr = 1);
    4950BOOLEAN   rComplete(ring r, int force = 0);
    5051void   rUnComplete(ring r);
Note: See TracChangeset for help on using the changeset viewer.