| 4126 | } |
| 4127 | |
| 4128 | BOOLEAN spectrumProc( leftv result,leftv first ) |
| 4129 | { |
| 4130 | spectrumState state = spectrumOK; |
| 4131 | |
| 4132 | // ------------------- |
| 4133 | // check consistency |
| 4134 | // ------------------- |
| 4135 | |
| 4136 | // check for a local ring |
| 4137 | |
| 4138 | if( !ringIsLocal(currRing ) ) |
| 4139 | { |
| 4140 | WerrorS( "only works for local orderings" ); |
| 4141 | state = spectrumWrongRing; |
| 4142 | } |
| 4143 | |
| 4144 | // no quotient rings are allowed |
| 4145 | |
| 4146 | else if( currRing->qideal != NULL ) |
| 4147 | { |
| 4148 | WerrorS( "does not work in quotient rings" ); |
| 4149 | state = spectrumWrongRing; |
| 4150 | } |
| 4151 | else |
| 4152 | { |
| 4153 | lists L = (lists)NULL; |
| 4154 | int flag = 1; // weight corner optimization is safe |
| 4155 | |
| 4156 | state = spectrumCompute( (poly)first->Data( ),&L,flag ); |
| 4157 | |
| 4158 | if( state==spectrumOK ) |
| 4159 | { |
| 4160 | result->rtyp = LIST_CMD; |
| 4161 | result->data = (char*)L; |
| 4162 | } |
| 4163 | else |
| 4164 | { |
| 4165 | spectrumPrintError(state); |
| 4166 | } |
| 4167 | } |
| 4168 | |
| 4169 | return (state!=spectrumOK); |
| 4170 | } |
| 4171 | |
| 4172 | // ---------------------------------------------------------------------------- |
| 4173 | // this procedure is called from the interpreter |
no test coverage detected