Changeset 327475 in git
- Timestamp:
- Jul 15, 1999, 3:37:33 PM (24 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 877605d1338b4f0ed83344657f95df0a346fca17
- Parents:
- 457bd7daf379c8a6dd5fa01fc2193ed676a5f9f3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/fglmhom.cc
r457bd7d r327475 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglmhom.cc,v 1.1 2 1999-03-09 12:28:46 obachman Exp $2 // $Id: fglmhom.cc,v 1.13 1999-07-15 13:37:33 wichmann Exp $ 3 3 4 4 /**************************************** … … 67 67 mon.sm= NULL; 68 68 } 69 #ifndef HAVE_EXPLICIT_CONSTR 70 void initialize( poly m, int b, BOOLEAN ind ) 71 { 72 basis = b; 73 inDest = ind; 74 mon.dm = m; 75 mon.sm = NULL; 76 } 77 void initialize( const homogElem h ) 78 { 79 basis = h.basis; 80 inDest = h.inDest; 81 mon.dm = h.mon.dm; 82 mon.sm = h.mon.sm; 83 } 84 #endif 69 85 }; 70 86 … … 147 163 ++dat->numberofdestbasismonoms; 148 164 if ( dat->numMonoms == dat->monlistmax ) { 149 dat->monlist= (homogElem * )ReAlloc( dat->monlist, (dat->monlistmax)*sizeof( homogElem ), (dat->monlistmax+dat->monlistblock) * sizeof( homogElem ) );150 165 int k; 166 #ifdef HAVE_EXPLICIT_CONSTR 167 // Expand array using Singulars ReAlloc function 168 dat->monlist= 169 (homogElem * )ReAlloc( dat->monlist, 170 (dat->monlistmax)*sizeof( homogElem ), 171 (dat->monlistmax+dat->monlistblock) * sizeof( homogElem ) ); 151 172 for ( k= dat->monlistmax; k < (dat->monlistmax+dat->monlistblock); k++ ) 152 173 dat->monlist[k].homogElem(); 174 #else 175 // Expand array by generating new one and copying 176 int newsize = dat->monlistmax + dat->monlistblock; 177 homogElem * tempelem = new homogElem[ newsize ]; 178 // Copy old elements 179 for ( k= dat->monlistmax - 1; k >= 0; k-- ) 180 tempelem[k].initialize( dat->monlist[k] ); 181 delete [] homogElem; 182 homogElem = tempelem; 183 #endif 153 184 dat->monlistmax+= dat->monlistblock; 154 185 } 186 #ifdef HAVE_EXPLICIT_CONSTR 155 187 dat->monlist[dat->numMonoms]= homogElem( mon, basis, inDest ); 188 #else 189 dat->monlist[dat->numMonoms].initialize( mon, basis, inDest ); 190 #endif 156 191 dat->numMonoms++; 157 192 if ( inSource && ! inDest ) PROT( "\\" ); … … 342 377 dat.monlistblock= 512; 343 378 dat.monlistmax= dat.monlistblock; 379 #ifdef HAVE_EXPLICIT_CONSTR 344 380 dat.monlist= (homogElem *)Alloc( dat.monlistmax*sizeof( homogElem ) ); 345 381 int j; 346 382 for ( j= dat.monlistmax - 1; j >= 0; j-- ) dat.monlist[j].homogElem(); 383 #else 384 dat.monlist = new homogElem[ dat.monlistmax ]; 385 #endif 347 386 dat.numMonoms= 0; 348 387 dat.basisSize= 0; … … 369 408 gaussreduce( dat, numGBelems, groebnerBS ); 370 409 410 #ifdef HAVE_EXPLICIT_CONSTR 371 411 Free( (ADDRESS)dat.monlist, dat.monlistmax*sizeof( homogElem ) ); 412 #else 413 delete [] dat.monlist; 414 #endif 372 415 PROT( "<\n" ); 373 416 }
Note: See TracChangeset
for help on using the changeset viewer.