Skip to content

Commit

Permalink
Forrest-Tomlin (#29)
Browse files Browse the repository at this point in the history
* test

* when performing a forward transformation as part of a simplex step,
store "w" for later use when the basis is being updated

* find the index of a row in the permutation matrix

* more work on pushEtaMatrix(): update the _A matrices according to the
new eta matrix.

* refactoring: we know that always R=invQ, so just compute it once (when
Q) is changed and use it afterwards. Eliminated the R terminology.

* use Q, not R

* update the factorization when an eta matrix is pushed

* small bug fix

* done working on pushEtaMatrix, test now passes.

* store and restore operations for the new FT basis

* added functionality for computing the explicit basis from an FT factorization

* keep track of the availability of the explicit basis

* dumping functionality

* unit test + bug fix for explicit basis computation

* initial work on basis inversion using FT factorization

* bug fix

* todo

* removed a too-strong assertion

* use FT by default.
Bug fix.
All unit tests now pass

* get rid of the concept of "storedW"
add Duligur's fix for cost function resizing

* bug fixes and optimizations in BTRAN and FTRAN

* optimizations

* bug fix

* comment

* minor

* Switching to a non-fixed number of AlmostIdentityMatrices

* bug fix in LU factorization

* a test for comparing the two factorizations

* git ignore

* refactorize when the number of A matrices exceeds a threshold

* undo a couple of changes before merge

* fix broken test

* allocate work memory once-and-for-all
  • Loading branch information
guykatzz authored May 7, 2018
1 parent 8880a76 commit 95f74e6
Show file tree
Hide file tree
Showing 18 changed files with 1,086 additions and 267 deletions.
1 change: 1 addition & 0 deletions src/basis_factorization/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.cxx
26 changes: 18 additions & 8 deletions src/basis_factorization/AlmostIdentityMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,29 @@
class AlmostIdentityMatrix
{
public:
unsigned _row;
unsigned _column;
double _value;

AlmostIdentityMatrix()
: _identity( true )
{
}

/*
True iff this is the identity matrix.
*/
bool _identity;
AlmostIdentityMatrix( const AlmostIdentityMatrix &other )
: _row( other._row )
, _column( other._column )
, _value( other._value )
{
}

AlmostIdentityMatrix &operator=( const AlmostIdentityMatrix &other )
{
_row = other._row;
_column = other._column;
_value = other._value;

unsigned _row;
unsigned _column;
double _value;
return *this;
}
};

#endif // __AlmostIdentityMatrix_h__
Expand Down
2 changes: 2 additions & 0 deletions src/basis_factorization/BasisFactorizationError.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class BasisFactorizationError : public Error
ALLOCATION_FAILED = 0,
CANT_INVERT_BASIS_BECAUSE_OF_ETAS = 1,
UNKNOWN_BASIS_FACTORIZATION_TYPE = 2,
CORRUPT_PERMUATION_MATRIX = 3,
CANT_INVERT_BASIS_BECAUSE_BASIS_ISNT_AVAILABLE = 4,
};

BasisFactorizationError( BasisFactorizationError::Code code ) :
Expand Down
2 changes: 1 addition & 1 deletion src/basis_factorization/EtaMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ EtaMatrix::~EtaMatrix()
}
}

void EtaMatrix::dump()
void EtaMatrix::dump() const
{
printf( "Dumping eta matrix\n" );
printf( "\tm = %u. column index = %u\n", _m, _columnIndex );
Expand Down
2 changes: 1 addition & 1 deletion src/basis_factorization/EtaMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class EtaMatrix
EtaMatrix &operator=( const EtaMatrix &other );

~EtaMatrix();
void dump();
void dump() const;
void toMatrix( double *A );

void resetToIdentity();
Expand Down
Loading

0 comments on commit 95f74e6

Please sign in to comment.