CompoundConstraint.h

00001 #ifndef CompoundConstraint_h
00002 #define CompoundConstraint_h
00003 
00004 /*----------------------------------------------------------------------
00005  Copyright (c) 2001, Sandia Corporation.   Under the terms of Contract 
00006  DE-AC04-94AL85000, there is a non-exclusive license for use of this 
00007  work by or on behalf of the U.S. Government.
00008  ----------------------------------------------------------------------*/
00009 
00010 
00011 #include "Constraint.h"
00012 #include "OptppArray.h"
00013 
00021 namespace OPTPP {
00022 
00023 class CompoundConstraint: public ConstraintBase{
00024 
00025 private:
00026   OptppArray<Constraint> constraints_;  
00027   int numOfSets_;                       
00028   NEWMAT::ColumnVector lower_;          
00029   NEWMAT::ColumnVector upper_;          
00030 
00031 public:
00039   CompoundConstraint(); 
00046   CompoundConstraint(const Constraint& c1); 
00054   CompoundConstraint(const Constraint& c1, const Constraint& c2); 
00061   CompoundConstraint(const OptppArray<Constraint>& constraints); 
00069   CompoundConstraint(const CompoundConstraint& cc);
00070 
00074   ~CompoundConstraint() {;}
00075 
00077   CompoundConstraint& operator=(const CompoundConstraint& cc);
00078 
00082   int compare(const Constraint& c1, const Constraint& c2); 
00083 
00087   int getNumOfSets() const {return numOfSets_;}
00088 
00092   int getNumOfNLCons() const;
00093 
00097   virtual int getNumOfCons() const;
00098 
00102   virtual int getNumOfVars() const;
00103 
00107   virtual NEWMAT::ColumnVector getLower() const;
00108 
00112   virtual NEWMAT::ColumnVector getUpper() const;
00113 
00117   virtual NEWMAT::ColumnVector getConstraintType() const;
00118 
00122   virtual NEWMAT::ColumnVector getConstraintValue() const;
00123 
00127   virtual NEWMAT::ColumnVector getConstraintViolation() const;
00128 
00132   NEWMAT::ColumnVector getNLConstraintValue() const;
00133 
00137   virtual OptppArray<int> getConstraintMappingIndices() const;
00138 
00142   Constraint& operator[]( int i ) { return constraints_[i];}
00143 
00147   const Constraint& operator[](int i) const {return constraints_[i];}
00148 
00152   void computeFeasibleBounds(NEWMAT::ColumnVector& xcurrent, double epsilon);
00153 
00157   void computeFeasibleInequalities(NEWMAT::ColumnVector& xcurrent, double ftol);
00158 
00162   void insertSort();
00163 
00167   void printConstraints();
00168 
00174   virtual NEWMAT::ColumnVector evalResidual(const NEWMAT::ColumnVector& xcurrent ) const ;
00175   virtual void evalCFGH(const NEWMAT::ColumnVector& xcurrent ) const ;
00176 
00182   virtual NEWMAT::Matrix evalGradient(const NEWMAT::ColumnVector& xcurrent ) const ;
00183 
00190   NEWMAT::SymmetricMatrix evalHessian(NEWMAT::ColumnVector& xcurrent, 
00191                             const NEWMAT::ColumnVector& LagMultiplier) const ;
00197   virtual NEWMAT::SymmetricMatrix evalHessian(NEWMAT::ColumnVector& xcurrent ) const ;
00198 
00205   virtual OptppArray<NEWMAT::SymmetricMatrix> evalHessian(NEWMAT::ColumnVector& xcurrent, int darg) const ;
00206 
00215   virtual bool amIFeasible(const NEWMAT::ColumnVector& xcurrent, double epsilon) const;
00216 
00217 private:
00222   void insertSort(const OptppArray<Constraint>& constraints);
00223 };
00224 
00225 } // namespace OPTPP
00226 #endif
Generated on Mon Jan 24 12:04:37 2011 for FASTlib by  doxygen 1.6.3