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
int
unary
post.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, 2015
8
*
9
* Last modified:
10
* $Date: 2015-09-16 14:58:27 +0200 (Wed, 16 Sep 2015) $ by $Author: schulte $
11
* $Revision: 14688 $
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
Int {
namespace
Unary {
39
40
template
<
class
ManTask>
41
forceinline
ExecStatus
42
manpost
(
Home
home,
TaskArray<ManTask>
&
t
,
IntPropLevel
ipl) {
43
switch
(
ba
(ipl)) {
44
case
IPL_BASIC
:
default
:
45
return
ManProp<ManTask,PLB>::post
(home,
t
);
46
case
IPL_ADVANCED
:
47
return
ManProp<ManTask,PLA>::post
(home,
t
);
48
case
IPL_BASIC_ADVANCED
:
49
return
ManProp<ManTask,PLBA>::post
(home,
t
);
50
}
51
GECODE_NEVER
;
52
return
ES_OK
;
53
}
54
55
template
<
class
OptTask>
56
forceinline
ExecStatus
57
optpost
(
Home
home,
TaskArray<OptTask>
&
t
,
IntPropLevel
ipl) {
58
switch
(
ba
(ipl)) {
59
case
IPL_BASIC
:
default
:
60
return
OptProp<OptTask,PLB>::post
(home,
t
);
61
case
IPL_ADVANCED
:
62
return
OptProp<OptTask,PLA>::post
(home,
t
);
63
case
IPL_BASIC_ADVANCED
:
64
return
OptProp<OptTask,PLBA>::post
(home,
t
);
65
}
66
GECODE_NEVER
;
67
return
ES_OK
;
68
}
69
70
}}}
71
72
// STATISTICS: int-post
forceinline
#define forceinline
Definition:
config.hpp:173
Gecode::IPL_ADVANCED
@ IPL_ADVANCED
Use advanced propagation algorithm.
Definition:
int.hh:966
t
NodeType t
Type of node.
Definition:
bool-expr.cpp:234
Gecode::IntPropLevel
IntPropLevel
Propagation levels for integer propagators.
Definition:
int.hh:955
Gecode
Gecode toplevel namespace
Gecode::ba
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
Definition:
ipl.hpp:53
Gecode::Home
Home class for posting propagators
Definition:
core.hpp:922
Gecode::IPL_BASIC_ADVANCED
@ IPL_BASIC_ADVANCED
Use both.
Definition:
int.hh:967
Gecode::Int::Unary::ManProp::post
static ExecStatus post(Home home, TaskArray< ManTask > &t)
Post propagator that schedules tasks on unary resource.
Definition:
man-prop.hpp:53
GECODE_NEVER
#define GECODE_NEVER
Assert that this command is never executed.
Definition:
macros.hpp:60
Gecode::IPL_BASIC
@ IPL_BASIC
Use basic propagation algorithm.
Definition:
int.hh:965
Gecode::Int::Unary::optpost
ExecStatus optpost(Home home, TaskArray< OptTask > &t, IntPropLevel ipl)
Post optional task propagator according to propagation level.
Definition:
post.hpp:57
Gecode::Int::Unary::OptProp::post
static ExecStatus post(Home home, TaskArray< OptTask > &t)
Post propagator that schedules tasks on unary resource.
Definition:
opt-prop.hpp:55
Gecode::Int::TaskArray< ManTask >
Gecode::Int::Unary::manpost
ExecStatus manpost(Home home, TaskArray< ManTask > &t, IntPropLevel ipl)
Post mandatory task propagator according to propagation level.
Definition:
post.hpp:42
Gecode::ES_OK
@ ES_OK
Execution is okay.
Definition:
core.hpp:544
Gecode::ExecStatus
ExecStatus
Definition:
core.hpp:540