TQpDataDens.h

Go to the documentation of this file.
00001 // @(#)root/quadp:$Id: TQpDataDens.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Eddy Offermann   May 2004
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 /*************************************************************************
00013  * Parts of this file are copied from the OOQP distribution and          *
00014  * are subject to the following license:                                 *
00015  *                                                                       *
00016  * COPYRIGHT 2001 UNIVERSITY OF CHICAGO                                  *
00017  *                                                                       *
00018  * The copyright holder hereby grants you royalty-free rights to use,    *
00019  * reproduce, prepare derivative works, and to redistribute this software*
00020  * to others, provided that any changes are clearly documented. This     *
00021  * software was authored by:                                             *
00022  *                                                                       *
00023  *   E. MICHAEL GERTZ      gertz@mcs.anl.gov                             *
00024  *   Mathematics and Computer Science Division                           *
00025  *   Argonne National Laboratory                                         *
00026  *   9700 S. Cass Avenue                                                 *
00027  *   Argonne, IL 60439-4844                                              *
00028  *                                                                       *
00029  *   STEPHEN J. WRIGHT     swright@cs.wisc.edu                           *
00030  *   Computer Sciences Department                                        *
00031  *   University of Wisconsin                                             *
00032  *   1210 West Dayton Street                                             *
00033  *   Madison, WI 53706   FAX: (608)262-9777                              *
00034  *                                                                       *
00035  * Any questions or comments may be directed to one of the authors.      *
00036  *                                                                       *
00037  * ARGONNE NATIONAL LABORATORY (ANL), WITH FACILITIES IN THE STATES OF   *
00038  * ILLINOIS AND IDAHO, IS OWNED BY THE UNITED STATES GOVERNMENT, AND     *
00039  * OPERATED BY THE UNIVERSITY OF CHICAGO UNDER PROVISION OF A CONTRACT   *
00040  * WITH THE DEPARTMENT OF ENERGY.                                        *
00041  *************************************************************************/
00042 
00043 #ifndef ROOT_TQpDataDens
00044 #define ROOT_TQpDataDens
00045 
00046 #ifndef ROOT_TError
00047 #include "TError.h"
00048 #endif
00049 #ifndef ROOT_TQpDataBase
00050 #include "TQpDataBase.h"
00051 #endif
00052 
00053 #ifndef ROOT_TQpVar
00054 #include "TQpVar.h"
00055 #endif
00056 
00057 #ifndef ROOT_TMatrixD
00058 #include "TMatrixD.h"
00059 #endif
00060 #ifndef ROOT_TMatrixDSym
00061 #include "TMatrixDSym.h"
00062 #endif
00063 
00064 //////////////////////////////////////////////////////////////////////////
00065 //                                                                      //
00066 // TQpDataDens                                                          //
00067 //                                                                      //
00068 // Data for the dense QP formulation                                    //
00069 //                                                                      //
00070 //////////////////////////////////////////////////////////////////////////
00071 
00072 class TQpDataDens : public TQpDataBase
00073 {
00074 
00075 protected:
00076 
00077    // these variables will be "Used" not copied
00078    TMatrixDSym fQ;                             // Quadratic part of Objective function
00079    TMatrixD    fA;                             // Equality constraints
00080    TMatrixD    fC;                             // Inequality constraints
00081 
00082 public:
00083 
00084    TQpDataDens() {}
00085    // data objects of the specified dimensions
00086    TQpDataDens(Int_t nx,Int_t my,Int_t mz);
00087 
00088    // sets up pointers to the data objects that are passed as arguments
00089    TQpDataDens(TVectorD &c,TMatrixDSym &Q,TVectorD &xlow,TVectorD &ixlow,TVectorD &xupp,
00090                TVectorD &ixupp,TMatrixD &A,TVectorD &bA,TMatrixD &C,TVectorD &clow,
00091                TVectorD &iclow,TVectorD &cupp,TVectorD &icupp);
00092    TQpDataDens(const TQpDataDens &another);
00093 
00094    virtual ~TQpDataDens() {}
00095 
00096    virtual void PutQIntoAt(TMatrixDBase &M,Int_t row,Int_t col);
00097                                                // insert the Hessian Q into the matrix M for the fundamental
00098                                                // linear system, where M is stored as a TMatrixD
00099    virtual void PutAIntoAt(TMatrixDBase &M,Int_t row,Int_t col);
00100                                                // insert the constraint matrix A into the matrix M for the
00101                                                // fundamental linear system, where M is stored as a TMatrixD
00102    virtual void PutCIntoAt(TMatrixDBase &M,Int_t row,Int_t col);
00103                                                // insert the constraint matrix C into the matrix M for the
00104                                                // fundamental linear system, where M is stored as a TMatrixD
00105 
00106    virtual void Qmult     (Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x);
00107                                                // y = beta * y + alpha * Q * x
00108    virtual void Amult     (Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x);
00109                                                // y = beta * y + alpha * A * x
00110    virtual void Cmult     (Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x);
00111                                                // y = beta * y + alpha * C * x
00112    virtual void ATransmult(Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x);
00113                                                // y = beta * y + alpha * A^T * x
00114    virtual void CTransmult(Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x);
00115                                                // y = beta * y + alpha * C^T * x
00116 
00117    virtual void GetDiagonalOfQ(TVectorD &dQ);  // extract the diagonal of Q and put it in the vector dQ
00118 
00119    virtual Double_t DataNorm();
00120    virtual void DataRandom(TVectorD &x,TVectorD &y,TVectorD &z,TVectorD &s);
00121                                                // Create a random problem (x,y,z,s)
00122                                                // the solution to the random problem
00123    virtual void Print(Option_t *opt="") const;
00124 
00125    virtual Double_t ObjectiveValue(TQpVar *vars);
00126 
00127    TQpDataDens &operator= (const TQpDataDens &source);
00128 
00129    ClassDef(TQpDataDens,1)                     // Qp Data class for Dens formulation
00130 };
00131 #endif

Generated on Tue Jul 5 14:28:05 2011 for ROOT_528-00b_version by  doxygen 1.5.1