Generated on Tue Apr 18 10:21:43 2017 for Gecode by doxygen 1.6.3

float.hpp

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Christian Schulte <schulte@gecode.org>
00005  *     Vincent Barichard <Vincent.Barichard@univ-angers.fr>
00006  *
00007  *  Copyright:
00008  *     Christian Schulte, 2002
00009  *     Vincent Barichard, 2012
00010  *
00011  *  Last modified:
00012  *     $Date: 2012-04-06 13:04:47 +0200 (Fri, 06 Apr 2012) $ by $Author: schulte $
00013  *     $Revision: 12711 $
00014  *
00015  *  This file is part of Gecode, the generic constraint
00016  *  development environment:
00017  *     http://www.gecode.org
00018  *
00019  *  Permission is hereby granted, free of charge, to any person obtaining
00020  *  a copy of this software and associated documentation files (the
00021  *  "Software"), to deal in the Software without restriction, including
00022  *  without limitation the rights to use, copy, modify, merge, publish,
00023  *  distribute, sublicense, and/or sell copies of the Software, and to
00024  *  permit persons to whom the Software is furnished to do so, subject to
00025  *  the following conditions:
00026  *
00027  *  The above copyright notice and this permission notice shall be
00028  *  included in all copies or substantial portions of the Software.
00029  *
00030  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00031  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00032  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00033  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00034  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00035  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00036  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00037  *
00038  */
00039 
00040 namespace Gecode { namespace Float {
00041 
00042   /*
00043    * Constructors and initialization
00044    *
00045    */
00046   forceinline
00047   FloatView::FloatView(void) {}
00048   forceinline
00049   FloatView::FloatView(const FloatVar& y)
00050     : VarImpView<FloatVar>(y.varimp()) {}
00051   forceinline
00052   FloatView::FloatView(FloatVarImp* y)
00053     : VarImpView<FloatVar>(y) {}
00054 
00055   /*
00056    * Value access
00057    *
00058    */
00059   forceinline FloatVal
00060   FloatView::domain(void) const {
00061     return x->domain();
00062   }
00063   forceinline FloatNum
00064   FloatView::min(void) const {
00065     return x->min();
00066   }
00067   forceinline FloatNum
00068   FloatView::max(void) const {
00069     return x->max();
00070   }
00071   forceinline FloatNum
00072   FloatView::med(void) const {
00073     return x->med();
00074   }
00075   forceinline FloatVal
00076   FloatView::val(void) const {
00077     return x->val();
00078   }
00079 
00080   forceinline FloatNum
00081   FloatView::size(void) const {
00082     return x->size();
00083   }
00084 
00085 
00086   /*
00087    * Domain tests
00088    *
00089    */
00090   forceinline bool
00091   FloatView::zero_in(void) const {
00092     return x->zero_in();
00093   }
00094   forceinline bool
00095   FloatView::in(FloatNum n) const {
00096     return x->in(n);
00097   }
00098   forceinline bool
00099   FloatView::in(const FloatVal& n) const {
00100     return x->in(n);
00101   }
00102 
00103 
00104   /*
00105    * Domain update by value
00106    *
00107    */
00108   forceinline ModEvent
00109   FloatView::lq(Space& home, int n) {
00110     return x->lq(home,n);
00111   }
00112   forceinline ModEvent
00113   FloatView::lq(Space& home, FloatNum n) {
00114     return x->lq(home,n);
00115   }
00116   forceinline ModEvent
00117   FloatView::lq(Space& home, FloatVal n) {
00118     return x->lq(home,n);
00119   }
00120 
00121   forceinline ModEvent
00122   FloatView::gq(Space& home, int n) {
00123     return x->gq(home,n);
00124   }
00125   forceinline ModEvent
00126   FloatView::gq(Space& home, FloatNum n) {
00127     return x->gq(home,n);
00128   }
00129   forceinline ModEvent
00130   FloatView::gq(Space& home, FloatVal n) {
00131     return x->gq(home,n);
00132   }
00133 
00134   forceinline ModEvent
00135   FloatView::eq(Space& home, int n) {
00136     return x->eq(home,n);
00137   }
00138   forceinline ModEvent
00139   FloatView::eq(Space& home, FloatNum n) {
00140     return x->eq(home,n);
00141   }
00142   forceinline ModEvent
00143   FloatView::eq(Space& home, const FloatVal& n) {
00144     return x->eq(home,n);
00145   }
00146 
00147 
00148 
00149   /*
00150    * Delta information for advisors
00151    *
00152    */
00153   forceinline FloatNum
00154   FloatView::min(const Delta& d) const {
00155     return FloatVarImp::min(d);
00156   }
00157   forceinline FloatNum
00158   FloatView::max(const Delta& d) const {
00159     return FloatVarImp::max(d);
00160   }
00161 
00162 
00163   forceinline ModEventDelta
00164   FloatView::med(ModEvent me) {
00165     return VarImpView<FloatVar>::med(me);
00166   }
00167 
00168 }}
00169 
00170 // STATISTICS: float-var
00171