Logo ROOT   6.10/09
Reference Guide
TQpDataBase.h
Go to the documentation of this file.
1 // @(#)root/quadp:$Id$
2 // Author: Eddy Offermann May 2004
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 /*************************************************************************
13  * Parts of this file are copied from the OOQP distribution and *
14  * are subject to the following license: *
15  * *
16  * COPYRIGHT 2001 UNIVERSITY OF CHICAGO *
17  * *
18  * The copyright holder hereby grants you royalty-free rights to use, *
19  * reproduce, prepare derivative works, and to redistribute this software*
20  * to others, provided that any changes are clearly documented. This *
21  * software was authored by: *
22  * *
23  * E. MICHAEL GERTZ gertz@mcs.anl.gov *
24  * Mathematics and Computer Science Division *
25  * Argonne National Laboratory *
26  * 9700 S. Cass Avenue *
27  * Argonne, IL 60439-4844 *
28  * *
29  * STEPHEN J. WRIGHT swright@cs.wisc.edu *
30  * Computer Sciences Department *
31  * University of Wisconsin *
32  * 1210 West Dayton Street *
33  * Madison, WI 53706 FAX: (608)262-9777 *
34  * *
35  * Any questions or comments may be directed to one of the authors. *
36  * *
37  * ARGONNE NATIONAL LABORATORY (ANL), WITH FACILITIES IN THE STATES OF *
38  * ILLINOIS AND IDAHO, IS OWNED BY THE UNITED STATES GOVERNMENT, AND *
39  * OPERATED BY THE UNIVERSITY OF CHICAGO UNDER PROVISION OF A CONTRACT *
40  * WITH THE DEPARTMENT OF ENERGY. *
41  *************************************************************************/
42 
43 #ifndef ROOT_TQpDataBase
44 #define ROOT_TQpDataBase
45 
46 #include "TError.h"
47 
48 #include "TQpVar.h"
49 
50 #include "TMatrixD.h"
51 
52 //////////////////////////////////////////////////////////////////////////
53 // //
54 // TQpDataBase //
55 // //
56 // Data for the general QP formulation //
57 // //
58 //////////////////////////////////////////////////////////////////////////
59 
60 class TQpDataBase : public TObject
61 {
62 
63 protected:
64 
65  // as part of setting up a random test problem, generate a random
66  // set of upper, lower, and two-sided bounds
67  static void RandomlyChooseBoundedVariables(TVectorD &x,TVectorD &dualx,TVectorD &blx,TVectorD &ixlow,
68  TVectorD &bux,TVectorD &ixupp,Double_t &ix,Double_t percentLowerOnly,
69  Double_t percentUpperOnly,Double_t percentBound);
70 
71 public:
72 
76 
77  TVectorD fG; // linear part of Objective function
78  TVectorD fBa; // vector of equality constraint
79  TVectorD fXupBound; // Bounds on variables
83  TVectorD fCupBound; // Inequality constraints
87 
88  TQpDataBase();
90  TQpDataBase(const TQpDataBase &another);
91  virtual ~TQpDataBase() {}
92 
93  virtual void PutQIntoAt(TMatrixDBase &M,Int_t row,Int_t col) = 0;
94  virtual void PutAIntoAt(TMatrixDBase &M,Int_t row,Int_t col) = 0;
95  virtual void PutCIntoAt(TMatrixDBase &M,Int_t row,Int_t col) = 0;
96 
97  virtual void Qmult (Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) = 0;
98  virtual void Amult (Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) = 0;
99  virtual void Cmult (Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) = 0;
100  virtual void ATransmult(Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) = 0;
101  virtual void CTransmult(Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) = 0;
102 
103  virtual void GetDiagonalOfQ(TVectorD &dQ) = 0;
104 
105  virtual TVectorD &GetG () { return fG; }
106  virtual TVectorD &GetBa () { return fBa; }
107 
108  virtual TVectorD &GetXupperBound () { return fXupBound; }
109  virtual TVectorD &GetiXupperBound() { return fXupIndex; }
110  virtual TVectorD &GetXlowerBound () { return fXloBound; }
111  virtual TVectorD &GetiXlowerBound() { return fXloIndex; }
112  virtual TVectorD &GetSupperBound () { return fCupBound; }
113  virtual TVectorD &GetiSupperBound() { return fCupIndex; }
114  virtual TVectorD &GetSlowerBound () { return fCloBound; }
115  virtual TVectorD &GetiSlowerBound() { return fCloIndex; }
116 
117  virtual Double_t DataNorm () = 0;
118  virtual void DataRandom (TVectorD &x,TVectorD &y,TVectorD &z,TVectorD &s) = 0;
119  virtual Double_t ObjectiveValue(TQpVar *vars) = 0;
120 
121  TQpDataBase &operator= (const TQpDataBase &source);
122 
123  ClassDef(TQpDataBase,1) // Qp Base Data class
124 };
125 #endif
const int nx
Definition: kalman.C:16
virtual Double_t DataNorm()=0
TVectorD fXupBound
Definition: TQpDataBase.h:79
virtual void Qmult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x)=0
TQpDataBase & operator=(const TQpDataBase &source)
Assignment operator.
TVectorD fXloIndex
Definition: TQpDataBase.h:82
virtual TVectorD & GetiSlowerBound()
Definition: TQpDataBase.h:115
TVectorD fG
Definition: TQpDataBase.h:77
virtual TVectorD & GetXlowerBound()
Definition: TQpDataBase.h:110
virtual void CTransmult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x)=0
int Int_t
Definition: RtypesCore.h:41
virtual void ATransmult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x)=0
virtual void DataRandom(TVectorD &x, TVectorD &y, TVectorD &z, TVectorD &s)=0
TVectorD fCupIndex
Definition: TQpDataBase.h:84
double beta(double x, double y)
Calculates the beta function.
virtual TVectorD & GetBa()
Definition: TQpDataBase.h:106
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:297
TVectorD fCloBound
Definition: TQpDataBase.h:85
virtual void GetDiagonalOfQ(TVectorD &dQ)=0
virtual void Amult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x)=0
virtual TVectorD & GetG()
Definition: TQpDataBase.h:105
virtual TVectorD & GetiXupperBound()
Definition: TQpDataBase.h:109
virtual void Cmult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x)=0
TVectorD fXloBound
Definition: TQpDataBase.h:81
TVectorD fXupIndex
Definition: TQpDataBase.h:80
virtual Double_t ObjectiveValue(TQpVar *vars)=0
Linear Algebra Package.
double Double_t
Definition: RtypesCore.h:55
TVectorD fBa
Definition: TQpDataBase.h:78
Double_t y[n]
Definition: legend1.C:17
TQpDataBase()
Default constructor.
Definition: TQpDataBase.cxx:66
static void RandomlyChooseBoundedVariables(TVectorD &x, TVectorD &dualx, TVectorD &blx, TVectorD &ixlow, TVectorD &bux, TVectorD &ixupp, Double_t &ix, Double_t percentLowerOnly, Double_t percentUpperOnly, Double_t percentBound)
Randomly choose x and its boundaries.
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
virtual TVectorD & GetXupperBound()
Definition: TQpDataBase.h:108
Definition: TQpVar.h:59
virtual void PutAIntoAt(TMatrixDBase &M, Int_t row, Int_t col)=0
TVectorD fCupBound
Definition: TQpDataBase.h:83
virtual void PutCIntoAt(TMatrixDBase &M, Int_t row, Int_t col)=0
TVectorD fCloIndex
Definition: TQpDataBase.h:86
virtual ~TQpDataBase()
Definition: TQpDataBase.h:91
virtual TVectorD & GetiXlowerBound()
Definition: TQpDataBase.h:111
virtual TVectorD & GetiSupperBound()
Definition: TQpDataBase.h:113
virtual TVectorD & GetSlowerBound()
Definition: TQpDataBase.h:114
virtual void PutQIntoAt(TMatrixDBase &M, Int_t row, Int_t col)=0
virtual TVectorD & GetSupperBound()
Definition: TQpDataBase.h:112