Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

NlpResiduals.hh

Go to the documentation of this file.
00001 #ifndef NLPRESIDUALS
00002 #define NLPRESIDUALS
00003 
00013 #include "IotrRefCount.hh"
00014 #include "IotrHandle.hh"
00015 #include "NlpIterate.hh"
00016 #include "Nlp.hh"
00017 #include "NlpBounds.hh"
00018 #include "NlpLinsysSol.hh"
00019 
00020 #include <iostream>
00021 
00022 
00023 class IotrVector;
00024 typedef Handle<IotrVector> IotrVectorHandle;
00025 
00026 class NlpValues;
00027 class NlpGrads;
00028 class NlpHessian;
00029 class NlpIterate;
00030 class NlpResidualShift;
00031 
00034 class NlpResiduals : public IotrRefCount {
00035 protected:
00039   //@
00040   IotrVectorHandle mAx_d;
00041 
00042   IotrVectorHandle mV;
00043   IotrVectorHandle mW;
00044 
00045   IotrVectorHandle mT;
00046   IotrVectorHandle mU;
00047 
00048   IotrVectorHandle mGammaRes;
00049   IotrVectorHandle mPhiRes;
00050 
00051   IotrVectorHandle mLambdaRes;
00052   IotrVectorHandle mPiRes;
00054 public:
00056   NlpResiduals( IotrVector * y,
00057                 IotrVector * lambda, IotrVector * pi,
00058                 IotrVector * gamma, IotrVector * phi );
00059 
00061   virtual void calcSimpleBounds( NlpIterate &, NlpBounds & );
00062 
00064   virtual void calcResids( NlpValues &, NlpIterate &, NlpBounds & );
00066   virtual void updateComplementarity( NlpIterate & vars );
00068   double primalFeasibility() { return mAx_d->infnorm(); }
00070   //  double dualFeasibility() { return mXr->infnorm(); }
00072   virtual double complementarity();
00074   virtual void asMfile( std::ostream& out );
00076   virtual double simpleStepbound( NlpLinsysSol & step,
00077                                   NlpBounds & bounds, double maxstep  );
00079   virtual double getMu( NlpIterate &vars );
00080 
00081   int genConstraintsFeasible();
00082   int simpleBoundsFeasible();
00083 
00084   IotrVector & Ax_d() { return *mAx_d; } 
00085 
00087   IotrVector & v() { return *mV; }
00089   IotrVector & w() { return *mW; }
00090 
00092   IotrVector & t() { return *mT; }
00094   IotrVector & u() { return *mU; }
00095 
00097   IotrVector & gammaRes() { return *mGammaRes; }
00099   IotrVector & phiRes() { return *mPhiRes; }
00100 
00102   IotrVector & lambdaRes() { return *mLambdaRes; }
00104   IotrVector & piRes() { return *mPiRes; }
00105 
00106   virtual void complementarityMeasures( double & compMin, double & center,
00107                                         double & compMax ) const;
00108 
00109   virtual void inspect();
00110   virtual void inspectAsMatlab();
00111 };
00112 
00113 typedef Handle<NlpResiduals> NlpResidualsHandle;
00114 
00115 
00116 class NlpResidualShift : public IotrRefCount {
00117 protected:
00118   double mShiftEquality, mShiftComplementarity;
00119 public:
00120   NlpResidualShift( double shiftEquality, double shiftComplementarity ) :
00121     mShiftEquality( shiftEquality ),
00122     mShiftComplementarity( shiftComplementarity ) {}
00123   NlpResidualShift & operator=( const NlpResidualShift & s )
00124   {
00125     mShiftEquality = s.mShiftEquality;
00126     mShiftComplementarity = s.mShiftComplementarity;
00127 
00128     return *this;
00129   }
00130   double shiftEquality() const { return mShiftEquality; }
00131   double shiftComplementarity() const { return mShiftComplementarity; }
00132 
00133 };
00134 
00135 typedef Handle<NlpResidualShift> NlpResidualShiftHandle;
00136 
00137 
00138 #endif

Generated on Wed Aug 27 10:03:41 2003 for iotr by doxygen1.2.18