Rename greedy to infinity

This commit is contained in:
2017-04-30 18:03:18 -04:00
parent 0ee68e01bc
commit 7142eb2d68
9 changed files with 38 additions and 43 deletions

View File

@@ -545,7 +545,7 @@ int INFINITY_2D_generate_lfree(const struct MultiRowModel *model,
lfree->rays.nrays = nrays;
memcpy(rays, model->rays.values, 2 * nrays * sizeof(double));
memcpy(f, model->f, 2 * sizeof(double));
for (int i = 0; i < nrays; i++) beta[i] = GREEDY_BIG_E;
for (int i = 0; i < nrays; i++) beta[i] = INFINITY_BIG_E;
scale = (double*) malloc(nrays * sizeof(double));
abort_if(!scale, "could not allocate scale");
@@ -561,7 +561,7 @@ int INFINITY_2D_generate_lfree(const struct MultiRowModel *model,
abort_if(count++ > 2 * nrays, "infinite loop");
rval = get_bounding_box(2, nrays, rays, beta, GREEDY_BIG_E, lb, ub);
rval = get_bounding_box(2, nrays, rays, beta, INFINITY_BIG_E, lb, ub);
abort_if(rval, "get_bounding_box failed");
log_verbose(" box=[%.2lf %.2lf] [%.2lf %.2lf]\n", lb[0], ub[0], lb[1], ub[1]);

View File

@@ -942,7 +942,7 @@ static int bound(int nrows,
double prev_epsilon;
int count = 0;
*epsilon = GREEDY_BIG_E;
*epsilon = INFINITY_BIG_E;
rx = (int *) malloc(nrays * sizeof(int));
fbar = (double *) malloc(nrows * sizeof(double));
@@ -990,7 +990,7 @@ static int bound(int nrows,
for(int i = 0; i < nrays; i++)
tx[i] = 0;
if(DOUBLE_geq(*epsilon, GREEDY_BIG_E))
if(DOUBLE_geq(*epsilon, INFINITY_BIG_E))
{
*epsilon = INFINITY;
goto CLEANUP;
@@ -1245,7 +1245,7 @@ int INFINITY_ND_generate_lfree(const struct MultiRowModel *model,
abort_if(!x, "could not allocate x");
for(int i = 0; i < nrays; i++)
beta[i] = GREEDY_BIG_E;
beta[i] = INFINITY_BIG_E;
int it = 0;

View File

@@ -200,7 +200,7 @@ static int filter_model(const struct MultiRowModel *original_model,
if(keep) LFREE_push_ray(filtered_rays, r);
}
log_debug(" norm_cutoff=%8.2lf nrays=%8d\n", norm_cutoff,
log_verbose(" norm_cutoff=%8.2lf nrays=%8d\n", norm_cutoff,
filtered_model->rays.nrays);
if(filtered_rays->nrays < MAX_N_RAYS) break;
@@ -452,4 +452,4 @@ CLEANUP:
return rval;
}
#endif // TEST_SOURCE
#endif // TEST_SOURCE

View File

@@ -80,7 +80,7 @@ TEST(Infinity2DTest, test_generate_cut_2)
EXPECT_NEAR(0.5, lfree.beta[0], BOUNDS_EPSILON);
EXPECT_NEAR(0.5, lfree.beta[1], BOUNDS_EPSILON);
EXPECT_NEAR(0.5, lfree.beta[2], BOUNDS_EPSILON);
EXPECT_EQ(GREEDY_BIG_E, lfree.beta[3]);
EXPECT_EQ(INFINITY_BIG_E, lfree.beta[3]);
EXPECT_NEAR(0.5, lfree.beta[4], BOUNDS_EPSILON);
CLEANUP:
@@ -102,7 +102,7 @@ TEST(Infinity2DTest, test_generate_cut_3)
EXPECT_NEAR(5.0, lfree.beta[0], BOUNDS_EPSILON);
EXPECT_NEAR(17.0, lfree.beta[2], BOUNDS_EPSILON);
EXPECT_EQ(GREEDY_BIG_E, lfree.beta[1]);
EXPECT_EQ(INFINITY_BIG_E, lfree.beta[1]);
CLEANUP:
if (rval) FAIL();
@@ -288,8 +288,8 @@ TEST(Infinity2DTest, find_containing_cone_test_3)
// EXPECT_NEAR(20.0, bounds[1], BOUNDS_EPSILON);
// EXPECT_NEAR(18.0, bounds[2], BOUNDS_EPSILON);
// EXPECT_NEAR(18.0, bounds[5], BOUNDS_EPSILON);
// EXPECT_EQ(GREEDY_BIG_E, bounds[3]);
// EXPECT_EQ(GREEDY_BIG_E, bounds[4]);
// EXPECT_EQ(INFINITY_BIG_E, bounds[3]);
// EXPECT_EQ(INFINITY_BIG_E, bounds[4]);
//
// CLEANUP:
// if (rval) FAIL();
@@ -314,8 +314,8 @@ TEST(Infinity2DTest, find_containing_cone_test_3)
// EXPECT_NEAR(20.0, bounds[1], BOUNDS_EPSILON);
// EXPECT_NEAR(18.0, bounds[2], BOUNDS_EPSILON);
// EXPECT_NEAR(18.0, bounds[5], BOUNDS_EPSILON);
// EXPECT_EQ(GREEDY_BIG_E, bounds[3]);
// EXPECT_EQ(GREEDY_BIG_E, bounds[4]);
// EXPECT_EQ(INFINITY_BIG_E, bounds[3]);
// EXPECT_EQ(INFINITY_BIG_E, bounds[4]);
//
// CLEANUP:
// if (rval) FAIL();