Changeset 5ff68b in git for gfanlib/gfanlib_matrix.h


Ignore:
Timestamp:
Oct 14, 2014, 10:31:31 PM (10 years ago)
Author:
Yue Ren <ren@…>
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
Message:
chg: new gfanlib version, fixed multiplicities of cones inside fans
File:
1 edited

Legend:

Unmodified
Added
Removed
  • gfanlib/gfanlib_matrix.h

    r5a6083 r5ff68b  
    1919  std::vector<Vector<typ> > rows;
    2020public:
     21  // rowIterator;
     22 // std::vector<Vector<typ> >::iterator rowsBegin(){return rows.begin();}
     23//  std::vector<Vector<typ> >::iterator rowsEnd(){return rows.end();}
    2124  inline int getHeight()const{return height;};
    2225  inline int getWidth()const{return width;};
     
    7679  {
    7780    assert(rows.size()>0);
    78     rows.resize(rows.size()-1);
     81    rows.pop_back();
    7982    height--;
    8083  }
     
    184187    return f;
    185188  }
     189
     190  std::string toString()const
     191  {
     192          std::stringstream f;
     193          f<<*this;
     194          return f.str();
     195  }
     196
    186197  /**
    187198     Swaps the i th and the j th row.
     
    296307  }
    297308  /**
    298      Performs a Gauss reduction and returns the number of row swaps
    299      done.  The result is a matrix in row echelon form. The pivots may
     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
    300311     not be all 1.  In terms of Groebner bases, what is computed is a
    301312     minimal (not necessarily reduced) Groebner basis of the linear
     
    309320  {
    310321    assert(integral || typ::isField());
     322    assert(!makePivotsOne || !integral);
     323
    311324    int retSwaps=0;
    312325    int currentRow=0;
     
    325338            if(makePivotsOne)
    326339              {//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++;
    329341                typ inverse=typ(1)/rows[currentRow][i];
    330342                //                if(!rows[currentRow][i].isOne())
     
    517529  int reduceAndComputeRank()
    518530  {
    519     if (typ::isField())
    520       reduce();
    521     else
    522       reduce(false,true,false);
     531    reduce(false,!typ::isField(),false);
    523532    int ret=0;
    524533    int pivotI=-1;
Note: See TracChangeset for help on using the changeset viewer.