former spectrumPolyList::spectrum ( lists*, int) */
| 3562 | |
| 3563 | /* former spectrumPolyList::spectrum ( lists*, int) */ |
| 3564 | spectrumState spectrumStateFromList( spectrumPolyList& speclist, lists *L,int fast ) |
| 3565 | { |
| 3566 | spectrumPolyNode **node = &speclist.root; |
| 3567 | spectrumPolyNode *search; |
| 3568 | |
| 3569 | poly f,tmp; |
| 3570 | int found,cmp; |
| 3571 | |
| 3572 | Rational smax( ( fast==0 ? 0 : rVar(currRing) ), |
| 3573 | ( fast==2 ? 2 : 1 ) ); |
| 3574 | |
| 3575 | Rational weight_prev( 0,1 ); |
| 3576 | |
| 3577 | int mu = 0; // the milnor number |
| 3578 | int pg = 0; // the geometrical genus |
| 3579 | int n = 0; // number of different spectral numbers |
| 3580 | int z = 0; // number of spectral number equal to smax |
| 3581 | |
| 3582 | while( (*node)!=(spectrumPolyNode*)NULL && |
| 3583 | ( fast==0 || (*node)->weight<=smax ) ) |
| 3584 | { |
| 3585 | // --------------------------------------- |
| 3586 | // determine the first normal form which |
| 3587 | // contains the monomial node->mon |
| 3588 | // --------------------------------------- |
| 3589 | |
| 3590 | found = FALSE; |
| 3591 | search = *node; |
| 3592 | |
| 3593 | while( search!=(spectrumPolyNode*)NULL && found==FALSE ) |
| 3594 | { |
| 3595 | if( search->nf!=(poly)NULL ) |
| 3596 | { |
| 3597 | f = search->nf; |
| 3598 | |
| 3599 | do |
| 3600 | { |
| 3601 | // -------------------------------- |
| 3602 | // look for (*node)->mon in f |
| 3603 | // -------------------------------- |
| 3604 | |
| 3605 | cmp = pCmp( (*node)->mon,f ); |
| 3606 | |
| 3607 | if( cmp<0 ) |
| 3608 | { |
| 3609 | f = pNext( f ); |
| 3610 | } |
| 3611 | else if( cmp==0 ) |
| 3612 | { |
| 3613 | // ----------------------------- |
| 3614 | // we have found a normal form |
| 3615 | // ----------------------------- |
| 3616 | |
| 3617 | found = TRUE; |
| 3618 | |
| 3619 | // normalize coefficient |
| 3620 | |
| 3621 | number inv = nInvers( pGetCoeff( f ) ); |
no test coverage detected