34 namespace Gecode {
namespace Gist {
43 std::ostringstream result;
44 dynamic_cast<const S&
>(s0).
compare(s1,result);
45 if (result.str() !=
"") {
69 std::ostringstream ret;
70 ret << x_n <<
"=" << x <<
" -> " <<
y;
78 std::ostringstream ret;
79 ret << x_n <<
"=" << x <<
" -> " <<
y;
84 #ifdef GECODE_HAS_SET_VARS 93 std::ostringstream ret;
94 ret << x_n <<
"=" << x <<
" -> " <<
y;
100 #ifdef GECODE_HAS_FLOAT_VARS 104 std::ostringstream ret;
105 ret << x_n <<
"=" << x <<
" -> " <<
y;
116 return "Error: array size mismatch";
117 std::ostringstream ret;
119 for (
int i=0;
i<x.
size();
i++) {
120 std::ostringstream xni;
121 xni << x_n <<
"[" <<
i <<
"]";
122 std::string cmp =
compare(xni.str(),x[
i],y[
i]);
166 _solution(
heap,1), n_solution(0),
167 _move(
heap,1), n_move(0), _compare(
heap,1), n_compare(0) {}
171 _click[
static_cast<int>(n_click++)] = i;
175 _solution[
static_cast<int>(n_solution++)] = i;
179 _move[
static_cast<int>(n_move++)] = i;
183 _compare[
static_cast<int>(n_compare++)] = c;
187 return (i < n_click) ? _click[
i] : NULL;
191 return (i < n_solution) ? _solution[
i] : NULL;
195 return (i < n_move) ? _move[
i] : NULL;
199 return (i < n_compare) ? _compare[
i] : NULL;
204 return explore(root,
false, opt);
void click(Inspector *i)
Add inspector that reacts on node double clicks.
int min(void) const
Return minimum of domain.
std::ostream & getStream(void)
Get the stream that is used to output text.
int size(void) const
Return size of array (number of elements)
void addHtml(const char *s)
Add html text s to the output.
FloatNum max(void) const
Return maximum of domain.
Abstract base class for comparators.
virtual std::string name(void)
Name of the inspector.
void flush(void)
Flush stream.
bool equal(I &i, J &j)
Check whether range iterators i and j are equal.
virtual void inspect(const Space &node)
Use the print method of the template class S to print a space.
Abstract base class for inspectors.
virtual void finalize(void)
Clean up when Gist exits.
Range iterator for integer variables
void solution(Inspector *i)
Add inspector that reacts on each new solution that is found.
FloatNum min(void) const
Return minimum of domain.
Gecode::FloatVal c(-8, 8)
Gecode::IntArgs i({1, 2, 3, 4})
int dfs(Space *root, const Gist::Options &opt)
Create a new stand-alone Gist for root.
void finalize(void)
Clean up when Gist exits.
Print(const std::string &name)
Constructor.
unsigned int cardMin(void) const
Return cardinality minimum.
Iterator for the greatest lower bound ranges of a set variable.
virtual void compare(const Space &s0, const Space &s1)=0
Call-back function.
Options(void)
Initialize with default values.
Iterator for the least upper bound ranges of a set variable.
Boolean integer variables.
void init(void)
Initialize the implementation object.
void print(std::basic_ostream< Char, Traits > &s, bool assigned, IL &lb, IU &ub, unsigned int cardMin, unsigned int cardMax)
Print set view.
VarComparator(std::string name)
Constructor.
Post propagator for SetVar SetOpType SetVar y
virtual void finalize(void)
Finalize when Gist exits.
Heap heap
The single global heap.
virtual void compare(const Space &s0, const Space &s1)
Compare s0 to s1.
int bab(Space *root, const Gist::Options &opt)
Create a new stand-alone Gist for branch-and-bound search of root.
An window for simple text output.
virtual std::string name(void)
Return name.
Post propagator for SetVar x
unsigned int cardMax(void) const
Return cardinality maximum.
int explore(Space *root, bool bab, const Options &opt)
Create a new stand-alone Gist for root using bab.
Gecode toplevel namespace
Argument array for variables.
void compare(Comparator *c)
Add comparator.
virtual std::string name(void)
Return name.
int max(void) const
Return maximum of domain.
void move(Inspector *i)
Add inspector that reacts on each move of the cursor.