Changeset 7bb7da5 in git


Ignore:
Timestamp:
Nov 25, 2013, 4:05:23 PM (9 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '5bec8f88c9ee2573d328cf7c3aff2bcb301d2395')
Children:
dc478260ef923280b78afb46f80108bc7636b34a
Parents:
0615d9680ee7c46dfdc3c107760b2f351a130c31
Message:
chg: r_IsRingVar (extensions may not be singular rings, but uuse coeffs interface)
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    r0615d9 r7bb7da5  
    43454345static BOOLEAN jjIS_RINGVAR_S(leftv res, leftv v)
    43464346{
    4347   res->data = (char *)(long)(r_IsRingVar((char *)v->Data(), currRing)+1);
     4347  res->data = (char *)(long)(r_IsRingVar((char *)v->Data(), currRing->names,
     4348                                                            currRing->N)+1);
    43484349  return FALSE;
    43494350}
  • Singular/subexpr.cc

    r0615d9 r7bb7da5  
    14731473    {
    14741474      int vnr;
    1475       if ((vnr=r_IsRingVar(id, currRing))>=0)
     1475      if ((vnr=r_IsRingVar(id, currRing->names,currRing->N))>=0)
    14761476      {
    14771477        poly p=pOne();
     
    14831483        return;
    14841484      }
    1485       if((currRing->cf->extRing!=NULL)
    1486       &&((vnr=r_IsRingVar(id, currRing->cf->extRing))>=0))
     1485      if((n_NumberOfParameters(currRing->cf)>0)
     1486      &&((vnr=r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
     1487                              n_NumberOfParameters(currRing->cf))>=0)))
    14871488      {
    14881489        BOOLEAN ok=FALSE;
     
    15781579        }
    15791580        if (TEST_V_ALLWARN /*&& (myynest>0)*/
    1580         && ((r_IsRingVar(id, currRing)>=0)
    1581           || ((currRing->cf->extRing!=NULL)
    1582              &&(r_IsRingVar(id, currRing->cf->extRing)>=0))))
     1581        && ((r_IsRingVar(id, currRing->names,currRing->N)>=0)
     1582          || ((n_NumberOfParameters(currRing->cf)>0)
     1583             &&(r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
     1584                                n_NumberOfParameters(currRing->cf))>=0))))
    15831585        {
    15841586        // WARNING: do not use ring variable names in procedures
  • libpolys/polys/monomials/p_polys.cc

    r0615d9 r7bb7da5  
    13711371  /* i.e. it does not start with a coeff: test if it is a ringvar*/
    13721372  {
    1373     j = r_IsRingVar(s,r);
     1373    j = r_IsRingVar(s,r->names,r->N);
    13741374    if (j >= 0)
    13751375    {
     
    13841384    ss[0] = *s++;
    13851385    ss[1] = '\0';
    1386     j = r_IsRingVar(ss,r);
     1386    j = r_IsRingVar(ss,r->names,r->N);
    13871387    if (j >= 0)
    13881388    {
  • libpolys/polys/monomials/ring.cc

    r0615d9 r7bb7da5  
    221221}
    222222
    223 /*2
    224  * set a new ring from the data:
    225  s: name, chr: ch, varnames: rv, ordering: ord, typ: typ
    226  */
    227 
    228 int r_IsRingVar(const char *n, ring r)
    229 {
    230   if ((r!=NULL) && (r->names!=NULL))
    231   {
    232     for (int i=0; i<r->N; i++)
    233     {
    234       if (r->names[i]==NULL) return -1;
    235       if (strcmp(n,r->names[i]) == 0) return (int)i;
     223
     224int r_IsRingVar(const char *n, char**names,int N)
     225{
     226  if (names!=NULL)
     227  {
     228    for (int i=0; i<N; i++)
     229    {
     230      if (names[i]==NULL) return -1;
     231      if (strcmp(n,names[i]) == 0) return (int)i;
    236232    }
    237233  }
  • libpolys/polys/monomials/ring.h

    r0615d9 r7bb7da5  
    344344
    345345// #define rIsRingVar(A) r_IsRingVar(A,currRing)
    346 int    r_IsRingVar(const char *n, ring r);
     346int    r_IsRingVar(const char *n, char**names, int N);
    347347void   rWrite(ring r, BOOLEAN details = FALSE);
    348348ring   rCopy(ring r);
Note: See TracChangeset for help on using the changeset viewer.