main page
modules
namespaces
classes
files
Gecode home
Generated on Tue Jan 28 2020 00:00:00 for Gecode by
doxygen
1.8.17
gecode
search
lds.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.org>
5
*
6
* Copyright:
7
* Christian Schulte, 2004, 2016
8
*
9
* Last modified:
10
* $Date: 2016-09-22 16:19:20 +0200 (Thu, 22 Sep 2016) $ by $Author: schulte $
11
* $Revision: 15169 $
12
*
13
* This file is part of Gecode, the generic constraint
14
* development environment:
15
* http://www.gecode.org
16
*
17
* Permission is hereby granted, free of charge, to any person obtaining
18
* a copy of this software and associated documentation files (the
19
* "Software"), to deal in the Software without restriction, including
20
* without limitation the rights to use, copy, modify, merge, publish,
21
* distribute, sublicense, and/or sell copies of the Software, and to
22
* permit persons to whom the Software is furnished to do so, subject to
23
* the following conditions:
24
*
25
* The above copyright notice and this permission notice shall be
26
* included in all copies or substantial portions of the Software.
27
*
28
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35
*
36
*/
37
38
namespace
Gecode
{
namespace
Search {
39
41
GECODE_SEARCH_EXPORT
Engine*
42
lds
(Space* s,
const
Options& o);
43
45
template
<
class
T>
46
class
LdsBuilder
:
public
Builder
{
47
using
Builder::opt
;
48
public
:
50
LdsBuilder
(
const
Options
&
opt
);
52
virtual
Engine
*
operator()
(
Space
* s)
const
;
53
};
54
55
template
<
class
T>
56
inline
57
LdsBuilder<T>::LdsBuilder
(
const
Options
&
opt
)
58
:
Builder
(
opt
,
LDS
<T>::best) {}
59
60
template
<
class
T>
61
Engine
*
62
LdsBuilder<T>::operator()
(
Space
* s)
const
{
63
return
build<T,LDS>(s,
opt
);
64
}
65
66
67
}}
68
69
namespace
Gecode
{
70
71
template
<
class
T>
72
forceinline
73
LDS<T>::LDS
(T* s,
const
Search::Options
& o)
74
: Search::Base<T>(Search::
lds
(s,o)) {}
75
76
template
<
class
T>
77
T*
78
lds
(T* s,
const
Search::Options
& o) {
79
LDS<T>
lds
(s,o);
80
return
lds
.next();
81
}
82
83
template
<
class
T>
84
SEB
85
lds
(
const
Search::Options
& o) {
86
return
new
Search::LdsBuilder<T>
(o);
87
}
88
89
}
90
91
// STATISTICS: search-other
forceinline
#define forceinline
Definition:
config.hpp:173
GECODE_SEARCH_EXPORT
#define GECODE_SEARCH_EXPORT
Definition:
search.hh:63
Gecode::Search::Options
Search engine options
Definition:
search.hh:446
Gecode::Search::Builder
A class for building search engines.
Definition:
search.hh:667
Gecode::LDS::LDS
LDS(T *s, const Search::Options &o=Search::Options::def)
Initialize engine for space s and options o.
Definition:
lds.hpp:73
Gecode::LDS
Limited discrepancy search engine.
Definition:
search.hh:811
Gecode::Search::LdsBuilder
A DFS engine builder.
Definition:
lds.hpp:46
Gecode::Search::LdsBuilder::LdsBuilder
LdsBuilder(const Options &opt)
The constructor.
Definition:
lds.hpp:57
Gecode::Space
Computation spaces.
Definition:
core.hpp:1748
Gecode
Gecode toplevel namespace
Gecode::SEB
Search::Builder * SEB
Type for a search engine builder.
Definition:
search.hh:695
Test::opt
Options opt
The options.
Definition:
test.cpp:101
Gecode::Search::Engine
Search engine implementation interface
Definition:
search.hh:601
Gecode::Search::LdsBuilder::operator()
virtual Engine * operator()(Space *s) const
The actual build function.
Definition:
lds.hpp:62
Gecode::Search::Builder::opt
Options opt
Stored and already expanded options.
Definition:
search.hh:670
Gecode::Search::lds
Engine * lds(Space *s, const Options &o)
Create lds engine.
Definition:
lds.cpp:48
Gecode::lds
T * lds(T *s, const Search::Options &o)
Invoke limited-discrepancy search for s as root node and optionso.
Definition:
lds.hpp:78