Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TQpDataDens.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_TQpDataDens
44#define ROOT_TQpDataDens
45
46#include "TError.h"
47#include "TQpDataBase.h"
48
49#include "TQpVar.h"
50
51#include "TMatrixD.h"
52#include "TMatrixDSym.h"
53
54//////////////////////////////////////////////////////////////////////////
55// //
56// TQpDataDens //
57// //
58// Data for the dense QP formulation //
59// //
60//////////////////////////////////////////////////////////////////////////
61
63{
64
65protected:
66
67 // these variables will be "Used" not copied
68 TMatrixDSym fQ; // Quadratic part of Objective function
69 TMatrixD fA; // Equality constraints
70 TMatrixD fC; // Inequality constraints
71
72public:
73
75 // data objects of the specified dimensions
76 TQpDataDens(Int_t nx,Int_t my,Int_t mz);
77
78 // sets up pointers to the data objects that are passed as arguments
80 TVectorD &ixupp,TMatrixD &A,TVectorD &bA,TMatrixD &C,TVectorD &clow,
81 TVectorD &iclow,TVectorD &cupp,TVectorD &icupp);
82 TQpDataDens(const TQpDataDens &another);
83
84 ~TQpDataDens() override {}
85
86 void PutQIntoAt(TMatrixDBase &M,Int_t row,Int_t col) override;
87 // insert the Hessian Q into the matrix M for the fundamental
88 // linear system, where M is stored as a TMatrixD
89 void PutAIntoAt(TMatrixDBase &M,Int_t row,Int_t col) override;
90 // insert the constraint matrix A into the matrix M for the
91 // fundamental linear system, where M is stored as a TMatrixD
92 void PutCIntoAt(TMatrixDBase &M,Int_t row,Int_t col) override;
93 // insert the constraint matrix C into the matrix M for the
94 // fundamental linear system, where M is stored as a TMatrixD
95
96 void Qmult (Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) override;
97 // y = beta * y + alpha * Q * x
98 void Amult (Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) override;
99 // y = beta * y + alpha * A * x
100 void Cmult (Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) override;
101 // y = beta * y + alpha * C * x
102 void ATransmult(Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) override;
103 // y = beta * y + alpha * A^T * x
104 void CTransmult(Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) override;
105 // y = beta * y + alpha * C^T * x
106
107 void GetDiagonalOfQ(TVectorD &dQ) override; // extract the diagonal of Q and put it in the vector dQ
108
109 Double_t DataNorm() override;
110 void DataRandom(TVectorD &x,TVectorD &y,TVectorD &z,TVectorD &s) override;
111 // Create a random problem (x,y,z,s)
112 // the solution to the random problem
113 void Print(Option_t *opt="") const override;
114
115 Double_t ObjectiveValue(TQpVar *vars) override;
116
117 TQpDataDens &operator= (const TQpDataDens &source);
118
119 ClassDefOverride(TQpDataDens,1) // Qp Data class for Dens formulation
120};
121#endif
#define c(i)
Definition RSha256.hxx:101
int Int_t
Definition RtypesCore.h:45
double Double_t
Definition RtypesCore.h:59
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Data for the general QP formulation.
Definition TQpDataBase.h:61
Data for the dense QP formulation.
Definition TQpDataDens.h:63
Double_t DataNorm() override
Return the largest component of several vectors in the data class.
void Qmult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x) override
calculate y = beta*y + alpha*(fQ*x)
void Cmult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x) override
calculate y = beta*y + alpha*(fC*x)
void GetDiagonalOfQ(TVectorD &dQ) override
Return in vector dq the diagonal of matrix fQ (Quadratic part of Objective function)
void DataRandom(TVectorD &x, TVectorD &y, TVectorD &z, TVectorD &s) override
Choose randomly a QP problem.
TMatrixD fC
Definition TQpDataDens.h:70
void Amult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x) override
calculate y = beta*y + alpha*(fA*x)
TMatrixDSym fQ
Definition TQpDataDens.h:68
~TQpDataDens() override
Definition TQpDataDens.h:84
Double_t ObjectiveValue(TQpVar *vars) override
Return value of the objective function.
TMatrixD fA
Definition TQpDataDens.h:69
void PutCIntoAt(TMatrixDBase &M, Int_t row, Int_t col) override
Insert the constraint matrix C into the matrix M at index (row,col) for the fundamental linear system...
void Print(Option_t *opt="") const override
Print all class members.
void PutQIntoAt(TMatrixDBase &M, Int_t row, Int_t col) override
Insert the Hessian Q into the matrix M at index (row,col) for the fundamental linear system.
void PutAIntoAt(TMatrixDBase &M, Int_t row, Int_t col) override
Insert the constraint matrix A into the matrix M at index (row,col) for the fundamental linear system...
void ATransmult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x) override
calculate y = beta*y + alpha*(fA^T*x)
TQpDataDens & operator=(const TQpDataDens &source)
Assignment operator.
void CTransmult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x) override
calculate y = beta*y + alpha*(fC^T*x)
Class containing the variables for the general QP formulation.
Definition TQpVar.h:60
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17