returns the number of maximal block */ appearing among the monomials of p */ the 0th block is the 1st one */
| 454 | /* appearing among the monomials of p */ |
| 455 | /* the 0th block is the 1st one */ |
| 456 | int p_FirstVblock(poly p, const ring r) |
| 457 | { |
| 458 | if (p == NULL) { |
| 459 | return 0; |
| 460 | } |
| 461 | |
| 462 | poly q = p; |
| 463 | int ans = p_mFirstVblock(q, r); |
| 464 | while (q!=NULL) |
| 465 | { |
| 466 | int ansnew = p_mFirstVblock(q, r); |
| 467 | if (ansnew > 0) { // don't count constants |
| 468 | ans = si_min(ans,ansnew); |
| 469 | } |
| 470 | pIter(q); |
| 471 | } |
| 472 | /* do not need to delete q */ |
| 473 | return(ans); |
| 474 | } |
| 475 | |
| 476 | /* for a monomial p, returns the number of the first block */ |
| 477 | /* where a nonzero exponent is sitting */ |
no test coverage detected