source: trunk/Clp/examples/pdco.cpp @ 1171

Last change on this file since 1171 was 1171, checked in by forrest, 12 years ago

put back pdco in case wanted

File size: 1.8 KB
Line 
1// Copyright (C) 2003, International Business Machines
2// Corporation and others.  All Rights Reserved.
3
4
5// It also tests pdco
6
7// This reads a network problem created by netgen which can be
8// downloaded from www.netlib.org/lp/generators/netgen
9// This is a generator due to Darwin Klingman
10
11#include "ClpInterior.hpp"
12#include "myPdco.hpp"
13#include <stdio.h>
14#include <assert.h>
15#include <cmath>
16
17int main (int argc, const char *argv[])
18{
19
20  // Get model in some way
21  ClpInterior model;
22  // Open graph and parameter files
23  //FILE *fpin = fopen("./g.graph","r");
24  //FILE *fpp = fopen("./gparm","r");
25  FILE *fpin = fopen("./g.tiny","r");
26  FILE *fpp = fopen("./gparm.tiny","r");
27  assert(fpin);
28  assert(fpp);
29  myPdco stuff(model,fpin,fpp);
30  Info info;
31  Outfo outfo;
32  Options options;
33 
34
35  /*
36   *     Set the input parameters for LSQR.
37   */
38  options.gamma = stuff.getD1();
39  options.delta = stuff.getD2();
40  options.MaxIter = 40;
41  options.FeaTol = 5.0e-4;
42  options.OptTol = 5.0e-4;
43  options.StepTol = 0.99;
44  //  options.x0min = 10.0/num_cols;
45  options.x0min = 0.01;
46  options.z0min = 0.01;
47  options.mu0 = 1.0e-6;
48  options.LSmethod = 3;   // 1=Cholesky    2=QR    3=LSQR
49  options.LSproblem = 1;  // See below
50  options.LSQRMaxIter = 999;
51  options.LSQRatol1 = 1.0e-3; // Initial  atol
52  options.LSQRatol2 = 1.0e-6; // Smallest atol (unless atol1 is smaller)
53  options.LSQRconlim = 1.0e12;
54  info.atolmin = options.LSQRatol2;
55  info.LSdamp = 0.0;
56  // These are already set?
57  model.xsize_ = 50.0/(model.numberColumns());
58  model.xsize_ = min( 1.0, model.xsize_);
59
60  /*
61   *     Solve the test problem
62   */
63  model.pdco( &stuff, options, info, outfo);
64
65  /*
66   *     Examine the results.
67   *     Print the residual norms RNORM and ARNORM given by LSQR, and then compute
68   */
69  return 0;
70}   
Note: See TracBrowser for help on using the repository browser.