source: stable/1.13/Clp/examples/decomp2.cpp @ 1898

Last change on this file since 1898 was 1561, checked in by stefan, 10 years ago

make check for sample dir work without including ClpConfig?.h

  • Property svn:keywords set to Id
File size: 1.0 KB
Line 
1/* $Id: decomp2.cpp 1561 2010-06-13 13:08:03Z stefan $ */
2// Copyright (C) 2008, International Business Machines
3// Corporation and others.  All Rights Reserved.
4
5#include "ClpSimplex.hpp"
6#include "CoinStructuredModel.hpp"
7#include <iomanip>
8
9int main(int argc, const char *argv[])
10{
11     /* Create a structured model by reading mps file and trying
12        Dantzig-Wolfe decomposition (that's the 1 parameter)
13     */
14     // At present D-W rows are hard coded - will move stuff from OSL
15#if defined(NETLIBDIR)
16     CoinStructuredModel model((argc < 2) ? NETLIBDIR "/czprob.mps"
17                               : argv[1], 1);
18#else
19     if (argc<2) {
20          fprintf(stderr, "Do not know where to find netlib MPS files.\n");
21          return 1;
22     }
23     CoinStructuredModel model(argv[1], 1);
24#endif
25     if (!model.numberRows())
26          exit(10);
27     // Get default solver - could change stuff
28     ClpSimplex solver;
29     /*
30       This driver does a simple Dantzig Wolfe decomposition
31     */
32     solver.solve(&model);
33     // Double check
34     solver.primal(1);
35     return 0;
36}
Note: See TracBrowser for help on using the repository browser.