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

Last change on this file since 1662 was 1662, checked in by lou, 8 years ago

Add EPL license notice in examples.

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