source: branches/devel/Clp/examples/testSmall.cpp @ 842

Last change on this file since 842 was 842, checked in by forrest, 15 years ago

fix bug

File size: 1.1 KB
Line 
1// Copyright (C) 2006, International Business Machines
2// Corporation and others.  All Rights Reserved.
3
4#include "ClpSimplex.hpp"
5#include "ClpSmallMatrix.hpp"
6#include "CoinMpsIO.hpp"
7#include "CoinTime.hpp"
8
9int main (int argc, const char *argv[])
10{
11  ClpSimplex  model;
12  int status;
13  // Keep names
14  if (argc<2) {
15    status=model.readMps("../../Data/Netlib/czprob.mps",true);
16  } else {
17    status=model.readMps(argv[1],true);
18  }
19  if (status)
20    exit(10);
21  /*
22    This driver checks small matrix works
23  */
24  int numberRows = model.numberRows();
25  assert (numberRows<65536);
26  // get small matrix
27  ClpSmallMatrix * smallMatrix = new ClpSmallMatrix(*model.matrix());
28  // replace and delete original
29  model.setSpecialOptions(256); // to say no row copy
30  model.replaceMatrix(smallMatrix,true);
31  double time1 = CoinCpuTime();
32  //model.setLogLevel(63);
33  model.dual();
34  printf("Dual took %g seconds\n",CoinCpuTime()-time1);
35  model.dual();
36  model.allSlackBasis();
37  model.primal();
38  model.primal(1);
39  memset(model.statusArray(),0,model.numberColumns());
40  model.primal(1);
41  return 0;
42}   
Note: See TracBrowser for help on using the repository browser.