Main Page | Class Hierarchy | Class List | File List | Class Members

FP.h

00001 // FP.h -- The forward pruning filter interface.
00002 
00003 /*
00004  * Copyright (C) 1998 Tudor Hulubei <tudor@hulubei.net>.
00005  *
00006  * This library is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as
00008  * published by the Free Software Foundation; either version 2, or (at
00009  * your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA,
00019  * 02111-1307, USA.
00020  */
00021 
00022 // $Id: FP_8h-source.html,v 1.1 2005/05/25 12:37:18 tudor Exp $
00023 
00024 #ifndef _CSP_FILTERS_FP_H
00025 #define _CSP_FILTERS_FP_H
00026 
00027 
00028 CSP_NAMESPACE_BEGIN(csp);
00029 CSP_NAMESPACE_BEGIN(filters);
00030 
00031 
00040 class CSP_API FP :
00041     public Filter
00042 {
00043   public:
00044     FP(Problem& problem, Retraction& retraction) :
00045         Filter(L"Forward Pruning", L"FP", problem, retraction) {}
00046     virtual ~FP() {}
00047 
00048     virtual bool restoresArcConsistency() const { return false; }
00049 
00050     virtual bool propagate(
00051         const vlist_type& uninstantiatedVariables,
00052         const vlist_type& modifiedVariables,
00053         const bool keepChanges = true);
00054 
00055     virtual bool init(
00056         const vlist_type& uninstantiatedVariables,
00057         bool propagate = true);
00058     virtual void done() { Filter::done(); }
00059 
00060   private:
00061     // We make this global to avoid constructor calls.
00062     Domain m_diffs;
00063 
00065     FP(const FP&);
00066 
00068     FP& operator=(const FP&);
00069 
00070     bool prune(Constraint& constraint, Variable& variable);
00071 };
00072 
00073 
00074 CSP_NAMESPACE_END(filters);
00075 CSP_NAMESPACE_END(csp);
00076 
00077 
00078 #endif // _CSP_FILTERS_FP_H
00079 
00080 // Local Variables:
00081 // mode: C++
00082 // End:

Generated on Wed May 25 12:21:14 2005 for csp.kdevelop by  doxygen 1.3.9.1