You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Source/IncrementalIntervalAssignment.cpp
+29-23Lines changed: 29 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
#include"IncrementalIntervalAssignment.h"
3
3
4
4
// to do
5
-
// move freeze_problem_size to start of solve, depending on whether solving for the first time or not
5
+
//x move freeze_problem_size to start of solve, depending on whether solving for the first time or not
6
6
// data layout for variables with goals and slack variables and sum-even vars... probably fast enough we can just go over all of them and check the goals. maybe need something to mark vars whose column coefficients are 2
7
7
// sum-even constraint conversion
8
8
// initialize goals to 1, bounds to 1,inf, etc.
@@ -20,8 +20,10 @@
20
20
#include<numeric>
21
21
22
22
// math utilities
23
+
namespaceIIA_Internal
24
+
{
23
25
24
-
// greatest common divisor of u and v
26
+
// greatest common divisor of u and v
25
27
// always returns a positive number, as we take abs of u and v
26
28
intgcd(int u, int v)
27
29
{
@@ -5345,7 +5347,7 @@ int IncrementalIntervalAssignment::new_row(MRow &Mrow)
@@ -6455,15 +6459,15 @@ void IntervalProblem::recursively_add_edge( int int_var_column,
6455
6459
auto &row_non_zeros = rows[row].cols;
6456
6460
6457
6461
// should we add this row?
6458
-
int do_add = CUBIT_FALSE;
6462
+
int do_add = false;
6459
6463
if ( do_sum_even )
6460
6464
{
6461
-
do_add = CUBIT_TRUE;
6465
+
do_add = true;
6462
6466
}
6463
6467
else {
6464
6468
6465
6469
// is the row a sum-even row?
6466
-
int has_sum_even_var = CUBIT_FALSE;
6470
+
int has_sum_even_var = false;
6467
6471
row_non_zeros.last();
6468
6472
{
6469
6473
for ( int j = row_non_zeros.size(); j--; ) {
@@ -6472,15 +6476,15 @@ void IntervalProblem::recursively_add_edge( int int_var_column,
6472
6476
cross_column < num_int_vars() + sumEvenDummies )
6473
6477
{
6474
6478
PRINT_DEBUG(47,"IntervalProblem::recursively_add_edge: column %d is a sum-even because it's index is in [%d,%d), so skipping row %d.\n", cross_column,num_int_vars(),num_int_vars() + sumEvenDummies, row );
6475
-
has_sum_even_var = CUBIT_TRUE;
6479
+
has_sum_even_var = true;
6476
6480
break;
6477
6481
}
6478
6482
}
6479
6483
}
6480
6484
// and if is an equality constraint row
6481
6485
if ( !has_sum_even_var )
6482
6486
{
6483
-
do_add = CUBIT_TRUE;
6487
+
do_add = true;
6484
6488
}
6485
6489
}
6486
6490
@@ -6536,14 +6540,14 @@ void IntervalProblem::recursively_add_edge( int int_var_column,
6536
6540
// Below: can skip the row on the bet that intervals won't decrease by more than a factor of 2.
0 commit comments