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

minus.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, 2003
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   MinusView::MinusView(void) {}
00048   forceinline
00049   MinusView::MinusView(const FloatView& y)
00050     : DerivedView<FloatView>(y) {}
00051 
00052   /*
00053    * Value access
00054    *
00055    */
00056   forceinline FloatVal
00057   MinusView::domain(void) const {
00058     return -x.domain();
00059   }
00060   forceinline FloatNum
00061   MinusView::min(void) const {
00062     return -x.max();
00063   }
00064   forceinline FloatNum
00065   MinusView::max(void) const {
00066     return -x.min();
00067   }
00068   forceinline FloatNum
00069   MinusView::med(void) const {
00070     return -x.med();
00071   }
00072   forceinline FloatVal
00073   MinusView::val(void) const {
00074     return -x.val();
00075   }
00076 
00077   forceinline FloatNum
00078   MinusView::size(void) const {
00079     return x.size();
00080   }
00081 
00082 
00083   /*
00084    * Domain tests
00085    *
00086    */
00087   forceinline bool
00088   MinusView::zero_in(void) const {
00089     return x.zero_in();
00090   }
00091   forceinline bool
00092   MinusView::in(FloatNum n) const {
00093     return x.in(-n);
00094   }
00095   forceinline bool
00096   MinusView::in(const FloatVal& n) const {
00097     return x.in(-n);
00098   }
00099 
00100 
00101   /*
00102    * Domain update by value
00103    *
00104    */
00105   forceinline ModEvent
00106   MinusView::lq(Space& home, int n) {
00107     return x.gq(home,-n);
00108   }
00109   forceinline ModEvent
00110   MinusView::lq(Space& home, FloatNum n) {
00111     return x.gq(home,-n);
00112   }
00113   forceinline ModEvent
00114   MinusView::lq(Space& home, FloatVal n) {
00115     return x.gq(home,-n);
00116   }
00117 
00118   forceinline ModEvent
00119   MinusView::gq(Space& home, int n) {
00120     return x.lq(home,-n);
00121   }
00122   forceinline ModEvent
00123   MinusView::gq(Space& home, FloatNum n) {
00124     return x.lq(home,-n);
00125   }
00126   forceinline ModEvent
00127   MinusView::gq(Space& home, FloatVal n) {
00128     return x.lq(home,-n);
00129   }
00130 
00131   forceinline ModEvent
00132   MinusView::eq(Space& home, int n) {
00133     return x.eq(home,-n);
00134   }
00135   forceinline ModEvent
00136   MinusView::eq(Space& home, FloatNum n) {
00137     return x.eq(home,-n);
00138   }
00139   forceinline ModEvent
00140   MinusView::eq(Space& home, const FloatVal& n) {
00141     return x.eq(home,-n);
00142   }
00143 
00144 
00145   /*
00146    * Delta information for advisors
00147    *
00148    */
00149   forceinline FloatNum
00150   MinusView::min(const Delta& d) const {
00151     return -x.max(d);
00152   }
00153   forceinline FloatNum
00154   MinusView::max(const Delta& d) const {
00155     return -x.min(d);
00156   }
00157 
00158 
00159   forceinline ModEventDelta
00160   MinusView::med(ModEvent me) {
00161     return VarImpView<FloatVar>::med(me);
00162   }
00163 
00164 }}
00165 
00166 // STATISTICS: float-var
00167