- Timestamp:
- Nov 13, 1997, 10:09:28 AM (27 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
- Children:
- 57eacd52438439e0ee05601a56132738dd1d14a1
- Parents:
- 2012e62a5af6086d406b892ed90b543f56d4fae0
- Location:
- Singular
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/extra.cc
r2012e6 r52b370b 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: extra.cc,v 1.2 1 1997-10-18 11:04:13 SingularExp $ */4 /* $Id: extra.cc,v 1.22 1997-11-13 09:09:26 siebert Exp $ */ 5 5 /* 6 6 * ABSTRACT: general interface to internals of Singular ("system" command) … … 344 344 if(strcmp((char*)(h->Data()),"red")==0) 345 345 { 346 346 if ((h->next!=NULL) &&(h->next->Typ()==IDEAL_CMD)) 347 347 { 348 348 res->rtyp=IDEAL_CMD; … … 608 608 else 609 609 #endif 610 /*==================== barstep =============================*/ 611 if(strcmp((char*)(h->Data()),"barstep")==0) 612 { 613 if ((h->next!=NULL) &&(h->next->Typ()==MATRIX_CMD)) 614 { 615 if (h->next->next!=NULL) 616 { 617 if (h->next->next->Typ()!=POLY_CMD) 618 { 619 Warn("Wrong types for barstep(matrix,poly)"); 620 } 621 } 622 int r,c; 623 poly div=(poly)h->next->next->Data(); 624 res->rtyp=MATRIX_CMD; 625 res->data=(void *)mpOneStepBareiss((matrix)h->next->Data(), 626 &div,&r,&c); 627 Print("div: ");pWrite(div); 628 Print("rows: %d, cols: %d\n",r,c); 629 pDelete(&div); 630 return FALSE; 631 } 632 else 633 WerrorS("matrix expected"); 634 } 610 635 /*============================================================*/ 611 636 WerrorS("not implemented\n"); -
Singular/matpol.cc
r2012e6 r52b370b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: matpol.cc,v 1. 3 1997-04-02 15:07:25 SingularExp $ */4 /* $Id: matpol.cc,v 1.4 1997-11-13 09:09:27 siebert Exp $ */ 5 5 6 6 /* … … 319 319 mp_permmatrix(mp_permmatrix *); 320 320 ~mp_permmatrix(); 321 int mpGetRow(); 322 int mpGetCol(); 321 323 int mpGetRdim(); 322 324 int mpGetCdim(); … … 370 372 delete v; 371 373 return c; 374 } 375 376 /*2 377 * one step of 'Bareiss' algorithm 378 * for application in minor 379 * assume to have a full matrix 380 * if *H!=0, then divide by *H (the pivot from the step before) 381 * returns the choosen pivot *H=m[*r,*c] 382 * the result has the pivot at the right lower corner 383 */ 384 matrix mpOneStepBareiss (matrix a, poly *H, int *r, int *c) 385 { 386 poly div=*H; 387 matrix re = mpCopy(a); 388 mp_permmatrix *Bareiss = new mp_permmatrix(re); 389 row_col_weight w(Bareiss->mpGetRdim(), Bareiss->mpGetCdim()); 390 391 /* step of Bareiss */ 392 if(Bareiss->mpPivotBareiss(&w)) 393 { 394 Bareiss->mpElimBareiss(div); 395 div = Bareiss->mpGetElem(Bareiss->mpGetRdim(), Bareiss->mpGetCdim()); 396 *H = pCopy(div); 397 *c = Bareiss->mpGetCol()+1; 398 *r = Bareiss->mpGetRow()+1; 399 Bareiss->mpRowReorder(); 400 Bareiss->mpColReorder(); 401 } 402 else 403 { 404 *H = NULL; 405 *c = *r = 0; 406 } 407 Bareiss->mpSaveArray(); 408 delete Bareiss; 409 return re; 372 410 } 373 411 … … 1208 1246 } 1209 1247 1248 int mp_permmatrix::mpGetRow() 1249 { 1250 return qrow[s_m]; 1251 } 1252 1253 int mp_permmatrix::mpGetCol() 1254 { 1255 return qcol[s_n]; 1256 } 1257 1210 1258 /*2 1211 1259 * exact division a/b, used in Bareiss algorithm -
Singular/matpol.h
r2012e6 r52b370b 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: matpol.h,v 1. 4 1997-04-09 12:19:58 SingularExp $ */6 /* $Id: matpol.h,v 1.5 1997-11-13 09:09:28 siebert Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 47 47 48 48 matrix mpBareiss (matrix a, BOOLEAN diagonal); 49 matrix mpOneStepBareiss (matrix a, poly *H, int *r, int *c); 49 50 poly mpDet (matrix m); 50 51 matrix mpWedge(matrix a, int ar);
Note: See TracChangeset
for help on using the changeset viewer.