Changeset 6d7605 in git


Ignore:
Timestamp:
May 12, 2005, 10:12:30 AM (19 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
15772766c4e2d15841019de318a47bafaffe477f
Parents:
85eb7dcc9d3372a9129b72005d9ffad7bd5123ce
Message:
*bricken: better reallocation strategy


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

Legend:

Unmodified
Added
Removed
  • kernel/tgb.cc

    r85eb7d r6d7605  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb.cc,v 1.19 2005-05-12 07:44:10 bricken Exp $ */
     7/* $Id: tgb.cc,v 1.20 2005-05-12 08:12:29 bricken Exp $ */
    88/*
    99* ABSTRACT: slimgb and F4 implementation
     
    12041204
    12051205  assume(h!=NULL);
    1206 #define ENLARGE(pointer, type) pointer=(type*) omrealloc(pointer, c->n*sizeof(type))
     1206#define ENLARGE(pointer, type) pointer=(type*) omrealloc(pointer, c->array_lengths*sizeof(type))
    12071207//  BOOLEAN corr=lenS_correct(c->strat);
    12081208  BOOLEAN R_found=FALSE;
     
    12151215  sorted_pair_node** nodes=(sorted_pair_node**) omalloc(sizeof(sorted_pair_node*)*i);
    12161216  int spc=0;
    1217   ENLARGE(c->T_deg, int);
    1218   ENLARGE(c->tmp_pair_lm,poly);
    1219   ENLARGE(c->tmp_spn,sorted_pair_node*);
    1220   ENLARGE(c->rep,int);
    1221   ENLARGE(c->short_Exps,long);
    1222   ENLARGE(c->lengths,int);
    1223   ENLARGE(c->states, char*);
    1224   ENLARGE(c->gcd_of_terms,poly);
    1225   ENLARGE(c->S->m,poly);
     1217  if(c->n>c->array_lengths){
     1218    c->array_lengths=c->array_lengths*2;
     1219    assume(c->array_lengths>=c->n);
     1220    ENLARGE(c->T_deg, int);
     1221    ENLARGE(c->tmp_pair_lm,poly);
     1222    ENLARGE(c->tmp_spn,sorted_pair_node*);
     1223    ENLARGE(c->rep,int);
     1224    ENLARGE(c->short_Exps,long);
     1225    ENLARGE(c->lengths,int);
     1226    ENLARGE(c->states, char*);
     1227    ENLARGE(c->gcd_of_terms,poly);
     1228    ENLARGE(c->S->m,poly);
     1229  }
    12261230  if (c->T_deg_full)
    12271231    ENLARGE(c->T_deg_full,int);
     
    30773081
    30783082  int n=I->idelems();
     3083  c->array_lengths=n;
     3084
    30793085  if (TEST_OPT_PROT)
    30803086    for (i=0;i<n;i++){
     
    31133119  c->strat->sl = -1;
    31143120  i=n;
    3115   i=1;
     3121  i=1;//some strange bug else
    31163122  /* initS(c->S,NULL,c->strat); */
    31173123/* intS start: */
  • kernel/tgb_internal.h

    r85eb7d r6d7605  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb_internal.h,v 1.7 2005-05-11 14:58:35 bricken Exp $ */
     7/* $Id: tgb_internal.h,v 1.8 2005-05-12 08:12:30 bricken Exp $ */
    88/*
    99 * ABSTRACT: tgb internal .h file
     
    113113  unsigned int reduction_steps;
    114114  int n;
     115  //! array_lengths should be greater equal n;
     116  int array_lengths;
    115117  int normal_forms;
    116118  int current_degree;
Note: See TracChangeset for help on using the changeset viewer.