Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TQpProbBase.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_TQpProbBase
44#define ROOT_TQpProbBase
45
46#include "TError.h"
47
48#include "TQpVar.h"
49#include "TQpDataBase.h"
50#include "TQpResidual.h"
51
52#include "TMatrixD.h"
53
54///////////////////////////////////////////////////////////////////////////
55// //
56// default general problem formulation: //
57// //
58// minimize c' x + ( 1/2 ) x' * Q x ; //
59// subject to A x = b ; //
60// clo <= C x <= cup ; //
61// xlo <= x <= xup ; //
62// //
63// The general linear equality constraints must have either an upper //
64// or lower bound, but need not have both bounds. The variables may have//
65// no bounds; an upper bound; a lower bound or both an upper and lower //
66// bound. //
67// //
68// However, for many (possibly most) QP's, the matrices in the //
69// formulation have structure that may be exploited to solve the //
70// problem more efficiently. This abstract problem formulation contains //
71// a setup such that one can derive and add special formulations . //
72// The optimality conditions of the simple QP defined above are //
73// follows: //
74// //
75// rQ = c + Q * x - A' * y - C' * z = 0 //
76// rA = A * x - b = 0 //
77// rC = C * x - s - d = 0 //
78// r3 = S * z = 0 //
79// s, z >= 0 //
80// //
81// Where rQ, rA, rC and r3 newly defined quantities known as residual //
82// vectors and x, y, z and s are variables of used in solution of the //
83// QPs. //
84// //
85///////////////////////////////////////////////////////////////////////////
86
88class TQpProbBase : public TObject
89{
90
91public:
92 Int_t fNx; // number of elements in x
93 Int_t fMy; // number of rows in A and b
94 Int_t fMz; // number of rows in C
95
97 TQpProbBase(Int_t nx,Int_t my,Int_t mz);
98 TQpProbBase(const TQpProbBase &another);
99
100 ~TQpProbBase() override {}
101
103 TMatrixDBase &Q_in,
104 TVectorD &xlo, TVectorD &ixlo,
105 TVectorD &xup, TVectorD &ixup,
106 TMatrixDBase &A_in,TVectorD &bA,
107 TMatrixDBase &C_in,
108 TVectorD &clo, TVectorD &iclo,
109 TVectorD &cup, TVectorD &icup) = 0;
111 virtual TQpVar *MakeVariables(const TQpDataBase *data) = 0;
113
114 virtual void JoinRHS (TVectorD &rhs_in,TVectorD &rhs1_in,TVectorD &rhs2_in,TVectorD &rhs3_in) = 0;
115 virtual void SeparateVars(TVectorD &x_in,TVectorD &y_in,TVectorD &z_in,TVectorD &vars_in) = 0;
116
117 TQpProbBase &operator= (const TQpProbBase &source);
118
119 ClassDefOverride(TQpProbBase,1) // Qp problem formulation base class
120};
121#endif
#define c(i)
Definition RSha256.hxx:101
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Mother of all ROOT objects.
Definition TObject.h:41
Data for the general QP formulation.
Definition TQpDataBase.h:61
Implementation of main solver for linear systems.
default general problem formulation:
Definition TQpProbBase.h:89
virtual void JoinRHS(TVectorD &rhs_in, TVectorD &rhs1_in, TVectorD &rhs2_in, TVectorD &rhs3_in)=0
virtual void SeparateVars(TVectorD &x_in, TVectorD &y_in, TVectorD &z_in, TVectorD &vars_in)=0
virtual TQpLinSolverBase * MakeLinSys(const TQpDataBase *data)=0
virtual TQpResidual * MakeResiduals(const TQpDataBase *data)=0
TQpProbBase()
Default constructor.
~TQpProbBase() override
TQpProbBase & operator=(const TQpProbBase &source)
Assignment operator.
virtual TQpDataBase * MakeData(TVectorD &c, TMatrixDBase &Q_in, TVectorD &xlo, TVectorD &ixlo, TVectorD &xup, TVectorD &ixup, TMatrixDBase &A_in, TVectorD &bA, TMatrixDBase &C_in, TVectorD &clo, TVectorD &iclo, TVectorD &cup, TVectorD &icup)=0
virtual TQpVar * MakeVariables(const TQpDataBase *data)=0
The Residuals class calculates and stores the quantities that appear on the right-hand side of the li...
Definition TQpResidual.h:62
Class containing the variables for the general QP formulation.
Definition TQpVar.h:60