sequence.cpp
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Guido Tack <tack@gecode.org>
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Guido Tack, 2004
* Christian Schulte, 2004
*
* 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.
*
*/
#include <gecode/set/sequence.hh>
using namespace Gecode::Set;
namespace Gecode {
void
sequence(Home home, const SetVarArgs& xa) {
if (xa.size()==0)
throw TooFewArguments("Set::seq");
GECODE_POST;
ViewArray<SetView> x(home,xa);
GECODE_ES_FAIL(Sequence::Seq::post(home, x));
}
void
sequence(Home home, const SetVarArgs& xa, SetVar y) {
GECODE_POST;
ViewArray<SetView> x(home,xa);
GECODE_ES_FAIL(Sequence::SeqU::post(home, x,y));
}
}
// STATISTICS: set-post
Gecode::ArgArrayBase::size
int size(void) const
Return size of array (number of elements).
Definition array.hpp:1607
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::Int::TooFewArguments
Exception: Too few arguments available in argument array
Definition exception.hpp:66
Gecode::SetVarArgs
Passing set variables.
Definition set.hh:488
Gecode::SetVar
Set variables
Definition set.hh:127
Gecode::Set::Sequence::SeqU::post
static ExecStatus post(Home home, ViewArray< SetView >, SetView)
Post propagator and .
Definition seq-u.hpp:58
Gecode::Set::Sequence::Seq::post
static ExecStatus post(Home home, ViewArray< SetView >)
Post propagator .
Definition seq.hpp:56
Gecode::ViewArray
View arrays.
Definition array.hpp:253
GECODE_POST
#define GECODE_POST
Check for failure in a constraint post function.
Definition macros.hpp:40
GECODE_ES_FAIL
#define GECODE_ES_FAIL(es)
Check whether execution status es is failed, and fail space home.
Definition macros.hpp:103
Gecode::Set
Finite integer sets.
Definition var-imp.hpp:137
Gecode
Gecode toplevel namespace
Gecode::sequence
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntPropLevel ipl=IPL_DEF)
Post propagator for .
Definition sequence.cpp:47
sequence.hh