from mpr_numeric.cc
| 5072 | |
| 5073 | // from mpr_numeric.cc |
| 5074 | lists listOfRoots( rootArranger* self, const unsigned int oprec ) |
| 5075 | { |
| 5076 | int i,j; |
| 5077 | int count= self->roots[0]->getAnzRoots(); // number of roots |
| 5078 | int elem= self->roots[0]->getAnzElems(); // number of koordinates per root |
| 5079 | |
| 5080 | lists listofroots= (lists)omAlloc( sizeof(slists) ); // must be done this way! |
| 5081 | |
| 5082 | if ( self->found_roots ) |
| 5083 | { |
| 5084 | listofroots->Init( count ); |
| 5085 | |
| 5086 | for (i=0; i < count; i++) |
| 5087 | { |
| 5088 | lists onepoint= (lists)omAlloc(sizeof(slists)); // must be done this way! |
| 5089 | onepoint->Init(elem); |
| 5090 | for ( j= 0; j < elem; j++ ) |
| 5091 | { |
| 5092 | if ( !rField_is_long_C(currRing) ) |
| 5093 | { |
| 5094 | onepoint->m[j].rtyp=STRING_CMD; |
| 5095 | onepoint->m[j].data=(void *)complexToStr((*self->roots[j])[i],oprec, currRing->cf); |
| 5096 | } |
| 5097 | else |
| 5098 | { |
| 5099 | onepoint->m[j].rtyp=NUMBER_CMD; |
| 5100 | onepoint->m[j].data=(void *)n_Copy((number)(self->roots[j]->getRoot(i)), currRing->cf); |
| 5101 | } |
| 5102 | onepoint->m[j].next= NULL; |
| 5103 | onepoint->m[j].name= NULL; |
| 5104 | } |
| 5105 | listofroots->m[i].rtyp=LIST_CMD; |
| 5106 | listofroots->m[i].data=(void *)onepoint; |
| 5107 | listofroots->m[j].next= NULL; |
| 5108 | listofroots->m[j].name= NULL; |
| 5109 | } |
| 5110 | |
| 5111 | } |
| 5112 | else |
| 5113 | { |
| 5114 | listofroots->Init( 0 ); |
| 5115 | } |
| 5116 | |
| 5117 | return listofroots; |
| 5118 | } |
| 5119 | |
| 5120 | // from ring.cc |
| 5121 | void rSetHdl(idhdl h) |
no test coverage detected