main page
modules
namespaces
classes
files
Gecode home
Generated on Sun Aug 9 2020 05:34:08 for Gecode by
doxygen
1.8.18
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
* This file is part of Gecode, the generic constraint
12
* development environment:
13
* http://www.gecode.org
14
*
15
* Permission is hereby granted, free of charge, to any person obtaining
16
* a copy of this software and associated documentation files (the
17
* "Software"), to deal in the Software without restriction, including
18
* without limitation the rights to use, copy, modify, merge, publish,
19
* distribute, sublicense, and/or sell copies of the Software, and to
20
* permit persons to whom the Software is furnished to do so, subject to
21
* the following conditions:
22
*
23
* The above copyright notice and this permission notice shall be
24
* included in all copies or substantial portions of the Software.
25
*
26
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
30
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
31
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
32
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33
*
34
*/
35
36
#ifndef __GECODE_INT_IDX_VIEW_HH__
37
#define __GECODE_INT_IDX_VIEW_HH__
38
39
#include <
gecode/int.hh
>
40
41
namespace
Gecode
{
namespace
Int {
42
47
template
<
class
View>
48
class
IdxView
{
49
public
:
51
int
idx
;
53
View
view
;
55
static
IdxView
*
allocate
(
Space
& home,
int
n
);
56
};
57
59
template
<
class
View>
60
class
ViewToVarArg
{};
61
66
template
<
class
View>
67
class
IdxViewArray
{
68
private
:
70
IdxView<View>
* xs;
72
int
n;
73
public
:
75
IdxViewArray
(
void
);
77
IdxViewArray
(
const
IdxViewArray<View>
&);
79
IdxViewArray
(
Space
& home,
const
typename
ViewToVarArg<View>::argtype
&
x
);
81
IdxViewArray
(
Space
& home,
int
n
);
82
84
int
size
(
void
)
const
;
86
void
size
(
int
n
);
87
89
IdxView<View>
&
operator []
(
int
n
);
91
const
IdxView<View>
&
operator []
(
int
)
const
;
92
97
void
subscribe
(
Space
& home,
Propagator
&
p
,
PropCond
pc,
bool
process=
true
);
102
void
cancel
(
Space
& home,
Propagator
&
p
,
PropCond
pc);
104
void
reschedule
(
Space
& home,
Propagator
&
p
,
PropCond
pc);
105
107
void
update
(
Space
& home,
IdxViewArray<View>
&
x
);
108
};
109
114
template
<
class
Char,
class
Traits,
class
View>
115
std::basic_ostream<Char,Traits>&
116
operator <<
(std::basic_ostream<Char,Traits>& os,
117
const
IdxViewArray<View>
&
x
);
118
119
}}
120
121
#include <
gecode/int/idx-view.hpp
>
122
123
#endif
124
125
126
// STATISTICS: int-prop
127
Gecode::x
Post propagator for SetVar x
Definition:
set.hh:767
Gecode::Int::IdxViewArray
An array of IdxView pairs.
Definition:
idx-view.hh:67
Gecode::Int::IdxView::allocate
static IdxView * allocate(Space &home, int n)
Allocate memory for n index-view pairs.
Definition:
idx-view.hpp:67
int.hh
Gecode::Int::IdxViewArray::operator[]
IdxView< View > & operator[](int n)
Access element n.
Definition:
idx-view.hpp:117
Gecode::Int::IdxViewArray::update
void update(Space &home, IdxViewArray< View > &x)
Cloning.
Definition:
idx-view.hpp:153
Gecode::Int::ViewToVarArg
Class to map VarArg type to view.
Definition:
idx-view.hh:60
Gecode::Space
Computation spaces.
Definition:
core.hpp:1742
idx-view.hpp
Gecode
Gecode toplevel namespace
Gecode::Propagator
Base-class for propagators.
Definition:
core.hpp:1064
Gecode::Int::IdxViewArray::cancel
void cancel(Space &home, Propagator &p, PropCond pc)
Definition:
idx-view.hpp:139
Gecode::Int::operator<<
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const IdxViewArray< View > &x)
Definition:
idx-view.hpp:167
Gecode::Int::IdxViewArray::size
int size(void) const
Return the current size.
Definition:
idx-view.hpp:105
Gecode::PropCond
int PropCond
Type for propagation conditions.
Definition:
core.hpp:72
Gecode::Int::IdxView::view
View view
Thhe view.
Definition:
idx-view.hh:53
Gecode::Int::IdxViewArray::reschedule
void reschedule(Space &home, Propagator &p, PropCond pc)
Schedule propagator p.
Definition:
idx-view.hpp:146
Gecode::Int::IdxViewArray::IdxViewArray
IdxViewArray(void)
Default constructor.
Definition:
idx-view.hpp:73
Gecode::Int::IdxViewArray::subscribe
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
Definition:
idx-view.hpp:131
Gecode::Int::IdxView
Class for pair of index and view.
Definition:
idx-view.hh:48
Gecode::Int::IdxView::idx
int idx
The index.
Definition:
idx-view.hh:51
n
int n
Number of negative literals for node type.
Definition:
bool-expr.cpp:234
p
int p
Number of positive literals for node type.
Definition:
bool-expr.cpp:232