OBOE  0.1
Oracle.h
Go to the documentation of this file.
00001 // Copyright (c) 2004-2007 University of Geneva, HEC, Logilab
00002 //
00003 // OBOE is published under the Common Public License.
00004 //
00005 // Authors :
00006 // Nidhi Sawhney <nsawhney@yahoo.com>
00007 // The OBOE team
00008 //
00009 
00010 #ifndef ORACLE_H
00011 #define ORACLE_H
00012 
00019 #include "AccpmDefs.h"
00020 #include "AccpmGenMatrix.h"
00036 namespace Accpm {
00037 
00038 class OracleFunction {
00039   
00040  public:
00041   virtual ~OracleFunction(){};
00093   virtual int eval(const AccpmVector &y, 
00094            AccpmVector &functionValue, 
00095            AccpmGenMatrix &subGradients, 
00096            AccpmGenMatrix *info) = 0;
00097 };
00098 
00104 class Oracle {
00105  protected:
00106   OracleFunction *_f1;
00107   OracleFunction *_f2;
00108 
00109  public:
00128   Oracle(OracleFunction *f1, OracleFunction *f2 = NULL);
00129   virtual ~Oracle();
00130   virtual bool hasSmoothOracle() const { return _f2 != NULL; }
00136   virtual bool computesBound() const { return false; }
00144   virtual double getObjectiveFunctionBound() const { return ACCPM_MINUS_INF; }
00145   
00149   OracleFunction *getF1() const { return _f1; }
00150    
00154   OracleFunction *getF2() const { return _f2; }
00155 
00156 };
00157 }
00158 #endif