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

Last change on this file since 2385 was 2385, checked in by unxusr, 4 months ago

formatting

  • Property svn:keywords set to Id
File size: 2.5 KB
Line 
1/* $Id: ClpPdcoBase.hpp 2385 2019-01-06 19:43:06Z unxusr $ */
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  {
48    return type_;
49  };
50  /// Sets type
51  inline void setType(int type)
52  {
53    type_ = type;
54  };
55  /// Returns size of d1
56  inline int sizeD1() const
57  {
58    return 1;
59  };
60  /// Returns d1 as scalar
61  inline double getD1() const
62  {
63    return d1_;
64  };
65  /// Returns size of d2
66  inline int sizeD2() const
67  {
68    return 1;
69  };
70  /// Returns d2 as scalar
71  inline double getD2() const
72  {
73    return d2_;
74  };
75  //@}
76
77protected:
78  /**@name Constructors, destructor<br>
79        <strong>NOTE</strong>: All constructors are protected. There's no need
80        to expose them, after all, this is an abstract class. */
81  //@{
82  /** Default constructor. */
83  ClpPdcoBase();
84  /** Destructor (has to be public) */
85public:
86  virtual ~ClpPdcoBase();
87
88protected:
89  // Copy
90  ClpPdcoBase(const ClpPdcoBase &);
91  // Assignment
92  ClpPdcoBase &operator=(const ClpPdcoBase &);
93  //@}
94
95protected:
96  /**@name Data members
97        The data members are protected to allow access for derived classes. */
98  //@{
99  /// Should be dense vectors
100  double d1_;
101  double d2_;
102  /// type (may be useful)
103  int type_;
104  //@}
105};
106
107#endif
108
109/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
110*/
Note: See TracBrowser for help on using the repository browser.