source: trunk/Clp/examples/testBarrier.cpp

Last change on this file was 1734, checked in by stefan, 7 years ago

change to new way on how to use and install configuration header files

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.4 KB
Line 
1/* $Id: testBarrier.cpp 1734 2011-06-08 17:28:29Z forrest $ */
2// Copyright (C) 2003, International Business Machines
3// Corporation and others.  All Rights Reserved.
4// This code is licensed under the terms of the Eclipse Public License (EPL).
5
6// @TODO the ifdef WSSMP_BARRIER currently does not work - the define is never set
7// best would be if one could tell ClpModel to use the wssmp factorization code, if available, without having to check for some define
8
9#include "ClpInterior.hpp"
10#include "ClpSimplex.hpp"
11#ifdef WSSMP_BARRIER
12#include "ClpCholeskyWssmp.hpp"
13#endif
14#include "ClpCholeskyDense.hpp"
15int main(int argc, const char *argv[])
16{
17     ClpInterior  model;
18     int status;
19     if (argc < 2) {
20#if defined(SAMPLEDIR)
21          status = model.readMps(SAMPLEDIR "/p0033.mps", true);
22#else
23          fprintf(stderr, "Do not know where to find sample MPS files.\n");
24          exit(1);
25#endif
26     } else
27          status = model.readMps(argv[1]);
28     if (status) {
29          printf("errors on input\n");
30          exit(77);
31     }
32     // ** note this does not have presolve
33#ifdef WSSMP_BARRIER
34     ClpCholeskyWssmp * cholesky = new ClpCholeskyWssmp();
35#else
36     ClpCholeskyDense * cholesky = new ClpCholeskyDense();
37#endif
38     model.setCholesky(cholesky);
39     model.primalDual();
40     // Do crossover
41     ClpSimplex model2(model);
42     // make sure no status left
43     model2.createStatus();
44     model2.primal(1);
45     return 0;
46}
Note: See TracBrowser for help on using the repository browser.