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

CuterFunctional.hh

00001 #ifndef CUTERFUNCTIONAL
00002 #define CUTERFUNCTIONAL
00003 
00016 #include "Functional.hh"
00017 
00018 #include "IotrVector.hh"
00019 
00020 class SimpleVector;
00021 typedef Handle<SimpleVector> SimpleVectorHandle;
00022 
00025 class CuterAdaptor : public IotrRefCount {
00026 public:
00027   CuterAdaptor( int mmax, int nmax, int isSparse );
00028   virtual ~CuterAdaptor();
00029 
00031   int mMc;
00033   int mNx;
00035   int mMmax;
00037   int mNmax;
00038 
00039   int mIsSparse;
00041   SimpleVectorHandle mX;
00043   SimpleVectorHandle mYz;
00045   double *mXlow;
00047   double *mXupp;
00048 
00050   int    *mEquatn,  *mLinear;
00051 
00053   double *mClow;
00055   double *mCupp;
00056 
00060   virtual void initialize( int& inform );
00061 
00063   virtual void getBounds( IotrVector& xlow, IotrVector & xupp,
00064                           IotrVector& clow, IotrVector & cupp );
00065 
00066   void getInitialPrimal( IotrVector & primal ) const
00067   {
00068     primal.copyFrom( *mX );
00069   };
00070 
00071 
00072   void getInitialDual( IotrVector & dual ) {
00073     dual.copyFrom( *mYz );
00074   };
00075 
00076   int mc() { return mMc; }
00077   int nx() { return mNx; }
00078   int mmax() { return mMmax; }
00079   int nmax() { return mNmax; }
00080 };
00081 
00082 typedef Handle<CuterAdaptor> CuterAdaptorHandle;
00083 
00088 class CuterFunctional : public ConcreteFunctional {
00089 protected:
00091   int mMc;
00093   int mNx;
00094 
00095   int mMmax, mNmax;
00096   //specializes ConcreteFunctional::concreteValues
00097   virtual void concreteValues( double& obj, IotrVector & v,
00098                                IotrVector & x );
00099   //specializes ConcreteFunctional::concreteGrads
00100   virtual void concreteGrads( IotrVector & g, GenMatrix & J,
00101                               IotrVector & x) = 0;
00102   //specializes ConcreteFunctional::concreteHess
00103   virtual void concreteHess( SymMatrix & H, IotrVector & x, IotrVector & Lm) = 0;
00104 public:
00108   CuterFunctional( CuterAdaptor & a ) : mMc( a.mc() ), mNx( a.nx()),
00109                                         mMmax( a.mmax() ), mNmax( a.nmax()) {}
00110 
00111   virtual IotrVector * newPrimalVector()   const;
00112   virtual IotrVector * newDualVector()     const;
00113   virtual GenMatrix  * newJacobianMatrix() const = 0;
00114   virtual SymMatrix  * newHessianMatrix()  const = 0;
00115  virtual void writeConfiguration( std::ostream & out, char indent[] ) = 0;
00116 };
00117 
00118 
00119 typedef Handle<CuterFunctional> CuterFunctionalHandle;
00120 
00125 #endif

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