Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions gecode/int.hh
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ namespace Gecode {
int n;
/// Array of ranges
Range* r;
//Constructor to initialize members
GECODE_INT_EXPORT IntSetObject(int n_): size(0u), n(n_), r(nullptr) {}
/// Allocate object with \a m elements
GECODE_INT_EXPORT static IntSetObject* allocate(int m);
/// Check whether \a n is included in the set
Expand Down Expand Up @@ -3285,7 +3287,7 @@ namespace Gecode {
*
* Schedule tasks with start times \a s and processing times \a p
* on a unary resource. The propagator uses the algorithms from:
* Petr Vil�m, Global Constraints in Scheduling, PhD thesis,
* Petr Vilím, Global Constraints in Scheduling, PhD thesis,
* Charles University, Prague, Czech Republic, 2007.
*
* The propagator performs propagation that depends on the integer
Expand Down Expand Up @@ -3317,7 +3319,7 @@ namespace Gecode {
* and whether a task is mandatory \a m (a task is mandatory if the
* Boolean variable is 1) on a unary resource. The propagator uses the
* algorithms from:
* Petr Vil�m, Global Constraints in Scheduling, PhD thesis,
* Petr Vilím, Global Constraints in Scheduling, PhD thesis,
* Charles University, Prague, Czech Republic, 2007.
*
* The propagator performs propagation that depends on the integer
Expand Down Expand Up @@ -3359,7 +3361,7 @@ namespace Gecode {
* end time.
*
* The propagator uses the algorithms from:
* Petr Vil�m, Global Constraints in Scheduling, PhD thesis,
* Petr Vilím, Global Constraints in Scheduling, PhD thesis,
* Charles University, Prague, Czech Republic, 2007.
*
* The propagator performs propagation that depends on the integer
Expand Down Expand Up @@ -3401,7 +3403,7 @@ namespace Gecode {
*
* The propagator uses the
* algorithms from:
* Petr Vil�m, Global Constraints in Scheduling, PhD thesis,
* Petr Vilím, Global Constraints in Scheduling, PhD thesis,
* Charles University, Prague, Czech Republic, 2007.
*
* The propagator performs propagation that depends on the integer
Expand Down Expand Up @@ -3431,7 +3433,7 @@ namespace Gecode {
* Schedule tasks with start times \a s, processing times \a p, and
* end times \a e
* on a unary resource. The propagator uses the algorithms from:
* Petr Vil�m, Global Constraints in Scheduling, PhD thesis,
* Petr Vilím, Global Constraints in Scheduling, PhD thesis,
* Charles University, Prague, Czech Republic, 2007.
*
* The propagator does not enforce \f$s_i+p_i=e_i\f$, this constraint
Expand Down Expand Up @@ -3463,7 +3465,7 @@ namespace Gecode {
* and whether a task is mandatory \a m (a task is mandatory if the
* Boolean variable is 1) on a unary resource. The propagator uses the
* algorithms from:
* Petr Vil�m, Global Constraints in Scheduling, PhD thesis,
* Petr Vilím, Global Constraints in Scheduling, PhD thesis,
* Charles University, Prague, Czech Republic, 2007.
*
* The propagator performs propagation that depends on the integer
Expand Down Expand Up @@ -3516,13 +3518,13 @@ namespace Gecode {
*
* The propagator uses algorithms taken from:
*
* Petr Vil�m, Max Energy Filtering Algorithm for Discrete Cumulative
* Petr Vilím, Max Energy Filtering Algorithm for Discrete Cumulative
* Resources, in W. J. van Hoeve and J. N. Hooker, editors, CPAIOR, volume
* 5547 of LNCS, pages 294-308. Springer, 2009.
*
* and
*
* Petr Vil�m, Edge finding filtering algorithm for discrete cumulative
* Petr Vilím, Edge finding filtering algorithm for discrete cumulative
* resources in O(kn log n). In I. P. Gent, editor, CP, volume 5732 of LNCS,
* pages 802-816. Springer, 2009.
*
Expand Down Expand Up @@ -3575,13 +3577,13 @@ namespace Gecode {
*
* The propagator uses algorithms taken from:
*
* Petr Vil�m, Max Energy Filtering Algorithm for Discrete Cumulative
* Petr Vilím, Max Energy Filtering Algorithm for Discrete Cumulative
* Resources, in W. J. van Hoeve and J. N. Hooker, editors, CPAIOR, volume
* 5547 of LNCS, pages 294-308. Springer, 2009.
*
* and
*
* Petr Vil�m, Edge finding filtering algorithm for discrete cumulative
* Petr Vilím, Edge finding filtering algorithm for discrete cumulative
* resources in O(kn log n). In I. P. Gent, editor, CP, volume 5732 of LNCS,
* pages 802-816. Springer, 2009.
*
Expand Down Expand Up @@ -3620,13 +3622,13 @@ namespace Gecode {
*
* The propagator uses algorithms taken from:
*
* Petr Vil�m, Max Energy Filtering Algorithm for Discrete Cumulative
* Petr Vilím, Max Energy Filtering Algorithm for Discrete Cumulative
* Resources, in W. J. van Hoeve and J. N. Hooker, editors, CPAIOR, volume
* 5547 of LNCS, pages 294-308. Springer, 2009.
*
* and
*
* Petr Vil�m, Edge finding filtering algorithm for discrete cumulative
* Petr Vilím, Edge finding filtering algorithm for discrete cumulative
* resources in O(kn log n). In I. P. Gent, editor, CP, volume 5732 of LNCS,
* pages 802-816. Springer, 2009.
*
Expand Down Expand Up @@ -3665,13 +3667,13 @@ namespace Gecode {
*
* The propagator uses algorithms taken from:
*
* Petr Vil�m, Max Energy Filtering Algorithm for Discrete Cumulative
* Petr Vilím, Max Energy Filtering Algorithm for Discrete Cumulative
* Resources, in W. J. van Hoeve and J. N. Hooker, editors, CPAIOR, volume
* 5547 of LNCS, pages 294-308. Springer, 2009.
*
* and
*
* Petr Vil�m, Edge finding filtering algorithm for discrete cumulative
* Petr Vilím, Edge finding filtering algorithm for discrete cumulative
* resources in O(kn log n). In I. P. Gent, editor, CP, volume 5732 of LNCS,
* pages 802-816. Springer, 2009.
*
Expand Down Expand Up @@ -3712,13 +3714,13 @@ namespace Gecode {
*
* The propagator uses algorithms taken from:
*
* Petr Vil�m, Max Energy Filtering Algorithm for Discrete Cumulative
* Petr Vilím, Max Energy Filtering Algorithm for Discrete Cumulative
* Resources, in W. J. van Hoeve and J. N. Hooker, editors, CPAIOR, volume
* 5547 of LNCS, pages 294-308. Springer, 2009.
*
* and
*
* Petr Vil�m, Edge finding filtering algorithm for discrete cumulative
* Petr Vilím, Edge finding filtering algorithm for discrete cumulative
* resources in O(kn log n). In I. P. Gent, editor, CP, volume 5732 of LNCS,
* pages 802-816. Springer, 2009.
*
Expand Down Expand Up @@ -3761,13 +3763,13 @@ namespace Gecode {
*
* The propagator uses algorithms taken from:
*
* Petr Vil�m, Max Energy Filtering Algorithm for Discrete Cumulative
* Petr Vilím, Max Energy Filtering Algorithm for Discrete Cumulative
* Resources, in W. J. van Hoeve and J. N. Hooker, editors, CPAIOR, volume
* 5547 of LNCS, pages 294-308. Springer, 2009.
*
* and
*
* Petr Vil�m, Edge finding filtering algorithm for discrete cumulative
* Petr Vilím, Edge finding filtering algorithm for discrete cumulative
* resources in O(kn log n). In I. P. Gent, editor, CP, volume 5732 of LNCS,
* pages 802-816. Springer, 2009.
*
Expand Down
14 changes: 10 additions & 4 deletions gecode/int/int-set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,15 @@ namespace Gecode {

IntSet::IntSetObject*
IntSet::IntSetObject::allocate(int n) {
IntSetObject* o = new IntSetObject;
o->n = n;
o->r = heap.alloc<Range>(n);
IntSetObject* o = new IntSetObject(n);
try {
o->r = heap.alloc<Range>(n);
}
catch (const std::bad_alloc& ex)
{
delete(o);
throw;
}
return o;
}

Expand Down Expand Up @@ -165,7 +171,7 @@ namespace Gecode {
Region reg;
Range* dr = reg.alloc<Range>(n);
int j=0;
for (const std::pair<int,int>& k : r)
for (const std::pair<int,int>& k : r)
if (k.first <= k.second) {
dr[j].min=k.first; dr[j].max=k.second; j++;
}
Expand Down
Loading