create coeff matrix
| 1407 | |
| 1408 | // create coeff matrix |
| 1409 | int resMatrixSparse::createMatrix( pointSet *E ) |
| 1410 | { |
| 1411 | // sparse matrix |
| 1412 | // uRPos[i][1]: row of matrix |
| 1413 | // uRPos[i][idelem+1]: col of u(0) |
| 1414 | // uRPos[i][2..idelem]: col of u(1) .. u(n) |
| 1415 | // i= 1 .. numSet0 |
| 1416 | int i,epos; |
| 1417 | int rp,cp; |
| 1418 | poly rowp,epp; |
| 1419 | poly iterp; |
| 1420 | int *epp_mon, *eexp; |
| 1421 | |
| 1422 | epp_mon= (int *)omAlloc( (n+2) * sizeof(int) ); |
| 1423 | eexp= (int *)omAlloc0(((currRing->N)+1)*sizeof(int)); |
| 1424 | |
| 1425 | totDeg= numSet0; |
| 1426 | |
| 1427 | mprSTICKYPROT2(" size of matrix: %d\n", E->num); |
| 1428 | mprSTICKYPROT2(" resultant deg: %d\n", numSet0); |
| 1429 | |
| 1430 | uRPos= new intvec( numSet0, pLength((gls->m)[0])+1, 0 ); |
| 1431 | |
| 1432 | // sparse Matrix represented as a module where |
| 1433 | // each poly is column vector ( pSetComp(p,k) gives the row ) |
| 1434 | rmat= idInit( E->num, E->num ); // cols, rank= number of rows |
| 1435 | msize= E->num; |
| 1436 | |
| 1437 | rp= 1; |
| 1438 | rowp= NULL; |
| 1439 | epp= pOne(); |
| 1440 | for ( i= 1; i <= E->num; i++ ) |
| 1441 | { // for every row |
| 1442 | E->getRowMP( i, epp_mon ); // compute (p-a[ij]), (i,j) = RC(p) |
| 1443 | pSetExpV( epp, epp_mon ); |
| 1444 | |
| 1445 | // |
| 1446 | rowp= ppMult_qq( epp, (gls->m)[(*E)[i]->rc.set] ); // x^(p-a[ij]) * f(i) |
| 1447 | |
| 1448 | cp= 2; |
| 1449 | // get column for every monomial in rowp and store it |
| 1450 | iterp= rowp; |
| 1451 | while ( iterp!=NULL ) |
| 1452 | { |
| 1453 | epos= E->getExpPos( iterp ); |
| 1454 | if ( epos == 0 ) |
| 1455 | { |
| 1456 | // this can happen, if the shift vector or the lift functions |
| 1457 | // are not generically chosen. |
| 1458 | Werror("resMatrixSparse::createMatrix: Found exponent not in E, id %d, set [%d, %d]!", |
| 1459 | i,(*E)[i]->rc.set,(*E)[i]->rc.pnt); |
| 1460 | return i; |
| 1461 | } |
| 1462 | pSetExpV(iterp,eexp); |
| 1463 | pSetComp(iterp, epos ); |
| 1464 | pSetm(iterp); |
| 1465 | if ( (*E)[i]->rc.set == linPolyS ) |
| 1466 | { // store coeff positions |
nothing calls this directly
no test coverage detected