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

Last change on this file since 1525 was 1525, checked in by mjs, 10 years ago

Formatted .cpp, .hpp, .c, .h files with "astyle -A4 -p". This matches the formatting used in the grand CBC reorganization.

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