constraint.h

Go to the documentation of this file.
00001 
00036 #ifndef ABA_CONSTRAINT_H
00037 #define ABA_CONSTRAINT_H
00038 
00039 #include "abacus/convar.h"
00040 #include "abacus/array.h"
00041 #include "abacus/infeascon.h"
00042 #include "abacus/csense.h"
00043 
00044 class ABA_ROW;
00045 class ABA_MASTER;
00046 class ABA_VARIABLE;
00047 class ABA_CONCLASS;
00048 class ABA_LPSUB;
00049 
00050 template<class BaseType, class CoType> class ABA_ACTIVE;
00051 
00052 #ifdef ABACUS_PARALLEL
00053 #include "abacus/message.h"
00054 #endif
00055 class  ABA_CONSTRAINT :  public ABA_CONVAR  {
00056   friend class ABA_LPSUB;
00057   public:
00058 
00081     ABA_CONSTRAINT (ABA_MASTER *master, const ABA_SUB *sub,
00082                     ABA_CSENSE::SENSE sense, double rhs,
00083                     bool dynamic, bool local, bool liftable);
00084 
00093     ABA_CONSTRAINT (ABA_MASTER *master);
00094 
00099     ABA_CONSTRAINT(const ABA_CONSTRAINT &rhs); 
00100 
00103     virtual ~ABA_CONSTRAINT();
00104 #ifdef ABACUS_PARALLEL
00105 
00110     ABA_CONSTRAINT(const ABA_MASTER *master, ABA_MESSAGE &msg);
00111 
00121     virtual void pack(ABA_MESSAGE &msg) const;
00122 #endif
00123 
00126     ABA_CSENSE *sense();
00127 
00128 
00133     virtual double coeff(ABA_VARIABLE *v) = 0;
00134 
00137     virtual double rhs();
00138 
00148     bool liftable() const;
00149   
00162     virtual bool valid(ABA_SUB *sub);
00163 
00180     virtual int genRow(ABA_ACTIVE<ABA_VARIABLE, ABA_CONSTRAINT> *var, 
00181                        ABA_ROW &row);
00182 
00191     virtual double slack(ABA_ACTIVE<ABA_VARIABLE, ABA_CONSTRAINT> *variables,
00192                          double *x);
00193 
00204     virtual bool violated(ABA_ACTIVE<ABA_VARIABLE, ABA_CONSTRAINT> *variables,
00205                           double *x, double *sl = 0);
00206 
00219     virtual bool violated(double slack) const;
00220 
00227     void printRow(ostream &out, ABA_ACTIVE<ABA_VARIABLE, ABA_CONSTRAINT> *var);
00228 
00242     virtual double distance(double *x, 
00243                             ABA_ACTIVE<ABA_VARIABLE, ABA_CONSTRAINT> *actVar);
00244 
00245     ABA_CONSTRAINT *duplicate()
00246     {return 0;};
00247 
00258     ABA_CONCLASS *classification(ABA_ACTIVE<ABA_VARIABLE, ABA_CONSTRAINT> *var = 0);
00259   protected:
00260 
00276     virtual ABA_INFEASCON::INFEAS voidLhsViolated(double newRhs) const;
00277 
00281     virtual ABA_CONCLASS *classify(ABA_ACTIVE<ABA_VARIABLE, ABA_CONSTRAINT> *var);
00282 
00285     ABA_CSENSE sense_;
00286 
00289     double rhs_;
00290     ABA_CONCLASS *conClass_;
00291 
00296     bool liftable_;
00297 
00298   private:
00299     const ABA_CONSTRAINT &operator=(const ABA_CONSTRAINT &rhs);
00300 };
00301 
00302 
00303 inline ABA_CSENSE *ABA_CONSTRAINT::sense()
00304   {
00305     return &sense_;
00306   }
00307 
00308 inline bool ABA_CONSTRAINT::liftable() const
00309   {
00310     return liftable_;
00311   }
00312 
00313 
00314 #endif  // ABA_CONSTRAINT_H
00315 

Generated on Tue Aug 14 18:09:53 2007 for ABACUS by  doxygen 1.5.1