support-values.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Christian Schulte, 2008
*
* 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.
*
*/
#ifndef __GECODE_INT_SUPPORT_VALUES_HH__
#define __GECODE_INT_SUPPORT_VALUES_HH__
#include <gecode/int.hh>
namespace Gecode { namespace Int {
template<class View, class A>
class SupportValues {
private:
A& a;
class RangePos {
public:
int min;
unsigned int pos;
};
class Unsupported {
private:
RangePos* rp;
unsigned int p;
SupportValues& sv;
void find(void);
public:
Unsupported(SupportValues& sv0);
bool operator ()(void) const;
void operator ++(void);
int val(void) const;
};
View x;
Gecode::Support::BitSetBase bs;
RangePos* rp_fst;
RangePos* rp_lst;
RangePos* rp;
int v;
int max;
bool _support(int n);
public:
SupportValues(A& a, View x);
~SupportValues(void);
void reset(void);
bool operator ()(void) const;
void operator ++(void);
int val(void) const;
void support(void);
bool support(int n);
bool support(long long int n);
ModEvent tell(Space& home);
};
}}
#include <gecode/int/support-values.hpp>
#endif
// STATISTICS: int-prop
Gecode::Int::SupportValues::val
int val(void) const
Return current value.
Definition support-values.hpp:88
Gecode::Int::SupportValues::support
void support(void)
Mark current (iterator) value as supported.
Definition support-values.hpp:94
Gecode::Int::SupportValues::~SupportValues
~SupportValues(void)
Destructor.
Definition support-values.hpp:65
Gecode::Int::SupportValues::SupportValues
SupportValues(A &a, View x)
Initialize for view x.
Definition support-values.hpp:45
Gecode::Int::SupportValues::tell
ModEvent tell(Space &home)
Remove all unsupported values.
Definition support-values.hpp:175
Gecode::Int::SupportValues::operator++
void operator++(void)
Move iterator to next value (if possible).
Definition support-values.hpp:72
Gecode::Int::SupportValues::reset
void reset(void)
Reset iterator.
Definition support-values.hpp:38
Gecode::Int::SupportValues::operator()
bool operator()(void) const
Test whether iterator is still at a value or done.
Definition support-values.hpp:82
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Gecode::Support::BitSetBase
Basic bitset support.
Definition bitset-base.hpp:190
Gecode::View
int.hh
Gecode::Int
Finite domain integers.
Gecode
Gecode toplevel namespace
Gecode::min
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition arithmetic.cpp:67
Gecode::ModEvent
int ModEvent
Type for modification events.
Definition core.hpp:62
support-values.hpp