source: trunk/Clp/src/ClpPdcoBase.hpp @ 2271

Last change on this file since 2271 was 1665, checked in by lou, 9 years ago

Add EPL license notice in src.

  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1/* $Id: ClpPdcoBase.hpp 1665 2011-01-04 17:55:54Z forrest $ */
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#ifndef ClpPdcoBase_H
7#define ClpPdcoBase_H
8
9#include "CoinPragma.hpp"
10
11#include "CoinPackedMatrix.hpp"
12#include "CoinDenseVector.hpp"
13class ClpInterior;
14
15/** Abstract base class for tailoring everything for Pcdo
16
17    Since this class is abstract, no object of this type can be created.
18
19    If a derived class provides all methods then all ClpPcdo algorithms
20    should work.
21
22    Eventually we should be able to use ClpObjective and ClpMatrixBase.
23*/
24
25class ClpPdcoBase  {
26
27public:
28     /**@name Virtual methods that the derived classes must provide */
29     //@{
30     virtual void matVecMult(ClpInterior * model, int mode, double * x, double * y) const = 0;
31
32     virtual void getGrad(ClpInterior * model, CoinDenseVector<double> &x, CoinDenseVector<double> &grad) const = 0;
33
34     virtual void getHessian(ClpInterior * model, CoinDenseVector<double> &x, CoinDenseVector<double> &H) const = 0;
35
36     virtual double getObj(ClpInterior * model, CoinDenseVector<double> &x) const = 0;
37
38     virtual void matPrecon(ClpInterior * model,  double delta, double * x, double * y) const = 0;
39
40     //@}
41     //@{
42     ///@name Other
43     /// Clone
44     virtual ClpPdcoBase * clone() const = 0;
45     /// Returns type
46     inline int type() const {
47          return type_;
48     };
49     /// Sets type
50     inline void setType(int type) {
51          type_ = type;
52     };
53     /// Returns size of d1
54     inline int sizeD1() const {
55          return 1;
56     };
57     /// Returns d1 as scalar
58     inline double getD1() const {
59          return d1_;
60     };
61     /// Returns size of d2
62     inline int sizeD2() const {
63          return 1;
64     };
65     /// Returns d2 as scalar
66     inline double getD2() const {
67          return d2_;
68     };
69     //@}
70
71
72protected:
73
74     /**@name Constructors, destructor<br>
75        <strong>NOTE</strong>: All constructors are protected. There's no need
76        to expose them, after all, this is an abstract class. */
77     //@{
78     /** Default constructor. */
79     ClpPdcoBase();
80     /** Destructor (has to be public) */
81public:
82     virtual ~ClpPdcoBase();
83protected:
84     // Copy
85     ClpPdcoBase(const ClpPdcoBase&);
86     // Assignment
87     ClpPdcoBase& operator=(const ClpPdcoBase&);
88     //@}
89
90
91protected:
92     /**@name Data members
93        The data members are protected to allow access for derived classes. */
94     //@{
95     /// Should be dense vectors
96     double d1_;
97     double d2_;
98     /// type (may be useful)
99     int type_;
100     //@}
101};
102
103#endif
Note: See TracBrowser for help on using the repository browser.