Changeset 8a839d1 in git
- Timestamp:
- Sep 22, 1998, 12:29:45 PM (25 years ago)
- Branches:
- (u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
- Children:
- e0d91ca23156d80a43dde9ffd342ab947b5cc298
- Parents:
- 3ab190a8d35777d9a45959eb4ca0dedfb3ec5683
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/mpsr_Put.cc
r3ab190 r8a839d1 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpsr_Put.cc,v 1.1 1 1998-09-21 12:42:10Singular Exp $ */4 /* $Id: mpsr_Put.cc,v 1.12 1998-09-22 10:29:45 Singular Exp $ */ 5 5 6 6 … … 13 13 * Change History (most recent first): 14 14 * o 1/97 obachman 15 * Updated putting routines to MP and MPP v1.1 15 * Updated putting routines to MP and MPP v1.1 16 16 * 17 17 ***************************************************************/ … … 131 131 case NONE: 132 132 return mpsr_Success; 133 133 134 134 default: 135 135 return mpsr_SetError(mpsr_UnknownLeftvType); … … 144 144 { 145 145 int length = iv->length(); 146 147 // Put the Vector Operator 146 147 // Put the Vector Operator 148 148 mp_failr(MP_PutCommonOperatorPacket(link, 149 149 MP_MatrixDict, … … 151 151 1, 152 152 length)); 153 // Prototype Annot 153 // Prototype Annot 154 154 mp_failr(MP_PutAnnotationPacket(link, 155 155 MP_ProtoDict, … … 157 157 MP_AnnotReqValNode)); 158 158 // Together with the CommonMetaTypePacket specifying that each element of 159 // the vector is an Sint32 159 // the vector is an Sint32 160 160 mp_failr(MP_PutCommonMetaTypePacket(link, 161 161 MP_ProtoDict, 162 162 MP_CmtProtoIMP_Sint32, 163 163 0)); 164 165 // Now we finally put the data 164 165 // Now we finally put the data 166 166 mp_return(IMP_PutSint32Vector(link, (MP_Sint32_t *) iv->ivGetVec(), 167 167 length)); … … 172 172 int r = iv->rows(), c = iv->cols(), length = r*c; 173 173 174 // First, we put the Matrix operator 174 // First, we put the Matrix operator 175 175 mp_failr(MP_PutCommonOperatorPacket(link, 176 176 MP_MatrixDict, … … 178 178 2, 179 179 length)); 180 // Put the two annotations 181 // First, the prototype annot 180 // Put the two annotations 181 // First, the prototype annot 182 182 mp_failr(MP_PutAnnotationPacket(link, 183 183 MP_ProtoDict, … … 188 188 MP_CmtProtoIMP_Sint32, 189 189 0)); 190 // And second, the dimension annot 190 // And second, the dimension annot 191 191 mp_failr(MP_PutAnnotationPacket(link, 192 192 MP_MatrixDict, … … 202 202 mp_failr(MP_PutUint32Packet(link, (MP_Uint32_t) c, 0)); 203 203 204 // And finally, we put the elments 204 // And finally, we put the elments 205 205 mp_return(IMP_PutSint32Vector(link, (MP_Sint32_t *) iv->ivGetVec(), 206 206 length)); … … 224 224 225 225 failr(mpsr_tok2mp('=', &dict, &cop)); 226 226 227 227 // A Singular- procedure is sent as a cop with the string as arg 228 228 mp_failr(MP_PutCommonOperatorPacket(link, 229 230 231 232 229 dict, 230 cop, 231 0, 232 2)); 233 233 mp_failr(MP_PutIdentifierPacket(link, MP_SingularDict, pname,1)); 234 234 mp_failr(MP_PutAnnotationPacket(link, 235 236 237 235 MP_SingularDict, 236 MP_AnnotSingularProcDef, 237 0)); 238 238 if( proc->language == LANG_SINGULAR) { 239 239 if (proc->data.s.body == NULL) … … 336 336 mpsr_SetCurrRing(cring, TRUE); 337 337 } 338 338 339 339 if (!nIsZero(n)) 340 340 { … … 346 346 347 347 if (rr != NULL) mpsr_SetCurrRing(rr, TRUE); 348 348 349 349 return r; 350 350 } … … 421 421 0)); 422 422 failr(mpsr_PutRingAnnots(link, cring, 1)); 423 423 424 424 mp_failr(MP_PutAnnotationPacket(link, 425 425 MP_PolyDict, … … 427 427 MP_AnnotValuated)); 428 428 mp_failr(MP_PutUint32Packet(link, id->rank, 0)); 429 429 430 430 for (i=0; i < idn; i++) 431 431 { … … 441 441 MP_Uint32_t n = nrows*ncols, i; 442 442 443 // First, we put the Matrix operator 443 // First, we put the Matrix operator 444 444 mp_failr(MP_PutCommonOperatorPacket(link, 445 445 MP_MatrixDict, … … 447 447 2, 448 448 n)); 449 // Put the two annotations 450 // First, the prototype annot 449 // Put the two annotations 450 // First, the prototype annot 451 451 mp_failr(MP_PutAnnotationPacket(link, 452 452 MP_ProtoDict, … … 473 473 mp_failr(MP_PutUint32Packet(link, (MP_Uint32_t) ncols, 0)); 474 474 475 // And finally, we put the elments 475 // And finally, we put the elments 476 476 for (i=0; i < n; i++) 477 477 { … … 507 507 // Second, the name of the ring 508 508 mp_failr(MP_PutStringPacket(link, m->preimage,0)); 509 509 510 510 // and third, the ideal -- 511 511 // supposing that we can cast a map to an ideal … … 515 515 516 516 /*************************************************************** 517 * 517 * 518 518 * A routine which dumps the content of Singular to a file 519 519 * … … 532 532 cmd.arg1.rtyp = DEF_CMD; 533 533 lv = mpsr_InitLeftv(COMMAND, (void *) &cmd); 534 534 535 535 MP_ResetLink(link); 536 536 while (h != NULL && h2 == NULL) 537 537 { 538 538 539 539 if (IDTYP(h) == PROC_CMD) 540 540 { … … 569 569 cmd.arg1.name = IDID(h2); 570 570 //memcpy(&(cmd.arg2), h2, sizeof(sleftv)); 571 cmd.arg2.data=IDDATA(h );572 cmd.arg2.flag=h ->flag;573 cmd.arg2.attribute=h ->attribute;574 cmd.arg2.rtyp=h ->typ;571 cmd.arg2.data=IDDATA(h2); 572 cmd.arg2.flag=h2->flag; 573 cmd.arg2.attribute=h2->attribute; 574 cmd.arg2.rtyp=h2->typ; 575 575 if (mpsr_PutLeftv(link, lv, r) != mpsr_Success) break; 576 576 #ifdef MPSR_DEBUG … … 581 581 } 582 582 } 583 583 584 584 h = h->next; 585 585 } … … 587 587 Free(lv, sizeof(sleftv)); 588 588 if (rh != NULL && rh != currRingHdl) rSetHdl(rh, TRUE); 589 589 590 590 if (h == NULL && h2 == NULL) 591 591 return mpsr_Success; … … 593 593 return mpsr_Failure; 594 594 } 595 595 596 596 #endif // HAVE_MPSR 597 597
Note: See TracChangeset
for help on using the changeset viewer.