Changeset 7af488e in git for libpolys/coeffs/numbers.cc
- Timestamp:
- May 27, 2011, 11:39:02 AM (13 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38077648e7239f98078663eb941c3c979511150a')
- Children:
- 9bb545791780a99344a26d6177decb3870f6da87
- Parents:
- 6ccdd3ad26bd7de442ab57e7cc95352fcf0de398
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-05-27 11:39:02+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:39:06+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/numbers.cc
r6ccdd3a r7af488e 30 30 #endif 31 31 32 #ifdef HAVE_POLYEXTENSIONS 33 #include <polys/ext_fields/algext.h> 34 #endif 35 32 36 #ifdef HAVE_FACTORY 33 37 #include <factory/factory.h> … … 153 157 } 154 158 155 static n_coeffType nLastCoeffs=n_Z2m; 156 static cfInitCharProc *nInitCharTable=NULL; 159 static n_coeffType nLastCoeffs=n_CF; 160 cfInitCharProc nInitCharTableDefault[]= 161 { NULL, /*n_unknown */ 162 npInitChar, /* n_Zp */ 163 nlInitChar, /* n_Q */ 164 nrInitChar, /* n_R */ 165 nfInitChar, /* n_GF */ 166 ngfInitChar, /* n_long_R */ 167 #ifdef HAVE_POLYEXTENSIONS 168 naInitChar, /* n_algExt */ 169 #else 170 NULL, /* n_algExt */ 171 #endif 172 NULL, /* n_transExt */ 173 ngcInitChar, /* n_long_C */ 174 #ifdef HAVE_RINGS 175 nrzInitChar, /* n_Z */ 176 nrnInitChar, /* n_Zn */ 177 NULL, /* n_Zpn */ 178 nr2mInitChar, /* n_Z2m */ 179 #else 180 NULL, /* n_Z */ 181 NULL, /* n_Zn */ 182 NULL, /* n_Zpn */ 183 NULL, /* n_Z2m */ 184 #endif 185 NULL /* n_CF */ 186 }; 187 188 static cfInitCharProc *nInitCharTable=nInitCharTableDefault; 157 189 /*2 158 190 * init operations for coeffs r … … 206 238 BOOLEAN nOK=TRUE; 207 239 // init 208 if (( nInitCharTable!=NULL) && (t<=nLastCoeffs))240 if ((t<=nLastCoeffs) && (nInitCharTable[t]!=NULL)) 209 241 nOK = (nInitCharTable[t])(n,parameter); 210 242 else 211 Werror(" coeff init missing for %d",(int)t);243 Werror("nInitCharTable[%d] missing",(int)t); 212 244 if (nOK) 213 245 { … … 311 343 } 312 344 345 313 346 n_coeffType nRegister(n_coeffType n, cfInitCharProc p) 314 347 { … … 316 349 { 317 350 nLastCoeffs=(n_coeffType)(int(nLastCoeffs)+1); 318 if (nInitCharTable== NULL)351 if (nInitCharTable==nInitCharTableDefault) 319 352 { 320 353 nInitCharTable=(cfInitCharProc*)omAlloc0( 321 354 nLastCoeffs*sizeof(cfInitCharProc)); 355 memcpy(nInitCharTable,nInitCharTableDefault, 356 (nLastCoeffs-1)*sizeof(cfInitCharProc)); 322 357 } 323 358 else … … 333 368 else 334 369 { 335 if (nInitCharTable==NULL) 336 { 337 nInitCharTable=(cfInitCharProc*)omAlloc0( 338 ((int) nLastCoeffs)*sizeof(cfInitCharProc)); 339 } 370 if (nInitCharTable[n]!=NULL) Print("coeff %d already initialized\n",n); 340 371 nInitCharTable[n]=p; 341 372 return n;
Note: See TracChangeset
for help on using the changeset viewer.