| 3803 | } |
| 3804 | |
| 3805 | spectrumState spectrumCompute( poly h,lists *L,int fast ) |
| 3806 | { |
| 3807 | int i; |
| 3808 | |
| 3809 | #ifdef SPECTRUM_DEBUG |
| 3810 | #ifdef SPECTRUM_PRINT |
| 3811 | #ifdef SPECTRUM_IOSTREAM |
| 3812 | cout << "spectrumCompute\n"; |
| 3813 | if( fast==0 ) cout << " no optimization" << endl; |
| 3814 | if( fast==1 ) cout << " weight optimization" << endl; |
| 3815 | if( fast==2 ) cout << " symmetry optimization" << endl; |
| 3816 | #else |
| 3817 | fputs( "spectrumCompute\n",stdout ); |
| 3818 | if( fast==0 ) fputs( " no optimization\n", stdout ); |
| 3819 | if( fast==1 ) fputs( " weight optimization\n", stdout ); |
| 3820 | if( fast==2 ) fputs( " symmetry optimization\n", stdout ); |
| 3821 | #endif |
| 3822 | #endif |
| 3823 | #endif |
| 3824 | |
| 3825 | // ---------------------- |
| 3826 | // check if h is zero |
| 3827 | // ---------------------- |
| 3828 | |
| 3829 | if( h==(poly)NULL ) |
| 3830 | { |
| 3831 | return spectrumZero; |
| 3832 | } |
| 3833 | |
| 3834 | // ---------------------------------- |
| 3835 | // check if h has a constant term |
| 3836 | // ---------------------------------- |
| 3837 | |
| 3838 | if( hasConstTerm( h, currRing ) ) |
| 3839 | { |
| 3840 | return spectrumBadPoly; |
| 3841 | } |
| 3842 | |
| 3843 | // -------------------------------- |
| 3844 | // check if h has a linear term |
| 3845 | // -------------------------------- |
| 3846 | |
| 3847 | if( hasLinearTerm( h, currRing ) ) |
| 3848 | { |
| 3849 | *L = (lists)omAllocBin( slists_bin); |
| 3850 | (*L)->Init( 1 ); |
| 3851 | (*L)->m[0].rtyp = INT_CMD; // milnor number |
| 3852 | /* (*L)->m[0].data = (void*)0;a -- done by Init */ |
| 3853 | |
| 3854 | return spectrumNoSingularity; |
| 3855 | } |
| 3856 | |
| 3857 | // ---------------------------------- |
| 3858 | // compute the jacobi ideal of (h) |
| 3859 | // ---------------------------------- |
| 3860 | |
| 3861 | ideal J = NULL; |
| 3862 | J = idInit( rVar(currRing),1 ); |
no test coverage detected