~ubuntu-branches/debian/stretch/gecode/stretch

« back to all changes in this revision

Viewing changes to gecode/driver/options.hpp

  • Committer: Package Import Robot
  • Author(s): Kari Pahula
  • Date: 2013-05-25 15:57:32 UTC
  • mfrom: (1.1.17)
  • Revision ID: package-import@ubuntu.com-20130525155732-bltd8lu9my9borhk
Tags: 4.0.0-2
Give make check LD_LIBRARY_PATH=. to make test work without gecode
already installed, to fix FTBFS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 *     Christian Schulte, 2004
8
8
 *
9
9
 *  Last modified:
10
 
 *     $Date: 2011-02-22 23:52:12 +1100 (Tue, 22 Feb 2011) $ by $Author: schulte $
11
 
 *     $Revision: 11766 $
 
10
 *     $Date: 2013-02-20 20:15:12 +0100 (Wed, 20 Feb 2013) $ by $Author: schulte $
 
11
 *     $Revision: 13352 $
12
12
 *
13
13
 *  This file is part of Gecode, the generic constraint
14
14
 *  development environment:
41
41
namespace Gecode {
42
42
 
43
43
  namespace Driver {
 
44
 
44
45
    /*
45
46
     * String option
46
47
     *
47
48
     */
48
 
    inline
49
 
    StringValueOption::StringValueOption(const char* o, const char* e, 
50
 
                                         const char* v)
51
 
      : BaseOption(o,e), cur(strdup(v)) {}
52
 
    inline void
53
 
    StringValueOption::value(const char* v) {
54
 
      strdel(cur);
55
 
      cur = strdup(v);
56
 
    }
57
49
    inline const char*
58
50
    StringValueOption::value(void) const {
59
51
      return cur;
114
106
     */
115
107
    inline
116
108
    DoubleOption::DoubleOption(const char* o, const char* e,
117
 
                               unsigned int v)
 
109
                               double v)
118
110
      : BaseOption(o,e), cur(v) {}
119
111
    inline void
120
112
    DoubleOption::value(double v) {
130
122
     *
131
123
     */
132
124
    inline
133
 
    BoolOption::BoolOption(const char* o, const char* e) 
134
 
      : BaseOption(o,e), cur(false) {}
 
125
    BoolOption::BoolOption(const char* o, const char* e, bool v) 
 
126
      : BaseOption(o,e), cur(v) {}
135
127
    inline void
136
128
    BoolOption::value(bool v) {
137
129
      cur = v;
148
140
   * Options
149
141
   *
150
142
   */
151
 
  inline void
152
 
  BaseOptions::add(Driver::BaseOption& o) {
153
 
    o.next = NULL;
154
 
    if (fst == NULL) {
155
 
      fst=&o;
156
 
    } else {
157
 
      lst->next=&o;
158
 
    }
159
 
    lst=&o;
160
 
  }
161
143
  inline const char*
162
144
  BaseOptions::name(void) const {
163
145
    return _name;
229
211
  Options::branching(void) const {
230
212
    return _branching.value();
231
213
  }
 
214
 
 
215
  inline void
 
216
  Options::decay(double d) {
 
217
    _decay.value(d);
 
218
  }
 
219
  inline double
 
220
  Options::decay(void) const {
 
221
    return _decay.value();
 
222
  }
 
223
  
232
224
  
233
225
  /*
234
226
   * Search options
309
301
  Options::time(void) const {
310
302
    return _time.value();
311
303
  }
 
304
 
 
305
  inline void
 
306
  Options::restart(RestartMode rm) {
 
307
    _restart.value(rm);
 
308
  }
 
309
  inline RestartMode
 
310
  Options::restart(void) const {
 
311
    return static_cast<RestartMode>(_restart.value());
 
312
  }
 
313
  
 
314
  inline void
 
315
  Options::restart_base(double n) {
 
316
    _r_base.value(n);
 
317
  }
 
318
  inline double
 
319
  Options::restart_base(void) const {
 
320
    return _r_base.value();
 
321
  }
 
322
  
 
323
  inline void
 
324
  Options::restart_scale(unsigned int n) {
 
325
    _r_scale.value(n);
 
326
  }
 
327
  inline unsigned int
 
328
  Options::restart_scale(void) const {
 
329
    return _r_scale.value();
 
330
  }
 
331
  
312
332
  
313
333
  inline void
314
334
  Options::interrupt(bool b) {
316
336
  }
317
337
  inline bool
318
338
  Options::interrupt(void) const {
319
 
    return static_cast<bool>(_interrupt.value());
 
339
    return _interrupt.value();
320
340
  }
321
341
  
322
342
  
334
354
  }
335
355
  
336
356
  inline void
 
357
  Options::samples(unsigned int s) {
 
358
    _samples.value(s);
 
359
  }
 
360
  inline unsigned int
 
361
  Options::samples(void) const {
 
362
    return _samples.value();
 
363
  }
 
364
 
 
365
  inline void
337
366
  Options::iterations(unsigned int i) {
338
367
    _iterations.value(i);
339
368
  }
343
372
  }
344
373
  
345
374
  inline void
346
 
  Options::samples(unsigned int s) {
347
 
    _samples.value(s);
348
 
  }
349
 
  inline unsigned int
350
 
  Options::samples(void) const {
351
 
    return _samples.value();
 
375
  Options::print_last(bool p) {
 
376
    _print_last.value(p);
 
377
  }
 
378
  inline bool
 
379
  Options::print_last(void) const {
 
380
    return _print_last.value();
 
381
  }
 
382
 
 
383
  inline void
 
384
  Options::out_file(const char *f) {
 
385
    _out_file.value(f);
 
386
  }
 
387
 
 
388
  inline const char*
 
389
  Options::out_file(void) const {
 
390
    return _out_file.value();
 
391
  }
 
392
 
 
393
  inline void
 
394
  Options::log_file(const char* f) {
 
395
    _log_file.value(f);
 
396
  }
 
397
 
 
398
  inline const char*
 
399
  Options::log_file(void) const {
 
400
    return _log_file.value();
352
401
  }
353
402
 
354
403
#ifdef GECODE_HAS_GIST