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

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

merge split branch into trunk

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