Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TQpDataBase.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/quadp:$Id$
0002 // Author: Eddy Offermann   May 2004
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 /*************************************************************************
0013  * Parts of this file are copied from the OOQP distribution and          *
0014  * are subject to the following license:                                 *
0015  *                                                                       *
0016  * COPYRIGHT 2001 UNIVERSITY OF CHICAGO                                  *
0017  *                                                                       *
0018  * The copyright holder hereby grants you royalty-free rights to use,    *
0019  * reproduce, prepare derivative works, and to redistribute this software*
0020  * to others, provided that any changes are clearly documented. This     *
0021  * software was authored by:                                             *
0022  *                                                                       *
0023  *   E. MICHAEL GERTZ      gertz@mcs.anl.gov                             *
0024  *   Mathematics and Computer Science Division                           *
0025  *   Argonne National Laboratory                                         *
0026  *   9700 S. Cass Avenue                                                 *
0027  *   Argonne, IL 60439-4844                                              *
0028  *                                                                       *
0029  *   STEPHEN J. WRIGHT     swright@cs.wisc.edu                           *
0030  *   Computer Sciences Department                                        *
0031  *   University of Wisconsin                                             *
0032  *   1210 West Dayton Street                                             *
0033  *   Madison, WI 53706   FAX: (608)262-9777                              *
0034  *                                                                       *
0035  * Any questions or comments may be directed to one of the authors.      *
0036  *                                                                       *
0037  * ARGONNE NATIONAL LABORATORY (ANL), WITH FACILITIES IN THE STATES OF   *
0038  * ILLINOIS AND IDAHO, IS OWNED BY THE UNITED STATES GOVERNMENT, AND     *
0039  * OPERATED BY THE UNIVERSITY OF CHICAGO UNDER PROVISION OF A CONTRACT   *
0040  * WITH THE DEPARTMENT OF ENERGY.                                        *
0041  *************************************************************************/
0042 
0043 #ifndef ROOT_TQpDataBase
0044 #define ROOT_TQpDataBase
0045 
0046 #include "TError.h"
0047 
0048 #include "TQpVar.h"
0049 
0050 #include "TMatrixD.h"
0051 
0052 //////////////////////////////////////////////////////////////////////////
0053 //                                                                      //
0054 // TQpDataBase                                                          //
0055 //                                                                      //
0056 // Data for the general QP formulation                                  //
0057 //                                                                      //
0058 //////////////////////////////////////////////////////////////////////////
0059 
0060 class TQpDataBase : public TObject
0061 {
0062 
0063 protected:
0064 
0065    // as part of setting up a random test problem, generate a random
0066    //  set of upper, lower, and two-sided bounds
0067    static void RandomlyChooseBoundedVariables(TVectorD &x,TVectorD &dualx,TVectorD &blx,TVectorD &ixlow,
0068                                               TVectorD &bux,TVectorD &ixupp,Double_t &ix,Double_t percentLowerOnly,
0069                                               Double_t percentUpperOnly,Double_t percentBound);
0070 
0071 public:
0072 
0073    Int_t    fNx;
0074    Int_t    fMy;
0075    Int_t    fMz;
0076 
0077    TVectorD fG;                                // linear part of Objective function
0078    TVectorD fBa;                               // vector of equality constraint
0079    TVectorD fXupBound;                         // Bounds on variables
0080    TVectorD fXupIndex;
0081    TVectorD fXloBound;
0082    TVectorD fXloIndex;
0083    TVectorD fCupBound;                         // Inequality constraints
0084    TVectorD fCupIndex;
0085    TVectorD fCloBound;
0086    TVectorD fCloIndex;
0087 
0088    TQpDataBase();
0089    TQpDataBase(Int_t nx,Int_t my,Int_t mz);
0090    TQpDataBase(const TQpDataBase &another);
0091    ~TQpDataBase() override {}
0092 
0093    virtual void PutQIntoAt(TMatrixDBase &M,Int_t row,Int_t col) = 0;
0094    virtual void PutAIntoAt(TMatrixDBase &M,Int_t row,Int_t col) = 0;
0095    virtual void PutCIntoAt(TMatrixDBase &M,Int_t row,Int_t col) = 0;
0096 
0097    virtual void Qmult     (Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) = 0;
0098    virtual void Amult     (Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) = 0;
0099    virtual void Cmult     (Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) = 0;
0100    virtual void ATransmult(Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) = 0;
0101    virtual void CTransmult(Double_t beta,TVectorD& y,Double_t alpha,const TVectorD& x) = 0;
0102 
0103    virtual void GetDiagonalOfQ(TVectorD &dQ) = 0;
0104 
0105    virtual TVectorD &GetG           () { return fG; }
0106    virtual TVectorD &GetBa          () { return fBa; }
0107 
0108    virtual TVectorD &GetXupperBound () { return fXupBound; }
0109    virtual TVectorD &GetiXupperBound() { return fXupIndex; }
0110    virtual TVectorD &GetXlowerBound () { return fXloBound; }
0111    virtual TVectorD &GetiXlowerBound() { return fXloIndex; }
0112    virtual TVectorD &GetSupperBound () { return fCupBound;  }
0113    virtual TVectorD &GetiSupperBound() { return fCupIndex; }
0114    virtual TVectorD &GetSlowerBound () { return fCloBound;  }
0115    virtual TVectorD &GetiSlowerBound() { return fCloIndex; }
0116 
0117    virtual Double_t  DataNorm      () = 0;
0118    virtual void      DataRandom    (TVectorD &x,TVectorD &y,TVectorD &z,TVectorD &s) = 0;
0119    virtual Double_t  ObjectiveValue(TQpVar *vars) = 0;
0120 
0121    TQpDataBase &operator= (const TQpDataBase &source);
0122 
0123    ClassDefOverride(TQpDataBase,1)                     // Qp Base Data class
0124 };
0125 #endif