source: trunk/Clp/examples/decomp2.cpp

Last change on this file was 2278, checked in by forrest, 4 months ago

COIN_BIG_INDEX 2 changes

  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1/* $Id: decomp2.cpp 2278 2017-10-02 09:51:14Z forrest $ */
2// Copyright (C) 2008, 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#include "ClpSimplex.hpp"
7#include "CoinStructuredModel.hpp"
8#include <iomanip>
9
10int main(int argc, const char *argv[])
11{
12#if COIN_BIG_INDEX<2
13     /* Create a structured model by reading mps file and trying
14        Dantzig-Wolfe decomposition (that's the 1 parameter)
15     */
16     // At present D-W rows are hard coded - will move stuff from OSL
17#if defined(NETLIBDIR)
18     CoinStructuredModel model((argc < 2) ? NETLIBDIR "/czprob.mps"
19                               : argv[1], 1);
20#else
21     if (argc<2) {
22          fprintf(stderr, "Do not know where to find netlib MPS files.\n");
23          return 1;
24     }
25     CoinStructuredModel model(argv[1], 1);
26#endif
27     if (!model.numberRows())
28          exit(10);
29     // Get default solver - could change stuff
30     ClpSimplex solver;
31     /*
32       This driver does a simple Dantzig Wolfe decomposition
33     */
34     solver.solve(&model);
35     // Double check
36     solver.primal(1);
37#else
38     printf("decomp2 not available with COIN_BIG_INDEX=2\n");
39#endif
40     return 0;
41}
Note: See TracBrowser for help on using the repository browser.