source: trunk/Clp/src/ClpSimplexNonlinear.hpp @ 2030

Last change on this file since 2030 was 2025, checked in by forrest, 5 years ago

mainly dantzig-wolfe - also Clp strong branching (rather than OsiClp?)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.0 KB
Line 
1/* $Id: ClpSimplexNonlinear.hpp 2025 2014-03-19 12:49:55Z forrest $ */
2// Copyright (C) 2004, 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   Authors
7
8   John Forrest
9
10 */
11#ifndef ClpSimplexNonlinear_H
12#define ClpSimplexNonlinear_H
13
14class ClpNonlinearInfo;
15class ClpQuadraticObjective;
16class ClpConstraint;
17
18#include "ClpSimplexPrimal.hpp"
19
20/** This solves non-linear LPs using the primal simplex method
21
22    It inherits from ClpSimplexPrimal.  It has no data of its own and
23    is never created - only cast from a ClpSimplexPrimal object at algorithm time.
24    If needed create new class and pass around
25
26*/
27
28class ClpSimplexNonlinear : public ClpSimplexPrimal {
29
30public:
31
32     /**@name Description of algorithm */
33     //@{
34     /** Primal algorithms for reduced gradient
35         At present we have two algorithms:
36
37     */
38     /// A reduced gradient method.
39     int primal();
40     /** Primal algorithm for quadratic
41         Using a semi-trust region approach as for pooling problem
42         This is in because I have it lying around
43     */
44     int primalSLP(int numberPasses, double deltaTolerance,
45                int otherOptions=0);
46     /// May use a cut approach for solving any LP
47     int primalDualCuts(char * rowsIn, int startUp, int algorithm);
48     /** Primal algorithm for nonlinear constraints
49         Using a semi-trust region approach as for pooling problem
50         This is in because I have it lying around
51
52     */
53     int primalSLP(int numberConstraints, ClpConstraint ** constraints,
54                   int numberPasses, double deltaTolerance);
55
56     /** Creates direction vector.  note longArray is long enough
57         for rows and columns.  If numberNonBasic 0 then is updated
58         otherwise mode is ignored and those are used.
59         Norms are only for those > 1.0e3*dualTolerance
60         If mode is nonzero then just largest dj */
61     void directionVector (CoinIndexedVector * longArray,
62                           CoinIndexedVector * spare1, CoinIndexedVector * spare2,
63                           int mode,
64                           double & normFlagged, double & normUnflagged,
65                           int & numberNonBasic);
66     /// Main part.
67     int whileIterating (int & pivotMode);
68     /**
69         longArray has direction
70         pivotMode -
71               0 - use all dual infeasible variables
72           1 - largest dj
73           while >= 10 trying startup phase
74         Returns 0 - can do normal iteration (basis change)
75         1 - no basis change
76         2 - if wants singleton
77         3 - if time to re-factorize
78         If sequenceIn_ >=0 then that will be incoming variable
79     */
80     int pivotColumn(CoinIndexedVector * longArray,
81                     CoinIndexedVector * rowArray,
82                     CoinIndexedVector * columnArray,
83                     CoinIndexedVector * spare,
84                     int & pivotMode,
85                     double & solutionError,
86                     double * array1);
87     /**  Refactorizes if necessary
88          Checks if finished.  Updates status.
89          lastCleaned refers to iteration at which some objective/feasibility
90          cleaning too place.
91
92          type - 0 initial so set up save arrays etc
93               - 1 normal -if good update save
94           - 2 restoring from saved
95     */
96     void statusOfProblemInPrimal(int & lastCleaned, int type,
97                                  ClpSimplexProgress * progress,
98                                  bool doFactorization,
99                                  double & bestObjectiveWhenFlagged);
100     /** Do last half of an iteration.
101         Return codes
102         Reasons to come out normal mode
103         -1 normal
104         -2 factorize now - good iteration
105         -3 slight inaccuracy - refactorize - iteration done
106         -4 inaccuracy - refactorize - no iteration
107         -5 something flagged - go round again
108         +2 looks unbounded
109         +3 max iterations (iteration done)
110
111     */
112     int pivotNonlinearResult();
113     //@}
114
115};
116#endif
117
Note: See TracBrowser for help on using the repository browser.