Changeset 9a596d in git for Singular/sparsmat.cc
- Timestamp:
- Jun 4, 1999, 3:06:28 PM (24 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 650ffc4b7f35bd1a1609ce69829132028efa017a
- Parents:
- c801beb15dbf5f6a7997a33c6be813e2a7b471c1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/sparsmat.cc
rc801be r9a596d 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: sparsmat.cc,v 1. 6 1999-06-02 14:09:34pohl Exp $ */4 /* $Id: sparsmat.cc,v 1.7 1999-06-04 13:06:28 pohl Exp $ */ 5 5 6 6 /* … … 119 119 void smPivDel(); 120 120 void smSign(); 121 void smInitPerm(); 121 122 public: 122 123 sparse_mat(ideal); … … 395 396 return res; 396 397 } 398 this->smInitPerm(); 397 399 this->smPivot(); 398 400 this->smSign(); … … 400 402 this->sm1Elim(); 401 403 crd++; 404 m_res[crd] = piv; 402 405 this->smColDel(); 403 406 act--; … … 410 413 if (act < 2) 411 414 { 415 this->smFinalMult(); 416 this->smPivDel(); 412 417 if (act != 0) res = m_act[1]->m; 413 418 Free((void *)m_act[1], sizeof(smprec)); … … 416 421 loop 417 422 { 418 m_res[crd] = piv;419 423 this->smNewPivot(); 420 424 this->smSign(); … … 423 427 this->smHElim(); 424 428 crd++; 429 m_res[crd] = piv; 425 430 this->smColDel(); 426 431 act--; … … 434 439 if (act < 2) 435 440 { 441 this->smFinalMult(); 436 442 this->smPivDel(); 437 443 if (act != 0) res = m_act[1]->m; … … 1376 1382 void sparse_mat::smFinalMult() 1377 1383 { 1378 smpoly a = m_act[act]; 1379 int e = crd; 1384 smpoly a; 1380 1385 poly ha; 1381 1386 int i, f; 1387 int e = crd; 1382 1388 1383 1389 for (i=act; i; i--) … … 1456 1462 void sparse_mat::smPivDel() 1457 1463 { 1458 int i=crd -1;1464 int i=crd; 1459 1465 1460 1466 while (i != 0) … … 1470 1476 void sparse_mat::smSign() 1471 1477 { 1472 int j,i=1; 1473 if (cpiv!=act) sign=-sign; 1474 if ((act%2)==0) sign=-sign; 1475 j=perm[1]; 1476 while(j<rpiv) 1477 { 1478 sign=-sign; 1479 i++; 1480 j=perm[i]; 1481 } 1482 while(perm[i]!=0) 1483 { 1484 perm[i]=perm[i+1]; 1485 i++; 1486 } 1478 int j,i; 1479 if (act > 2) 1480 { 1481 if (cpiv!=act) sign=-sign; 1482 if ((act%2)==0) sign=-sign; 1483 i=1; 1484 j=perm[1]; 1485 while(j<rpiv) 1486 { 1487 sign=-sign; 1488 i++; 1489 j=perm[i]; 1490 } 1491 while(perm[i]!=0) 1492 { 1493 perm[i]=perm[i+1]; 1494 i++; 1495 } 1496 } 1497 else 1498 { 1499 if (cpiv!=1) sign=-sign; 1500 if (rpiv!=perm[1]) sign=-sign; 1501 } 1502 } 1503 1504 void sparse_mat::smInitPerm() 1505 { 1506 int i; 1507 for (i=act;i;i--) perm[i]=i; 1487 1508 } 1488 1509 … … 2071 2092 } 2072 2093 } 2094
Note: See TracChangeset
for help on using the changeset viewer.