CouenneTypes.hpp

Go to the documentation of this file.
00001 /* $Id: CouenneTypes.hpp 141 2009-06-03 04:19:19Z pbelotti $ */
00002 /*
00003  * Name:    CouenneTypes.hpp
00004  * Author:  Pietro Belotti
00005  * Purpose: define number types used throughout the code
00006  *
00007  * (C) Carnegie-Mellon University, 2006-07
00008  * This file is licensed under the Common Public License (CPL)
00009  */
00010 
00011 #ifndef COUENNE_TYPES_H
00012 #define COUENNE_TYPES_H
00013 
00015 #include "CoinPragma.hpp"
00016 
00018 enum nodeType       {CONST=0, VAR, UNARY, N_ARY, COPY, AUX, EMPTY};
00019 
00021 enum linearity_type {ZERO=0, CONSTANT, LINEAR, QUADRATIC, NONLINEAR};
00022 
00028 enum pos            {PRE=0, POST, INSIDE, NONE};
00029 
00031 enum con_sign       {COUENNE_EQ, COUENNE_LE, COUENNE_GE, COUENNE_RNG};
00032 
00035 enum conv_type      {CURRENT_ONLY, UNIFORM_GRID, AROUND_CURPOINT};
00036 
00038 enum expr_type {/*COU_EXPRAUX,  COU_EXPRCLONE, COU_EXPRCOPY, */
00039                 COU_EXPRESSION, /***** variables, constants **************/
00040                 COU_EXPRCONST, COU_EXPRVAR, COU_EXPRLBOUND, COU_EXPRUBOUND, 
00041                 /*COU_EXPRIVAR, */ 
00042                 COU_EXPROP,     /***** n-ary operators *******************/
00043                 COU_EXPRSUB,  COU_EXPRSUM, COU_EXPRGROUP, COU_EXPRQUAD,
00044                 COU_EXPRMIN,  COU_EXPRMUL, COU_EXPRPOW, COU_EXPRMAX, COU_EXPRDIV, 
00045                 /*COU_EXPRBDIV,  COU_EXPRBMUL,*/ 
00046                 COU_EXPRUNARY,  /***** unary operators *******************/
00047                 COU_EXPRCOS,  COU_EXPRABS,
00048                 COU_EXPREXP,  COU_EXPRINV,   COU_EXPRLOG,    
00049                 COU_EXPROPP,   COU_EXPRSIN
00050                 };
00051 
00053 enum convexity {UNSET, NONCONVEX, CONVEX, CONCAVE, AFFINE};
00054 
00056 enum dig_type {ORIG_ONLY, STOP_AT_AUX, TAG_AND_RECURSIVE, COUNT};
00057 
00060 class t_chg_bounds
00061 {
00062 public:
00063   enum ChangeStatus {
00064     UNCHANGED=0,
00065     CHANGED=1,
00066     EXACT=2
00067   };
00068 
00069   t_chg_bounds():
00070     lower_(UNCHANGED),
00071     upper_(UNCHANGED)
00072   {}
00073   t_chg_bounds(const t_chg_bounds& src):
00074     lower_(src.lower_),
00075     upper_(src.upper_)
00076   {}
00077   inline const char& lower() const {return lower_;}
00078   inline const char& upper() const {return upper_;}
00079   inline void setLower(ChangeStatus lower) {lower_ = lower;}
00080   inline void setUpper(ChangeStatus upper) {upper_ = upper;}
00081   inline void setLowerBits(char lower) {lower_ |= lower;}
00082   inline void setUpperBits(char upper) {upper_ |= upper;}
00083   t_chg_bounds operator=(const t_chg_bounds&src) {
00084     lower_ = src.lower_;
00085     upper_ = src.upper_;
00086     return *this;
00087   }
00088 private:
00089   char lower_;
00090   char upper_;
00091 };
00092 
00094 typedef double CouNumber;
00095 
00097 typedef CouNumber (*unary_function) (CouNumber);
00098 
00099 #endif

Generated on Wed Oct 7 03:10:23 2009 for Couenne by  doxygen 1.4.7