/usr/include/gecode/int/view/neg-bool.hpp is in libgecode-dev 3.7.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Christian Schulte, 2008
*
* Last modified:
* $Date: 2010-06-29 10:39:13 +0200 (Tue, 29 Jun 2010) $ by $Author: schulte $
* $Revision: 11118 $
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
namespace Gecode { namespace Int {
/*
* Negated Boolean views
*
*/
/*
* Constructors and initialization
*
*/
forceinline
NegBoolView::NegBoolView(void) {}
forceinline
NegBoolView::NegBoolView(const BoolView& y)
: DerivedView<BoolView>(y) {}
/*
* Boolean domain tests
*
*/
forceinline BoolStatus
NegBoolView::status(void) const {
return x.status();
}
forceinline bool
NegBoolView::zero(void) const {
return x.one();
}
forceinline bool
NegBoolView::one(void) const {
return x.zero();
}
forceinline bool
NegBoolView::none(void) const {
return x.none();
}
/*
* Boolean assignment operations
*
*/
forceinline ModEvent
NegBoolView::zero_none(Space& home) {
return x.one_none(home);
}
forceinline ModEvent
NegBoolView::one_none(Space& home) {
return x.zero_none(home);
}
forceinline ModEvent
NegBoolView::zero(Space& home) {
return x.one(home);
}
forceinline ModEvent
NegBoolView::one(Space& home) {
return x.zero(home);
}
/*
* Value access
*
*/
forceinline int
NegBoolView::min(void) const {
return x.max();
}
forceinline int
NegBoolView::max(void) const {
return x.min();
}
forceinline int
NegBoolView::val(void) const {
return 1-x.val();
}
/*
* Delta information for advisors
*
*/
forceinline int
NegBoolView::min(const Delta& d) const {
return x.max(d);
}
forceinline int
NegBoolView::max(const Delta& d) const {
return x.min(d);
}
forceinline bool
NegBoolView::any(const Delta& d) const {
return x.any(d);
}
forceinline bool
NegBoolView::zero(const Delta& d) {
return BoolView::one(d);
}
forceinline bool
NegBoolView::one(const Delta& d) {
return BoolView::zero(d);
}
/**
* \brief %Range iterator for negated Boolean variable views
* \ingroup TaskActorIntView
*/
template<>
class ViewRanges<NegBoolView> : public Iter::Ranges::Singleton {
public:
/// \name Constructors and initialization
//@{
/// Default constructor
ViewRanges(void);
/// Initialize with ranges for view \a x
ViewRanges(const NegBoolView& x);
/// Initialize with ranges for view \a x
void init(const NegBoolView& x);
//@}
};
forceinline
ViewRanges<NegBoolView>::ViewRanges(void) {}
forceinline
ViewRanges<NegBoolView>::ViewRanges(const NegBoolView& x)
: Iter::Ranges::Singleton(x.min(),x.max()) {}
forceinline void
ViewRanges<NegBoolView>::init(const NegBoolView& x) {
Iter::Ranges::Singleton::init(x.min(),x.max());
}
}}
// STATISTICS: int-var
|