Changeset 08e15e7 in git for numeric/mpr_base.cc
- Timestamp:
- Sep 6, 2011, 7:40:16 PM (13 years ago)
- Branches:
- (u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
- Children:
- 213d649793d02bccc46292a68beead7b202af509
- Parents:
- b9cf410a96c73af3a43f5d317b0ff37eec0a49de
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-09-06 19:40:16+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:12:32+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
numeric/mpr_base.cc
rb9cf41 r08e15e7 9 9 */ 10 10 11 #include <math.h> 12 11 //-> includes 13 12 #include <kernel/mod2.h> 14 13 14 #include <misc/auxiliary.h> 15 #include <omalloc/omalloc.h> 16 15 17 #include <misc/mylimits.h> 16 #include <omalloc/omalloc.h> 17 18 //-> includes 19 #include <kernel/options.h> 18 #include <misc/options.h> 19 #include <misc/intvec.h> 20 21 #include <coeffs/numbers.h> 22 #include <coeffs/mpr_global.h> 23 24 #include <polys/matpol.h> 25 #include <polys/sparsmat.h> 26 27 #ifdef HAVE_FACTORY 28 #include <polys/clapsing.h> 29 #endif 30 31 #include <kernel/febase.h> 20 32 #include <kernel/polys.h> 21 33 #include <kernel/ideals.h> 22 #include <kernel/febase.h> 23 #include <kernel/intvec.h> 24 #include <kernel/matpol.h> 25 #include <kernel/numbers.h> 26 #ifdef HAVE_FACTORY 27 #include <kernel/clapsing.h> 28 #endif 29 #include <kernel/sparsmat.h> 30 31 #include <kernel/mpr_global.h> 32 #include <kernel/mpr_base.h> 33 #include <kernel/mpr_numeric.h> 34 35 #include "mpr_base.h" 36 #include "mpr_numeric.h" 37 38 #include <math.h> 34 39 //<- 35 40 … … 278 283 { 279 284 public: 280 mayanPyramidAlg( simplex * _pLP ) : n( pVariables), pLP(_pLP) {}285 mayanPyramidAlg( simplex * _pLP ) : n((currRing->N)), pLP(_pLP) {} 281 286 ~mayanPyramidAlg() {} 282 287 … … 380 385 && (!nIsZero(pGetCoeff( MATELEM( omat, i, j))))) 381 386 { 382 val= n_Int(pGetCoeff( MATELEM( omat, i, j) ), currRing );387 val= n_Int(pGetCoeff( MATELEM( omat, i, j) ), currRing->cf); 383 388 if ( i==MATROWS(omat) && j==MATCOLS(omat) ) 384 389 { … … 781 786 int * vert; 782 787 783 n= pVariables;788 n= (currRing->N); 784 789 vert= (int *)omAlloc( (idelem+1) * sizeof(int) ); 785 790 786 791 Q = (pointSet **)omAlloc( idelem * sizeof(pointSet*) ); // support hulls 787 792 for ( i= 0; i < idelem; i++ ) 788 Q[i] = new pointSet( pVariables, i+1, pLength((gls->m)[i])+1 );793 Q[i] = new pointSet( (currRing->N), i+1, pLength((gls->m)[i])+1 ); 789 794 790 795 for( i= 0; i < idelem; i++ ) … … 820 825 for ( j=1; j <= Q[i]->num; j++ ) 821 826 { 822 Print("%d: <",j);print_exp( (*Q[i])[j] , pVariables);PrintS(">\n");827 Print("%d: <",j);print_exp( (*Q[i])[j] , (currRing->N) );PrintS(">\n"); 823 828 } 824 829 PrintLn(); … … 841 846 int * vert; 842 847 843 n= pVariables;848 n= (currRing->N); 844 849 vert= (int *)omAlloc( (idelem+1) * sizeof(int) ); 845 850 id= idInit( idelem, 1 ); … … 1218 1223 bool resMatrixSparse::remapXiToPoint( const int indx, pointSet **pQ, int *set, int *pnt ) 1219 1224 { 1220 int i,nn= pVariables;1225 int i,nn= (currRing->N); 1221 1226 int loffset= 0; 1222 1227 for ( i= 0; i <= nn; i++ ) … … 1421 1426 1422 1427 epp_mon= (int *)omAlloc( (n+2) * sizeof(int) ); 1423 eexp= (int *)omAlloc0(( pVariables+1)*sizeof(int));1428 eexp= (int *)omAlloc0(((currRing->N)+1)*sizeof(int)); 1424 1429 1425 1430 totDeg= numSet0; … … 1480 1485 pDelete( &epp ); 1481 1486 omFreeSize( (void *) epp_mon, (n+2) * sizeof(int) ); 1482 omFreeSize( (void *) eexp, ( pVariables+1)*sizeof(int));1487 omFreeSize( (void *) eexp, ((currRing->N)+1)*sizeof(int)); 1483 1488 1484 1489 #ifdef mprDEBUG_ALL … … 1525 1530 int j,k,l; 1526 1531 1527 vert.point=(Coord_t*)omAlloc( ( pVariables+2) * sizeof(Coord_t) );1532 vert.point=(Coord_t*)omAlloc( ((currRing->N)+2) * sizeof(Coord_t) ); 1528 1533 1529 1534 vs= new pointSet( dim ); … … 1542 1547 } 1543 1548 1544 omFreeSize( (void *) vert.point, ( pVariables+2) * sizeof(Coord_t) );1549 omFreeSize( (void *) vert.point, ((currRing->N)+2) * sizeof(Coord_t) ); 1545 1550 1546 1551 return vs; … … 1579 1584 mprfloat shift[MAXVARS+2]; // shiftvector delta, index [1..dim] 1580 1585 1581 if ( pVariables> MAXVARS )1586 if ( (currRing->N) > MAXVARS ) 1582 1587 { 1583 1588 WerrorS("resMatrixSparse::resMatrixSparse: Too many variables!"); … … 1593 1598 istate= resMatrixBase::ready; 1594 1599 1595 n= pVariables;1600 n= (currRing->N); 1596 1601 idelem= IDELEMS(gls); // should be n+1 1597 1602 … … 1974 1979 1975 1980 /** Recursively generate all homogeneous monoms of 1976 * pVariablesvariables of degree deg.1981 * (currRing->N) variables of degree deg. 1977 1982 */ 1978 1983 void generateMonoms( poly m, int var, int deg ); … … 2029 2034 2030 2035 /** holds the index of u0, u1, ..., un, if (elementOfS == linPolyS) 2031 * the size is given by pVariables2036 * the size is given by (currRing->N) 2032 2037 */ 2033 2038 int *numColParNr; … … 2100 2105 numVectors * sizeof( number ) ); 2101 2106 omfreeSize( (void *)resVectorList[i].numColParNr, 2102 ( pVariables+1) * sizeof(int) );2107 ((currRing->N)+1) * sizeof(int) ); 2103 2108 } 2104 2109 … … 2135 2140 { 2136 2141 mprSTICKYPROT(ST_DENSE_FR); 2137 for ( i= 0; i < pVariables; i++ )2142 for ( i= 0; i < (currRing->N); i++ ) 2138 2143 { 2139 2144 MATELEM(m,numVectors-k,numVectors-(getMVector(k)->numColParNr)[i])= pInit(); … … 2161 2166 if ( linPolyS == getMVector(k)->elementOfS ) 2162 2167 { 2163 for ( i=0; i < pVariables; i++ )2168 for ( i=0; i < (currRing->N); i++ ) 2164 2169 { 2165 2170 Print(" %d ",(getMVector(k)->numColParNr)[i]); … … 2207 2212 else 2208 2213 { 2209 if ( var == pVariables+1 ) return;2214 if ( var == (currRing->N)+1 ) return; 2210 2215 poly newm = pCopy( mm ); 2211 2216 while ( deg >= 0 ) … … 2352 2357 // the internal Variable Ordering 2353 2358 // make sure that the homogenization variable goes last! 2354 intvec iVO( pVariables);2359 intvec iVO( (currRing->N) ); 2355 2360 if ( linPolyS != SNONE ) 2356 2361 { 2357 iVO[ pVariables- 1]= linPolyS;2362 iVO[(currRing->N) - 1]= linPolyS; 2358 2363 int p=0; 2359 for ( k= pVariables- 1; k >= 0; k-- )2364 for ( k= (currRing->N) - 1; k >= 0; k-- ) 2360 2365 { 2361 2366 if ( k != linPolyS ) … … 2369 2374 { 2370 2375 linPolyS= 0; 2371 for ( k= 0; k < pVariables; k++ )2372 iVO[k]= pVariables- k - 1;2376 for ( k= 0; k < (currRing->N); k++ ) 2377 iVO[k]= (currRing->N) - k - 1; 2373 2378 } 2374 2379 … … 2425 2430 resVectorList[k].numColVectorSize= 0; 2426 2431 resVectorList[k].numColVector= NULL; 2427 resVectorList[k].numColParNr= (int *)omAlloc0( ( pVariables+1) * sizeof(int) );2432 resVectorList[k].numColParNr= (int *)omAlloc0( ((currRing->N)+1) * sizeof(int) ); 2428 2433 2429 2434 pi= (gls->m)[ resVectorList[k].elementOfS ]; … … 2489 2494 if ( resVectorList[i].elementOfS == linPolyS ) 2490 2495 { 2491 for (j=1; j <= pVariables; j++ )2496 for (j=1; j <= (currRing->N); j++ ) 2492 2497 { 2493 2498 if ( MATELEM(resmat,numVectors-i, … … 2498 2503 if ( FALSE ) 2499 2504 { 2500 pSetCoeff( MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]), n Par(j) );2505 pSetCoeff( MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]), n_Param(j,currRing) ); 2501 2506 } 2502 2507 else … … 2555 2560 if ( linPolyS == getMVector(k)->elementOfS ) 2556 2561 { 2557 for ( i= 0; i < pVariables; i++ )2562 for ( i= 0; i < (currRing->N); i++ ) 2558 2563 { 2559 2564 pSetCoeff( MATELEM(m,numVectors-k,numVectors-(getMVector(k)->numColParNr)[i]), … … 2567 2572 // evaluate determinant of matrix m using factory singclap_det 2568 2573 #ifdef HAVE_FACTORY 2569 poly res= singclap_det( m );2574 poly res= singclap_det( m, currRing ); 2570 2575 #else 2571 2576 poly res= NULL; … … 2631 2636 2632 2637 #ifdef HAVE_FACTORY 2633 poly res= singclap_det( mat );2638 poly res= singclap_det( mat, currRing ); 2634 2639 #else 2635 2640 poly res= NULL; … … 2753 2758 poly actlp, rootlp= newlp; 2754 2759 2755 for ( i= 1; i <= pVariables; i++ )2760 for ( i= 1; i <= (currRing->N); i++ ) 2756 2761 { 2757 2762 actlp= newlp; … … 3201 3206 ideal idr; 3202 3207 3203 n= pVariables;3208 n= (currRing->N); 3204 3209 idelem= IDELEMS(id); // should be n+1 3205 3210
Note: See TracChangeset
for help on using the changeset viewer.