forked from coin-or/Clp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestBarrier.cpp
45 lines (43 loc) · 1.36 KB
/
testBarrier.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (C) 2003, International Business Machines
// Corporation and others. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).
// @TODO the ifdef WSSMP_BARRIER currently does not work - the define is never set
// best would be if one could tell ClpModel to use the wssmp factorization code, if available, without having to check for some define
#include "ClpInterior.hpp"
#include "ClpSimplex.hpp"
#ifdef WSSMP_BARRIER
#include "ClpCholeskyWssmp.hpp"
#endif
#include "ClpCholeskyDense.hpp"
int main(int argc, const char *argv[])
{
ClpInterior model;
int status;
if (argc < 2) {
#if defined(SAMPLEDIR)
status = model.readMps(SAMPLEDIR "/p0033.mps", true);
#else
fprintf(stderr, "Do not know where to find sample MPS files.\n");
exit(1);
#endif
} else
status = model.readMps(argv[1]);
if (status) {
printf("errors on input\n");
exit(77);
}
// ** note this does not have presolve
#ifdef WSSMP_BARRIER
ClpCholeskyWssmp * cholesky = new ClpCholeskyWssmp();
#else
ClpCholeskyDense * cholesky = new ClpCholeskyDense();
#endif
model.setCholesky(cholesky);
model.primalDual();
// Do crossover
ClpSimplex model2(model);
// make sure no status left
model2.createStatus();
model2.primal(1);
return 0;
}