Generated on for Gecode by doxygen 1.17.0
script.hpp
Go to the documentation of this file.
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2/*
3 * Main authors:
4 * Christian Schulte <schulte@gecode.dev>
5 *
6 * Copyright:
7 * Christian Schulte, 2004
8 *
9 * This file is part of Gecode, the generic constraint
10 * development environment:
11 * http://www.gecode.dev
12 *
13 *
14 * Permission is hereby granted, free of charge, to any person obtaining
15 * a copy of this software and associated documentation files (the
16 * "Software"), to deal in the Software without restriction, including
17 * without limitation the rights to use, copy, modify, merge, publish,
18 * distribute, sublicense, and/or sell copies of the Software, and to
19 * permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
21 *
22 * The above copyright notice and this permission notice shall be
23 * included in all copies or substantial portions of the Software.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 *
33 */
34
35#include <iostream>
36#include <iomanip>
37#include <fstream>
38#include <cstring>
39
40#ifndef GECODE_THREADS_WINDOWS
41#include <csignal>
42#endif
43
44namespace Gecode { namespace Driver {
45
50 class CombinedStop : public Search::Stop {
51 private:
57 static bool sigint;
59 CombinedStop(unsigned long long int node,
60 unsigned long long int fail,
61 double time,
62 unsigned long long int restart)
63 : ns((node > 0ULL) ? new Search::NodeStop(node) : nullptr),
64 fs((fail > 0ULL) ? new Search::FailStop(fail) : nullptr),
65 ts((time > 0.0) ? new Search::TimeStop(time) : nullptr),
66 rs((restart > 0.0) ? new Search::RestartStop(restart) : nullptr) {
67 sigint = false;
68 }
69 public:
71 enum {
72 SR_NODE = 1 << 0,
73 SR_FAIL = 1 << 1,
74 SR_TIME = 1 << 2,
75 SR_RESTART = 1 << 3,
76 SR_INT = 1 << 4
77 };
79 virtual bool stop(const Search::Statistics& s, const Search::Options& o) {
80 return
81 sigint ||
82 ((ns != nullptr) && ns->stop(s,o)) ||
83 ((fs != nullptr) && fs->stop(s,o)) ||
84 ((ts != nullptr) && ts->stop(s,o)) ||
85 ((rs != nullptr) && rs->stop(s,o));
86 }
87
88 int reason(const Search::Statistics& s, const Search::Options& o) {
89 return
90 (((ns != nullptr) && ns->stop(s,o)) ? SR_NODE : 0) |
91 (((fs != nullptr) && fs->stop(s,o)) ? SR_FAIL : 0) |
92 (((ts != nullptr) && ts->stop(s,o)) ? SR_TIME : 0) |
93 (((rs != nullptr) && rs->stop(s,o)) ? SR_RESTART : 0) |
94 (sigint ? SR_INT : 0);
95 }
96
97 static Search::Stop*
98 create(unsigned long long int node,
99 unsigned long long int fail,
100 double time,
101 unsigned long long int restart,
102 bool intr) {
103 if (!intr && (node == 0ULL) && (fail == 0ULL) && (time == 0.0) && (restart == 0ULL))
104 return nullptr;
105 else
106 return new CombinedStop(node,fail,time,restart);
107 }
108#ifdef GECODE_THREADS_WINDOWS
110 static BOOL interrupt(DWORD t) noexcept {
111 if (t == CTRL_C_EVENT) {
112 sigint = true;
113 installCtrlHandler(false,true);
114 return true;
115 }
116 return false;
117 }
118#else
120 static void
122 sigint = true;
123 installCtrlHandler(false,true);
124 }
125#endif
127 static void installCtrlHandler(bool install, bool force=false) {
128 if (force || !sigint) {
129#ifdef GECODE_THREADS_WINDOWS
130 SetConsoleCtrlHandler( (PHANDLER_ROUTINE) interrupt, install);
131#else
132 std::signal(SIGINT, install ? interrupt : SIG_DFL);
133#endif
134 }
135 }
136
138 delete ns; delete fs; delete ts; delete rs;
139 }
140 };
141
147 stop(Support::Timer& t, std::ostream& os);
148
153 am(double t[], unsigned int n);
154
159 dev(double t[], unsigned int n);
160
162 template<class Options>
163 inline Search::Cutoff*
165 switch (o.restart()) {
166 case RM_NONE:
167 return nullptr;
168 case RM_CONSTANT:
170 case RM_LINEAR:
172 case RM_LUBY:
174 case RM_GEOMETRIC:
176 default: GECODE_NEVER;
177 }
178 return nullptr;
179 }
180
181
182#ifdef GECODE_HAS_GIST
183
187 template<class Engine>
189 public:
190 static void explore(Space* root, const Gist::Options& opt) {
191 (void) Gist::dfs(root, opt);
192 }
193 };
194
196 template<typename S>
197 class GistEngine<DFS<S> > {
198 public:
199 static void explore(S* root, const Gist::Options& opt) {
200 (void) Gist::dfs(root, opt);
201 }
202 };
203
205 template<typename S>
206 class GistEngine<LDS<S> > {
207 public:
208 static void explore(S* root, const Gist::Options& opt) {
209 (void) Gist::dfs(root, opt);
210 }
211 };
212
214 template<typename S>
215 class GistEngine<BAB<S> > {
216 public:
217 static void explore(S* root, const Gist::Options& opt) {
218 (void) Gist::bab(root, opt);
219 }
220 };
221
222#endif
223
224#ifdef GECODE_HAS_CPPROFILER
225
227 template<class BaseSpace>
229 public:
231 ScriptGetInfo(void);
233 virtual std::string getInfo(const Space& home) const;
234 };
235
236#endif
237
238 template<class BaseSpace>
239 forceinline
241 : BaseSpace(opt) {}
242
243 template<class BaseSpace>
244 forceinline
247
248 template<class BaseSpace>
249 void
250 ScriptBase<BaseSpace>::print(std::ostream&) const {}
251
252 template<class BaseSpace>
253 void
254 ScriptBase<BaseSpace>::compare(const Space&, std::ostream&) const {}
255
256 template<class BaseSpace>
257 std::ostream&
258 ScriptBase<BaseSpace>::select_ostream(const char* sn, std::ofstream& ofs) {
259 if (strcmp(sn, "stdout") == 0) {
260 return std::cout;
261 } else if (strcmp(sn, "stdlog") == 0) {
262 return std::clog;
263 } else if (strcmp(sn, "stderr") == 0) {
264 return std::cerr;
265 } else {
266 ofs.open(sn);
267 return ofs;
268 }
269 }
270
271#ifdef GECODE_HAS_CPPROFILER
272
273 template<class BaseSpace>
275
276 template<class BaseSpace>
277 std::string
279 std::stringstream ss;
280 if (const ScriptBase<BaseSpace>* sb
281 = dynamic_cast<const ScriptBase<BaseSpace>*>(&home))
282 sb->print(ss);
283 return ss.str();
284 }
285
286#endif
287
288
292 template<class T, template<class> class E>
293 class EngineToMeta : public E<T> {
294 public:
295 EngineToMeta(T* s, const Search::Options& o) : E<T>(s,o) {}
296 };
297
298 template<class BaseSpace>
299 template<class Script, template<class> class Engine, class Options>
300 void
302 if ((o.restart() != RM_NONE) && (o.assets() > 0)) {
303 std::cerr << "Cannot use restarts and portfolio..." << std::endl;
304 exit(EXIT_FAILURE);
305 }
306 if (o.restart() != RM_NONE) {
307 runMeta<Script,Engine,Options,RBS>(o,s);
308 } else if (o.assets() > 0) {
309 runMeta<Script,Engine,Options,PBS>(o,s);
310 } else {
311 runMeta<Script,Engine,Options,EngineToMeta>(o,s);
312 }
313 }
314
315 template<class BaseSpace>
316 template<class Script, template<class> class Engine, class Options,
317 template<class, template<class> class> class Meta>
318 void
319 ScriptBase<BaseSpace>::runMeta(const Options& o, Script* s) {
320 using namespace std;
321
322 ofstream sol_file, log_file;
323
324 ostream& s_out = select_ostream(o.out_file(), sol_file);
325 ostream& l_out = select_ostream(o.log_file(), log_file);
326
328
329 try {
330 switch (o.mode()) {
331 case SM_GIST:
332#ifdef GECODE_HAS_GIST
333 {
334 Gist::Print<Script> pi(o.name());
335 Gist::VarComparator<Script> vc(o.name());
336 Gist::Options opt;
337 opt.inspect.click(&pi);
338 opt.inspect.compare(&vc);
339 opt.clone = false;
340 opt.c_d = o.c_d();
341 opt.a_d = o.a_d();
342 for (unsigned int i=0; o.inspect.click(i) != nullptr; i++)
343 opt.inspect.click(o.inspect.click(i));
344 for (unsigned int i=0; o.inspect.solution(i) != nullptr; i++)
345 opt.inspect.solution(o.inspect.solution(i));
346 for (unsigned int i=0; o.inspect.move(i) != nullptr; i++)
347 opt.inspect.move(o.inspect.move(i));
348 for (unsigned int i=0; o.inspect.compare(i) != nullptr; i++)
349 opt.inspect.compare(o.inspect.compare(i));
350 if (s == nullptr)
351 s = new Script(o);
352 (void) GistEngine<Engine<Script> >::explore(s, opt);
353 }
354 break;
355 // If Gist is not available, goto solution
356#else
357 goto solution;
358#endif
359 case SM_SOLUTION:
360#ifndef GECODE_HAS_GIST
361 solution:
362#endif
363 {
364#ifdef GECODE_HAS_CPPROFILER
365 if (o.profiler_port()) {
366 CPProfilerSearchTracer::GetInfo* getInfo = nullptr;
367 getInfo = new ScriptGetInfo<BaseSpace>;
369 (o.profiler_id(), o.name(), o.profiler_port(), getInfo);
370 }
371#endif
372 l_out << o.name() << endl;
373 Support::Timer t;
374 unsigned long long int s_l =
375 (o.solutions() == 0) ? ULLONG_MAX : o.solutions();
376 unsigned long long int s_n = 0;
377 t.start();
378 if (s == nullptr)
379 s = new Script(o);
380 unsigned int n_p = PropagatorGroup::all.size(*s);
381 unsigned int n_b = BrancherGroup::all.size(*s);
382 so.threads = o.threads();
383 so.c_d = o.c_d();
384 so.a_d = o.a_d();
385 so.d_l = o.d_l();
386 so.assets = o.assets();
387 so.slice = o.slice();
388 so.stop = CombinedStop::create(o.node(),o.fail(), o.time(), o.restart_limit(),
389 o.interrupt());
390 so.cutoff = createCutoff(o);
391 so.clone = false;
392 so.nogoods_limit = o.nogoods() ? o.nogoods_limit() : 0U;
393 if (o.interrupt())
394 CombinedStop::installCtrlHandler(true);
395 {
396 Meta<Script,Engine> e(s,so);
397 if (o.print_last()) {
398 Script* px = nullptr;
399 do {
400 Script* ex = e.next();
401 if (ex == nullptr) {
402 if (px != nullptr) {
403 px->print(s_out);
404 delete px;
405 }
406 break;
407 } else {
408 s_n++;
409 delete px;
410 px = ex;
411 }
412 } while (s_n < s_l);
413 } else {
414 do {
415 Script* ex = e.next();
416 if (ex == nullptr)
417 break;
418 ex->print(s_out);
419 delete ex;
420 s_n++;
421 } while (s_n < s_l);
422 }
423 if (o.interrupt())
424 CombinedStop::installCtrlHandler(false);
425 Search::Statistics stat = e.statistics();
426 s_out << endl;
427 if (e.stopped()) {
428 l_out << "Search engine stopped..." << endl
429 << "\treason: ";
430 int r = static_cast<CombinedStop*>(so.stop)->reason(stat,so);
431 if (r & CombinedStop::SR_INT)
432 l_out << "user interrupt " << endl;
433 else {
434 if (r & CombinedStop::SR_NODE)
435 l_out << "node ";
436 if (r & CombinedStop::SR_FAIL)
437 l_out << "fail ";
438 if (r & CombinedStop::SR_TIME)
439 l_out << "time ";
440 if (r & CombinedStop::SR_RESTART)
441 l_out << "restart ";
442 l_out << "limit reached" << endl << endl;
443 }
444 }
445 l_out << "Initial" << endl
446 << "\tpropagators: " << n_p << endl
447 << "\tbranchers: " << n_b << endl
448 << endl
449 << "Summary" << endl
450 << "\truntime: ";
451 stop(t, l_out);
452 l_out << endl
453 << "\tsolutions: " << s_n << endl
454 << "\tpropagations: " << stat.propagate << endl
455 << "\tnodes: " << stat.node << endl
456 << "\tfailures: " << stat.fail << endl
457 << "\trestarts: " << stat.restart << endl
458 << "\tno-goods: " << stat.nogood << endl
459 << "\tpeak depth: " << stat.depth << endl
460#ifdef GECODE_PEAKHEAP
461 << "\tpeak memory: "
462 << static_cast<int>((heap.peak()+1023) / 1024) << " KB"
463 << endl
464#endif
465 << endl;
466 }
467 delete so.stop;
468 delete so.tracer;
469 }
470 break;
471 case SM_STAT:
472 {
473 l_out << o.name() << endl;
474 Support::Timer t;
475 unsigned long long int s_l =
476 (o.solutions() == 0) ? ULLONG_MAX : o.solutions();
477 unsigned long long int s_n = 0;
478 t.start();
479 if (s == nullptr)
480 s = new Script(o);
481 unsigned int n_p = PropagatorGroup::all.size(*s);
482 unsigned int n_b = BrancherGroup::all.size(*s);
483
484 so.clone = false;
485 so.threads = o.threads();
486 so.assets = o.assets();
487 so.slice = o.slice();
488 so.c_d = o.c_d();
489 so.a_d = o.a_d();
490 so.d_l = o.d_l();
491 so.stop = CombinedStop::create(o.node(),o.fail(), o.time(), o.restart_limit(),
492 o.interrupt());
493 so.cutoff = createCutoff(o);
494 so.nogoods_limit = o.nogoods() ? o.nogoods_limit() : 0U;
495 if (o.interrupt())
496 CombinedStop::installCtrlHandler(true);
497 {
498 Meta<Script,Engine> e(s,so);
499 do {
500 Script* ex = e.next();
501 if (ex == nullptr)
502 break;
503 delete ex;
504 s_n++;
505 } while (s_n < s_l);
506 if (o.interrupt())
507 CombinedStop::installCtrlHandler(false);
508 Search::Statistics stat = e.statistics();
509 l_out << endl
510 << "\tpropagators: " << n_p << endl
511 << "\tbranchers: " << n_b << endl
512 << "\truntime: ";
513 stop(t, l_out);
514 l_out << endl
515 << "\tsolutions: " << s_n << endl
516 << "\tpropagations: " << stat.propagate << endl
517 << "\tnodes: " << stat.node << endl
518 << "\tfailures: " << stat.fail << endl
519 << "\trestarts: " << stat.restart << endl
520 << "\tno-goods: " << stat.nogood << endl
521 << "\tpeak depth: " << stat.depth << endl
522#ifdef GECODE_PEAKHEAP
523 << "\tpeak memory: "
524 << static_cast<int>((heap.peak()+1023) / 1024) << " KB"
525 << endl
526#endif
527 << endl;
528 }
529 delete so.stop;
530 }
531 break;
532 case SM_TIME:
533 {
534 l_out << o.name() << endl;
535 Support::Timer t;
536 double* ts = new double[o.samples()];
537 bool stopped = false;
538 for (unsigned int ns = o.samples(); !stopped && ns--; ) {
539 unsigned long long int s_l =
540 (o.solutions() == 0) ? ULLONG_MAX : o.solutions();
541 t.start();
542 for (unsigned int k = o.iterations(); !stopped && k--; ) {
543 unsigned long long int s_n = 0;
544 Script* s1 = new Script(o);
545 Search::Options sok;
546 sok.clone = false;
547 sok.threads = o.threads();
548 sok.assets = o.assets();
549 sok.slice = o.slice();
550 sok.c_d = o.c_d();
551 sok.a_d = o.a_d();
552 sok.d_l = o.d_l();
553 sok.stop = CombinedStop::create(o.node(),o.fail(), o.time(), o.restart_limit(),
554 false);
555 sok.cutoff = createCutoff(o);
556 sok.nogoods_limit = o.nogoods() ? o.nogoods_limit() : 0U;
557 {
558 Meta<Script,Engine> e(s1,sok);
559 do {
560 Script* ex = e.next();
561 if (ex == nullptr)
562 break;
563 delete ex;
564 s_n++;
565 } while (s_n < s_l);
566 if (e.stopped())
567 stopped = true;
568 }
569 delete sok.stop;
570 }
571 ts[ns] = t.stop() / o.iterations();
572 }
573 if (stopped) {
574 l_out << "\tSTOPPED" << endl;
575 } else {
576 double m = am(ts,o.samples());
577 double d = dev(ts,o.samples()) * 100.0;
578 l_out << "\truntime: "
579 << setw(20) << right
580 << showpoint << fixed
581 << setprecision(6) << m << "ms"
582 << setprecision(2) << " (" << d << "% deviation)"
583 << endl;
584 }
585 delete [] ts;
586 }
587 break;
588 }
589 } catch (Exception& e) {
590 cerr << "Exception: " << e.what() << "." << endl
591 << "Stopping..." << endl;
592 if (sol_file.is_open())
593 sol_file.close();
594 if (log_file.is_open())
595 log_file.close();
596 exit(EXIT_FAILURE);
597 }
598 if (sol_file.is_open())
599 sol_file.close();
600 if (log_file.is_open())
601 log_file.close();
602 }
603
604}}
605
606// STATISTICS: driver-any
Depth-first branch-and-bound search engine.
Definition search.hh:1114
Class to send solution information to CPProfiler.
Definition search.hh:427
Class to record search trace info for CPProfiler.
Definition search.hh:424
Depth-first search engine.
Definition search.hh:1080
~CombinedStop(void)
Destructor.
Definition script.hpp:137
static void installCtrlHandler(bool install, bool force=false)
Install handler for catching Ctrl-C.
Definition script.hpp:127
virtual bool stop(const Search::Statistics &s, const Search::Options &o)
Test whether search must be stopped.
Definition script.hpp:79
static void interrupt(int)
Handler for catching Ctrl-C.
Definition script.hpp:121
@ SR_INT
Interrupted by user.
Definition script.hpp:76
@ SR_NODE
Node limit reached.
Definition script.hpp:72
@ SR_FAIL
Fail limit reached.
Definition script.hpp:73
@ SR_TIME
Time limit reached.
Definition script.hpp:74
@ SR_RESTART
Time limit reached.
Definition script.hpp:75
static Search::Stop * create(unsigned long long int node, unsigned long long int fail, double time, unsigned long long int restart, bool intr)
Create appropriate stop-object.
Definition script.hpp:98
int reason(const Search::Statistics &s, const Search::Options &o)
Report reason why search has been stopped.
Definition script.hpp:88
EngineToMeta(T *s, const Search::Options &o)
Definition script.hpp:295
static void explore(S *root, const Gist::Options &opt)
Definition script.hpp:217
static void explore(S *root, const Gist::Options &opt)
Definition script.hpp:199
static void explore(S *root, const Gist::Options &opt)
Definition script.hpp:208
Traits class for search engines.
Definition script.hpp:188
static void explore(Space *root, const Gist::Options &opt)
Definition script.hpp:190
Parametric base-class for scripts.
Definition driver.hh:777
static void run(const Options &opt, Script *s=nullptr)
Definition script.hpp:301
virtual void compare(const Space &home, std::ostream &os) const
Compare with s.
Definition script.hpp:254
virtual void print(std::ostream &os) const
Print a solution to os.
Definition script.hpp:250
static std::ostream & select_ostream(const char *sn, std::ofstream &ofs)
Choose output stream according to sn.
Definition script.hpp:258
ScriptBase(const Options &opt)
Constructor.
Definition script.hpp:240
ScriptGetInfo(void)
Initialize.
Definition script.hpp:274
virtual std::string getInfo(const Space &home) const
Return info for a space (which must be a script).
Definition script.hpp:278
Options for Gist
Definition gist.hh:234
An inspector for printing simple text output.
Definition gist.hh:188
A simple comparator.
Definition gist.hh:211
Limited discrepancy search engine.
Definition search.hh:1152
Options for scripts
Definition driver.hh:410
void restart(RestartMode r)
Set default restart mode.
Definition options.hpp:402
void assets(unsigned int n)
Set default number of assets in a portfolio.
Definition options.hpp:384
void restart_scale(unsigned int scale)
Set default restart scale factor.
Definition options.hpp:420
void restart_base(double base)
Set default restart base.
Definition options.hpp:411
Base class for cutoff generators for restart-based meta engine.
Definition search.hh:476
static Cutoff * linear(unsigned long long int scale=Config::slice)
Create generator for linear sequence scaled by scale.
static Cutoff * constant(unsigned long long int scale=Config::slice)
Create generator for constant sequence with constant s.
static Cutoff * luby(unsigned long long int scale=Config::slice)
Create generator for luby sequence with scale-factor scale.
static Cutoff * geometric(unsigned long long int scale=Config::slice, double base=Config::base)
Stop-object based on number of failures
Definition search.hh:863
Stop-object based on number of nodes
Definition search.hh:836
Search engine options
Definition search.hh:751
unsigned int c_d
Create a clone after every c_d commits (commit distance).
Definition search.hh:758
bool clone
Whether engines create a clone when being initialized.
Definition search.hh:754
unsigned int d_l
Discrepancy limit (for LDS).
Definition search.hh:762
Cutoff * cutoff
Cutoff for restart-based search.
Definition search.hh:772
unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance).
Definition search.hh:760
Stop * stop
Stop object for stopping search.
Definition search.hh:770
SearchTracer * tracer
Tracer object for tracing search.
Definition search.hh:774
unsigned int assets
Number of assets (engines) in a portfolio.
Definition search.hh:764
unsigned int slice
Size of a slice in a portfolio (in number of failures).
Definition search.hh:766
unsigned int nogoods_limit
Depth limit for extraction of no-goods.
Definition search.hh:768
double threads
Number of threads to use.
Definition search.hh:756
Stop-object based on number of restarts
Definition search.hh:915
Search engine statistics
Definition search.hh:151
Base-class for Stop-object.
Definition search.hh:804
static Stop * node(unsigned long long int l)
Stop if node limit l has been exceeded.
static Stop * time(double l)
Stop if time limit l (in milliseconds) has been exceeded.
static Stop * fail(unsigned long long int l)
Stop if failure limit l has been exceeded.
static Stop * restart(unsigned long long int l)
Stop if restart limit l has been exceeded.
Stop-object based on time
Definition search.hh:886
Computation spaces.
Definition core.hpp:1775
#define GECODE_DRIVER_EXPORT
Definition driver.hh:59
Heap heap
The single global heap.
@ SM_STAT
Print statistics for script.
Definition driver.hh:97
@ SM_SOLUTION
Print solution and some statistics.
Definition driver.hh:95
@ SM_GIST
Run script in Gist.
Definition driver.hh:98
@ SM_TIME
Measure average runtime.
Definition driver.hh:96
@ RM_CONSTANT
Restart with constant sequence.
Definition driver.hh:107
@ RM_LINEAR
Restart with linear sequence.
Definition driver.hh:108
@ RM_LUBY
Restart with Luby sequence.
Definition driver.hh:109
@ RM_NONE
No restarts.
Definition driver.hh:106
@ RM_GEOMETRIC
Restart with geometric sequence.
Definition driver.hh:110
Driver::ScriptBase< Driver::IgnoreStepOption< Space > > Script
Base-class for scripts.
Definition driver.hh:849
int bab(Space *root, const Gist::Options &opt=Gist::Options::def)
Create a new stand-alone Gist for branch-and-bound search of root.
Definition gist.hpp:208
int dfs(Space *root, const Gist::Options &opt=Gist::Options::def)
Create a new stand-alone Gist for root.
Definition gist.hpp:203
Script commandline driver.
double dev(double t[], unsigned int n)
Compute deviation of n elements in t.
void stop(Support::Timer &t, std::ostream &os)
Get time since start of timer and print user friendly time information.
Search::Cutoff * createCutoff(const Options &o)
Create cutoff object from options.
Definition script.hpp:164
double am(double t[], unsigned int n)
Compute arithmetic mean of n elements in t.
Gecode toplevel namespace
const int * pi[]
Definition photo.cpp:14262
#define GECODE_NEVER
Assert that this command is never executed.
Definition macros.hpp:56