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
idx-view.hh
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
* Guido Tack <tack@gecode.org>
6
*
7
* Copyright:
8
* Christian Schulte, 2004
9
* Guido Tack, 2004
10
*
11
* Last modified:
12
* $Date: 2016-06-29 17:28:17 +0200 (Wed, 29 Jun 2016) $ by $Author: schulte $
13
* $Revision: 15137 $
14
*
15
* This file is part of Gecode, the generic constraint
16
* development environment:
17
* http://www.gecode.org
18
*
19
* Permission is hereby granted, free of charge, to any person obtaining
20
* a copy of this software and associated documentation files (the
21
* "Software"), to deal in the Software without restriction, including
22
* without limitation the rights to use, copy, modify, merge, publish,
23
* distribute, sublicense, and/or sell copies of the Software, and to
24
* permit persons to whom the Software is furnished to do so, subject to
25
* the following conditions:
26
*
27
* The above copyright notice and this permission notice shall be
28
* included in all copies or substantial portions of the Software.
29
*
30
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
34
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
35
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
36
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37
*
38
*/
39
40
#ifndef __GECODE_INT_IDX_VIEW_HH__
41
#define __GECODE_INT_IDX_VIEW_HH__
42
43
#include <
gecode/int.hh
>
44
45
namespace
Gecode
{
namespace
Int {
46
51
template
<
class
View>
52
class
IdxView
{
53
public
:
55
int
idx
;
57
View
view
;
59
static
IdxView
*
allocate
(
Space
& home,
int
n
);
60
};
61
63
template
<
class
View>
64
class
ViewToVarArg
{};
65
70
template
<
class
View>
71
class
IdxViewArray
{
72
private
:
74
IdxView<View>
* xs;
76
int
n;
77
public
:
79
IdxViewArray
(
void
);
81
IdxViewArray
(
const
IdxViewArray<View>
&);
83
IdxViewArray
(
Space
& home,
const
typename
ViewToVarArg<View>::argtype
&
x
);
85
IdxViewArray
(
Space
& home,
int
n
);
86
88
int
size
(
void
)
const
;
90
void
size
(
int
n
);
91
93
IdxView<View>
&
operator []
(
int
n
);
95
const
IdxView<View>
&
operator []
(
int
)
const
;
96
101
void
subscribe
(
Space
& home,
Propagator
&
p
,
PropCond
pc,
bool
process=
true
);
106
void
cancel
(
Space
& home,
Propagator
&
p
,
PropCond
pc);
108
void
reschedule
(
Space
& home,
Propagator
&
p
,
PropCond
pc);
109
111
void
update
(
Space
& home,
bool
share,
IdxViewArray<View>
&
x
);
112
};
113
118
template
<
class
Char,
class
Traits,
class
View>
119
std::basic_ostream<Char,Traits>&
120
operator <<
(std::basic_ostream<Char,Traits>& os,
121
const
IdxViewArray<View>
&
x
);
122
123
}}
124
125
#include <
gecode/int/idx-view.hpp
>
126
127
#endif
128
129
130
// STATISTICS: int-prop
131
Gecode::x
Post propagator for SetVar x
Definition:
set.hh:784
Gecode::Int::IdxViewArray
An array of IdxView pairs.
Definition:
idx-view.hh:71
Gecode::Int::IdxView::allocate
static IdxView * allocate(Space &home, int n)
Allocate memory for n index-view pairs.
Definition:
idx-view.hpp:65
int.hh
Gecode::Int::IdxViewArray::operator[]
IdxView< View > & operator[](int n)
Access element n.
Definition:
idx-view.hpp:115
Gecode::Int::ViewToVarArg
Class to map VarArg type to view.
Definition:
idx-view.hh:64
Gecode::Space
Computation spaces.
Definition:
core.hpp:1748
idx-view.hpp
Gecode
Gecode toplevel namespace
Gecode::Propagator
Base-class for propagators.
Definition:
core.hpp:1092
Gecode::Int::IdxViewArray::cancel
void cancel(Space &home, Propagator &p, PropCond pc)
Definition:
idx-view.hpp:137
Gecode::Int::operator<<
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const IdxViewArray< View > &x)
Definition:
idx-view.hpp:165
Gecode::Int::IdxViewArray::size
int size(void) const
Return the current size.
Definition:
idx-view.hpp:103
Gecode::PropCond
int PropCond
Type for propagation conditions.
Definition:
core.hpp:152
Gecode::Int::IdxView::view
View view
Thhe view.
Definition:
idx-view.hh:57
Gecode::Int::IdxViewArray::reschedule
void reschedule(Space &home, Propagator &p, PropCond pc)
Schedule propagator p.
Definition:
idx-view.hpp:144
Gecode::Int::IdxViewArray::IdxViewArray
IdxViewArray(void)
Default constructor.
Definition:
idx-view.hpp:71
Gecode::Int::IdxViewArray::subscribe
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
Definition:
idx-view.hpp:129
Gecode::Int::IdxView
Class for pair of index and view.
Definition:
idx-view.hh:52
Gecode::Int::IdxView::idx
int idx
The index.
Definition:
idx-view.hh:55
n
int n
Number of negative literals for node type.
Definition:
bool-expr.cpp:238
p
int p
Number of positive literals for node type.
Definition:
bool-expr.cpp:236
Gecode::Int::IdxViewArray::update
void update(Space &home, bool share, IdxViewArray< View > &x)
Cloning.
Definition:
idx-view.hpp:151