| 4177 | // ---------------------------------------------------------------------------- |
| 4178 | |
| 4179 | BOOLEAN spectrumfProc( leftv result,leftv first ) |
| 4180 | { |
| 4181 | spectrumState state = spectrumOK; |
| 4182 | |
| 4183 | // ------------------- |
| 4184 | // check consistency |
| 4185 | // ------------------- |
| 4186 | |
| 4187 | // check for a local polynomial ring |
| 4188 | |
| 4189 | if( currRing->OrdSgn != -1 ) |
| 4190 | // ?? HS: the test above is also true for k[x][[y]], k[[x]][y] |
| 4191 | // or should we use: |
| 4192 | //if( !ringIsLocal( ) ) |
| 4193 | { |
| 4194 | WerrorS( "only works for local orderings" ); |
| 4195 | state = spectrumWrongRing; |
| 4196 | } |
| 4197 | else if( currRing->qideal != NULL ) |
| 4198 | { |
| 4199 | WerrorS( "does not work in quotient rings" ); |
| 4200 | state = spectrumWrongRing; |
| 4201 | } |
| 4202 | else |
| 4203 | { |
| 4204 | lists L = (lists)NULL; |
| 4205 | int flag = 2; // symmetric optimization |
| 4206 | |
| 4207 | state = spectrumCompute( (poly)first->Data( ),&L,flag ); |
| 4208 | |
| 4209 | if( state==spectrumOK ) |
| 4210 | { |
| 4211 | result->rtyp = LIST_CMD; |
| 4212 | result->data = (char*)L; |
| 4213 | } |
| 4214 | else |
| 4215 | { |
| 4216 | spectrumPrintError(state); |
| 4217 | } |
| 4218 | } |
| 4219 | |
| 4220 | return (state!=spectrumOK); |
| 4221 | } |
| 4222 | |
| 4223 | // ---------------------------------------------------------------------------- |
| 4224 | // check if a list is a spectrum |
no test coverage detected