Changeset ecf019 in git for Singular


Ignore:
Timestamp:
Mar 2, 2012, 3:29:37 PM (12 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
6a9f2e15e342b18ddc6a8d27963414c1e03255a8
Parents:
ece1ce5f2a8a9e000496d4f95d697f07df0551e6
Message:
chg: consider lists with only DEF_CMD as empty lists(print, delete)(from master)
Location:
Singular
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    rece1ce recf019  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id$ */
    54
    65/*
     
    35983597{
    35993598  lists l=(lists)v->Data();
    3600   res->data = (char *)(long)(l->nr+1);
     3599  res->data = (char *)(long)(lSize(l)+1);
    36013600  return FALSE;
    36023601}
  • Singular/lists.cc

    rece1ce recf019  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id$ */
    54/*
    65* ABSTRACT: handling of the list type
     
    2322omBin slists_bin = omGetSpecBin(sizeof(slists));
    2423
     24int lSize(lists L)
     25{
     26  int n=L->nr;
     27  while ((n>=0)&&(L->m[n].rtyp==DEF_CMD)) n--;
     28  return n;
     29}
     30
    2531lists lCopy(lists L)
    2632{
     
    156162  lists ul=(lists)u->Data();
    157163  int VIndex=(int)(long)v->Data()-1;
     164  int EndIndex=lSize(ul);
    158165
    159166  if((0<=VIndex)&&(VIndex<=ul->nr))
     
    162169    int i,j;
    163170    lists l=(lists) omAllocBin(slists_bin);
    164     l->Init(ul->nr);
    165 
    166     for(i=j=0;i<=ul->nr;i++,j++)
     171    l->Init(EndIndex+(VIndex>EndIndex));
     172
     173    for(i=j=0;i<=EndIndex;i++,j++)
    167174    {
    168175      if (i!=VIndex)
  • Singular/lists.h

    rece1ce recf019  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id$ */
    76/*
    87* ABSTRACT: handling of the list type
     
    5049typedef slists *           lists;
    5150
     51int lSize(lists L);
    5252lists lCopy(lists L);
    5353lists lInsert0(lists ul, leftv v, int pos);
  • Singular/subexpr.cc

    rece1ce recf019  
    55* ABSTRACT: handling of leftv
    66*/
    7 /* $Id$ */
    87
    98#include <stdlib.h>
     
    231230        {
    232231          lists l=(lists)d;
    233           if (l->nr<0)
     232          if (lSize(l)<0)
    234233          {
    235234             PrintNSpaces(spaces);
Note: See TracChangeset for help on using the changeset viewer.