mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
add stand-alone simplex
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
c6a9dae00a
commit
26a3d2ca31
9 changed files with 1560 additions and 20 deletions
24
src/test/simplex.cpp
Normal file
24
src/test/simplex.cpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
#include "sparse_matrix.h"
|
||||
#include "sparse_matrix_def.h"
|
||||
#include "simplex.h"
|
||||
#include "simplex_def.h"
|
||||
|
||||
typedef simplex::simplex<simplex::mpz_ext> Simplex;
|
||||
|
||||
void tst_simplex() {
|
||||
simplex::sparse_matrix<simplex::mpz_ext> M;
|
||||
Simplex S;
|
||||
|
||||
S.make_feasible();
|
||||
|
||||
unsynch_mpz_manager m;
|
||||
scoped_mpz_vector coeffs(m);
|
||||
svector<unsigned> vars;
|
||||
for (unsigned i = 0; i < 5; ++i) {
|
||||
S.ensure_var(i);
|
||||
vars.push_back(i);
|
||||
coeffs.push_back(mpz(i+1));
|
||||
}
|
||||
|
||||
Simplex::row r = S.add_row(1, coeffs.size(), vars.c_ptr(), coeffs.c_ptr());
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue