Changeset 5ff68b in git for gfanlib/gfanlib_matrix.h
- Timestamp:
- Oct 14, 2014, 10:31:31 PM (10 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 97351e66f70a4390d6f911ee38436e695b8ec551
- Parents:
- 5a60835ee02dcb3d57c9e469c5d50e25ec5d29db
- git-author:
- Yue Ren <ren@mathematik.uni-kl.de>2014-10-14 23:31:31+03:00
- git-committer:
- Yue Ren <ren@mathematik.uni-kl.de>2015-02-06 13:47:01+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gfanlib/gfanlib_matrix.h
r5a6083 r5ff68b 19 19 std::vector<Vector<typ> > rows; 20 20 public: 21 // rowIterator; 22 // std::vector<Vector<typ> >::iterator rowsBegin(){return rows.begin();} 23 // std::vector<Vector<typ> >::iterator rowsEnd(){return rows.end();} 21 24 inline int getHeight()const{return height;}; 22 25 inline int getWidth()const{return width;}; … … 76 79 { 77 80 assert(rows.size()>0); 78 rows. resize(rows.size()-1);81 rows.pop_back(); 79 82 height--; 80 83 } … … 184 187 return f; 185 188 } 189 190 std::string toString()const 191 { 192 std::stringstream f; 193 f<<*this; 194 return f.str(); 195 } 196 186 197 /** 187 198 Swaps the i th and the j th row. … … 296 307 } 297 308 /** 298 Performs a Gauss reduction and returns the number of row swaps 299 done. 309 Performs a Gauss reduction and returns the number of row swaps (and negative scalings) 310 done. The result is a matrix in row echelon form. The pivots may 300 311 not be all 1. In terms of Groebner bases, what is computed is a 301 312 minimal (not necessarily reduced) Groebner basis of the linear … … 309 320 { 310 321 assert(integral || typ::isField()); 322 assert(!makePivotsOne || !integral); 323 311 324 int retSwaps=0; 312 325 int currentRow=0; … … 325 338 if(makePivotsOne) 326 339 {//THE PIVOT SHOULD BE SET TO ONE IF INTEGRAL IS FALSE 327 if(rows[currentRow][i].sign()>=0) 328 retSwaps++; 340 if(rows[currentRow][i].sign()>=0)retSwaps++; 329 341 typ inverse=typ(1)/rows[currentRow][i]; 330 342 // if(!rows[currentRow][i].isOne()) … … 517 529 int reduceAndComputeRank() 518 530 { 519 if (typ::isField()) 520 reduce(); 521 else 522 reduce(false,true,false); 531 reduce(false,!typ::isField(),false); 523 532 int ret=0; 524 533 int pivotI=-1;
Note: See TracChangeset
for help on using the changeset viewer.