// @(#)root/quadp:$Id$
// Author: Eddy Offermann   May 2004

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

/*************************************************************************
 * Parts of this file are copied from the OOQP distribution and          *
 * are subject to the following license:                                 *
 *                                                                       *
 * COPYRIGHT 2001 UNIVERSITY OF CHICAGO                                  *
 *                                                                       *
 * The copyright holder hereby grants you royalty-free rights to use,    *
 * reproduce, prepare derivative works, and to redistribute this software*
 * to others, provided that any changes are clearly documented. This     *
 * software was authored by:                                             *
 *                                                                       *
 *   E. MICHAEL GERTZ      gertz@mcs.anl.gov                             *
 *   Mathematics and Computer Science Division                           *
 *   Argonne National Laboratory                                         *
 *   9700 S. Cass Avenue                                                 *
 *   Argonne, IL 60439-4844                                              *
 *                                                                       *
 *   STEPHEN J. WRIGHT     swright@cs.wisc.edu                           *
 *   Computer Sciences Department                                        *
 *   University of Wisconsin                                             *
 *   1210 West Dayton Street                                             *
 *   Madison, WI 53706   FAX: (608)262-9777                              *
 *                                                                       *
 * Any questions or comments may be directed to one of the authors.      *
 *                                                                       *
 * ARGONNE NATIONAL LABORATORY (ANL), WITH FACILITIES IN THE STATES OF   *
 * ILLINOIS AND IDAHO, IS OWNED BY THE UNITED STATES GOVERNMENT, AND     *
 * OPERATED BY THE UNIVERSITY OF CHICAGO UNDER PROVISION OF A CONTRACT   *
 * WITH THE DEPARTMENT OF ENERGY.                                        *
 *************************************************************************/

#ifndef ROOT_TGondzioSolver
#define ROOT_TGondzioSolver

#include "TQpSolverBase.h"

///////////////////////////////////////////////////////////////////////////
//                                                                       //
// Derived class of TQpSolverBase implementing Gondzio-correction        //
// version of Mehrotra's original predictor-corrector algorithm.         //
//                                                                       //
///////////////////////////////////////////////////////////////////////////

class TGondzioSolver : public TQpSolverBase
{

protected:

   Int_t        fPrintlevel;                   // parameter in range [0,100] determines verbosity. (Higher value
                                               //  => more verbose.)
   Double_t     fTsig;                         // exponent in Mehrotra's centering parameter, which is usually
                                               // chosen to me (muaff/mu)^tsig, where muaff is the predicted
                                               // complementarity gap obtained from an affine-scaling step, while
                                               // mu is the current complementarity gap

   Int_t        fMaximum_correctors;           // maximum number of Gondzio corrector steps

   Int_t        fNumberGondzioCorrections;     // actual number of Gondzio corrections needed

   Double_t     fStepFactor0;                  // various parameters associated with Gondzio correction
   Double_t     fStepFactor1;
   Double_t     fAcceptTol;
   Double_t     fBeta_min;
   Double_t     fBeta_max;

   TQpVar      *fCorrector_step;               // storage for step vectors
   TQpVar      *fStep;

   TQpResidual *fCorrector_resid;              // storage for residual vectors

   TQpProbBase *fFactory;

public:

   TGondzioSolver();
   TGondzioSolver(TQpProbBase *of,TQpDataBase *prob,Int_t verbose=0);
   TGondzioSolver(const TGondzioSolver &another);

   virtual ~TGondzioSolver();

   virtual Int_t Solve           (TQpDataBase *prob,TQpVar *iterate,TQpResidual *resid);

   virtual void  Reset_parameters() {}         // reset parameters to their default values

   virtual void  DefMonitor      (TQpDataBase *data,TQpVar *vars,TQpResidual *resids,
                                  Double_t alpha,Double_t sigma,Int_t i,Double_t mu,
                                  Int_t status_code,Int_t level);

   TGondzioSolver &operator=(const TGondzioSolver &source);

   ClassDef(TGondzioSolver,1)                  // Gondzio Qp Solver class
};
#endif
 TGondzioSolver.h:1
 TGondzioSolver.h:2
 TGondzioSolver.h:3
 TGondzioSolver.h:4
 TGondzioSolver.h:5
 TGondzioSolver.h:6
 TGondzioSolver.h:7
 TGondzioSolver.h:8
 TGondzioSolver.h:9
 TGondzioSolver.h:10
 TGondzioSolver.h:11
 TGondzioSolver.h:12
 TGondzioSolver.h:13
 TGondzioSolver.h:14
 TGondzioSolver.h:15
 TGondzioSolver.h:16
 TGondzioSolver.h:17
 TGondzioSolver.h:18
 TGondzioSolver.h:19
 TGondzioSolver.h:20
 TGondzioSolver.h:21
 TGondzioSolver.h:22
 TGondzioSolver.h:23
 TGondzioSolver.h:24
 TGondzioSolver.h:25
 TGondzioSolver.h:26
 TGondzioSolver.h:27
 TGondzioSolver.h:28
 TGondzioSolver.h:29
 TGondzioSolver.h:30
 TGondzioSolver.h:31
 TGondzioSolver.h:32
 TGondzioSolver.h:33
 TGondzioSolver.h:34
 TGondzioSolver.h:35
 TGondzioSolver.h:36
 TGondzioSolver.h:37
 TGondzioSolver.h:38
 TGondzioSolver.h:39
 TGondzioSolver.h:40
 TGondzioSolver.h:41
 TGondzioSolver.h:42
 TGondzioSolver.h:43
 TGondzioSolver.h:44
 TGondzioSolver.h:45
 TGondzioSolver.h:46
 TGondzioSolver.h:47
 TGondzioSolver.h:48
 TGondzioSolver.h:49
 TGondzioSolver.h:50
 TGondzioSolver.h:51
 TGondzioSolver.h:52
 TGondzioSolver.h:53
 TGondzioSolver.h:54
 TGondzioSolver.h:55
 TGondzioSolver.h:56
 TGondzioSolver.h:57
 TGondzioSolver.h:58
 TGondzioSolver.h:59
 TGondzioSolver.h:60
 TGondzioSolver.h:61
 TGondzioSolver.h:62
 TGondzioSolver.h:63
 TGondzioSolver.h:64
 TGondzioSolver.h:65
 TGondzioSolver.h:66
 TGondzioSolver.h:67
 TGondzioSolver.h:68
 TGondzioSolver.h:69
 TGondzioSolver.h:70
 TGondzioSolver.h:71
 TGondzioSolver.h:72
 TGondzioSolver.h:73
 TGondzioSolver.h:74
 TGondzioSolver.h:75
 TGondzioSolver.h:76
 TGondzioSolver.h:77
 TGondzioSolver.h:78
 TGondzioSolver.h:79
 TGondzioSolver.h:80
 TGondzioSolver.h:81
 TGondzioSolver.h:82
 TGondzioSolver.h:83
 TGondzioSolver.h:84
 TGondzioSolver.h:85
 TGondzioSolver.h:86
 TGondzioSolver.h:87
 TGondzioSolver.h:88
 TGondzioSolver.h:89
 TGondzioSolver.h:90
 TGondzioSolver.h:91
 TGondzioSolver.h:92
 TGondzioSolver.h:93
 TGondzioSolver.h:94
 TGondzioSolver.h:95
 TGondzioSolver.h:96
 TGondzioSolver.h:97
 TGondzioSolver.h:98
 TGondzioSolver.h:99
 TGondzioSolver.h:100
 TGondzioSolver.h:101
 TGondzioSolver.h:102
 TGondzioSolver.h:103
 TGondzioSolver.h:104