00001 // pf* implementation -*- C++ -*- 00002 00003 // $Id: dbtools.h 634 2008-05-20 14:28:14Z herman $ 00004 // Copyright (C) 2001-2003 Hermann Schichl 00005 // 00006 // This file is part of the COCONUT API. This library 00007 // is free software; you can redistribute it and/or modify it under the 00008 // terms of the Library GNU General Public License as published by the 00009 // Free Software Foundation; either version 2, or (at your option) 00010 // any later version. 00011 00012 // This library is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // Library GNU General Public License for more details. 00016 00017 // As a special exception, you may use this file as part of a free software 00018 // library without restriction. Specifically, if other files instantiate 00019 // templates or use macros or inline functions from this file, or you compile 00020 // this file and link it with other files to produce an executable, this 00021 // file does not by itself cause the resulting executable to be covered by 00022 // the Library GNU General Public License. This exception does not however 00023 // invalidate any other reasons why the executable file might be covered by 00024 // the Library GNU General Public License. 00025 00028 #ifndef _PFSTAR_H_ 00029 #define _PFSTAR_H_ 00030 00031 #include <dbbasic.h> 00032 #include <db_method> 00033 #include <sgraphctx.h> 00034 00035 namespace coco { 00036 00038 00043 class calc_pf_star : public vdbl::method<double> 00044 { 00045 public: 00047 typedef search_graph_context context; 00048 00049 private: 00051 typedef vdbl::method<double> _Base; 00053 vdbl::colid x_lowbnd; 00055 vdbl::colid x_width; 00057 const vdbl::row* _r; 00059 const search_graph_context* sgc; 00060 00061 public: 00063 typedef double return_type; 00064 00066 calc_pf_star(vdbl::colid _l, vdbl::colid _w) 00067 : _Base(), x_lowbnd(_l), x_width(_w), _r(), sgc(NULL) {} 00069 calc_pf_star(const calc_pf_star& _i) 00070 : _Base(_i), x_lowbnd(_i.x_lowbnd), x_width(_i.x_width), 00071 _r(_i._r), sgc(_i.sgc) {} 00073 virtual ~calc_pf_star() {} 00074 00076 double operator() () const; 00078 double def() const { return operator()(); } 00081 void setcontext(const context* c, const vdbl::row* r) 00082 { _r = r; sgc = (search_graph_context *) c; } 00083 }; 00084 00085 } // namespace coco 00086 00087 #endif // _PFSTAR_H