Generated on Thu Mar 16 2017 03:24:19 for Gecode by doxygen 1.8.13
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 18:42:25 +0200 (Wed, 16 Sep 2015) $ by $Author: schulte $
11  * $Revision: 14689 $
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 Cumulative {
39 
40  template<class ManTask, class Cap>
43  switch (ba(ipl)) {
44  case IPL_BASIC: default:
45  return ManProp<ManTask,Cap,PLB>::post(home,c,t);
46  case IPL_ADVANCED:
47  return ManProp<ManTask,Cap,PLA>::post(home,c,t);
48  case IPL_BASIC_ADVANCED:
49  return ManProp<ManTask,Cap,PLBA>::post(home,c,t);
50  }
52  return ES_OK;
53  }
54 
55  template<class OptTask, class Cap>
58  switch (ba(ipl)) {
59  case IPL_BASIC: default:
60  return OptProp<OptTask,Cap,PLB>::post(home,c,t);
61  case IPL_ADVANCED:
62  return OptProp<OptTask,Cap,PLA>::post(home,c,t);
63  case IPL_BASIC_ADVANCED:
64  return OptProp<OptTask,Cap,PLBA>::post(home,c,t);
65  }
67  return ES_OK;
68  }
69 
70 }}}
71 
72 // STATISTICS: int-post
ExecStatus optpost(Home home, Cap c, TaskArray< OptTask > &t, IntPropLevel ipl)
Definition: post.hpp:57
NodeType t
Type of node.
Definition: bool-expr.cpp:234
Gecode::FloatVal c(-8, 8)
Use basic propagation algorithm.
Definition: int.hh:951
ExecStatus manpost(Home home, Cap c, TaskArray< ManTask > &t, IntPropLevel ipl)
Definition: post.hpp:42
Use advanced propagation algorithm.
Definition: int.hh:952
IntPropLevel
Propagation levels for integer propagators.
Definition: int.hh:941
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
Definition: ipl.hpp:53
ExecStatus
Definition: core.hpp:536
#define forceinline
Definition: config.hpp:173
Execution is okay.
Definition: core.hpp:540
Gecode toplevel namespace
static ExecStatus post(Home home, Cap c, TaskArray< ManTask > &t)
Post propagator that schedules tasks on cumulative resource.
Definition: man-prop.hpp:59
Home class for posting propagators
Definition: core.hpp:905
#define GECODE_NEVER
Assert that this command is never executed.
Definition: macros.hpp:60
static ExecStatus post(Home home, Cap c, TaskArray< OptTask > &t)
Post propagator that schedules tasks on cumulative resource.
Definition: opt-prop.hpp:61