Changeset a82adc in git


Ignore:
Timestamp:
May 20, 2005, 5:33:19 PM (19 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
9c979f4e2cecdbf0abbfc0a11628633d6c2c7d4d
Parents:
e6a01964d9be4bf183ccc3d4b259d99f1b15e31d
Message:
*hannes: try to optimize intvec


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

Legend:

Unmodified
Added
Removed
  • kernel/intvec.cc

    re6a019 ra82adc  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: intvec.cc,v 1.2 2004-05-27 12:05:41 Singular Exp $ */
     4/* $Id: intvec.cc,v 1.3 2005-05-20 15:33:18 Singular Exp $ */
    55/*
    66* ABSTRACT: class intvec: lists/vectors of integers
     
    1616/*0 implementation*/
    1717
    18 
     18// omBin intvec_bin = omGetSpecBin(sizeof(intvec));
     19#if 0
    1920intvec::intvec(intvec* iv)
    2021{
     
    2728  }
    2829}
     30#endif
    2931
    3032intvec::intvec(int s, int e)
     
    216218}
    217219
     220#if 0
    218221intvec * ivCopy(intvec * o)
    219222{
     
    221224  return iv;
    222225}
     226#endif
    223227
    224228intvec * ivAdd(intvec * a, intvec * b)
  • kernel/intvec.h

    re6a019 ra82adc  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: intvec.h,v 1.4 2005-05-04 14:08:54 Singular Exp $ */
     6/* $Id: intvec.h,v 1.5 2005-05-20 15:33:19 Singular Exp $ */
    77/*
    88* ABSTRACT: class intvec: lists/vectors of integers
     
    1111#include "omalloc.h"
    1212#include "febase.h"
     13
     14
     15//extern omBin intvec_bin;
    1316
    1417class intvec
     
    2831  intvec(int s, int e);
    2932  intvec(int r, int c, int init);
    30   intvec(intvec* iv);
     33  intvec(intvec* iv)
     34  {
     35    row = iv->rows();
     36    col = iv->cols();
     37    v   = (int *)omAlloc(sizeof(int)*row*col);
     38    for (int i=row*col-1;i>=0; i--)
     39    {
     40      v[i] = (*iv)[i];
     41    }
     42  }
    3143
    3244  void resize(int new_length);
     
    8092    return m;
    8193  }
     94#if 0
     95  void* operator new ( size_t size )
     96  {
     97    void* addr;
     98    //omTypeAlloc(void*, addr, size);
     99    addr=omAlloc0Bin(intvec_bin);
     100    return addr;
     101  }
     102  void operator delete ( void* block )
     103  { //omfree( block );
     104    omFreeBin((ADDRESS)block, intvec_bin);
     105  }
     106#endif
    82107  // keiner (ausser obachman) darf das folgenden benutzen !!!
    83108  inline int * ivGetVec() { return v; }
    84109};
    85 intvec * ivCopy(intvec * o);
     110inline intvec * ivCopy(intvec * o)
     111{
     112  intvec * iv=new intvec(o);
     113  return iv;
     114}
     115
    86116intvec * ivAdd(intvec * a, intvec * b);
    87117intvec * ivSub(intvec * a, intvec * b);
Note: See TracChangeset for help on using the changeset viewer.