Skip to content

Commit 4d1d04f

Browse files
authored
fix squashing (#15)
* fix squashing * Delete .directory
1 parent b43dd72 commit 4d1d04f

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@
3030
*.exe
3131
*.out
3232
*.app
33+
34+
bin/uARMSolver

sources/Setup.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ void Setup::parse_sq_cauchy(vector<string>tokens)
268268
if (tokens[0].compare("CAUCHY_PARAM") == 0) {
269269
cout << "CAUCHY_PARAM started..." << endl;
270270
} else if (tokens[0].compare("THRESHOLD") == 0) {
271-
sq_param.sq.Thresh = stof(tokens[2]);
271+
squ_param.sq.Thresh = stof(tokens[2]);
272272
}
273273
}
274274

@@ -283,7 +283,7 @@ void Setup::parse_sq_euclid(vector<string>tokens)
283283
if (tokens[0].compare("EUCLID_PARAM") == 0) {
284284
cout << "EUCLID_PARAM started..." << endl;
285285
} else if (tokens[0].compare("THRESHOLD") == 0) {
286-
sq_param.sq.Thresh = stof(tokens[2]);
286+
squ_param.sq.Thresh = stof(tokens[2]);
287287
}
288288
}
289289

@@ -408,7 +408,7 @@ void Setup::print_sq_blk()
408408
switch(squash) {
409409
case SQUASH_CAUCHY:
410410
cout << "Method= CAUCHY" << endl;
411-
cout << "Threshold= " << sq_param.sq.Thresh << endl;
411+
cout << "Threshold= " << squ_param.sq.Thresh << endl;
412412
break;
413413
case SQUASH_EUCLID:
414414
cout << "Method= EUCLID" << endl;

sources/Setup.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ using namespace std;
3939
};
4040

4141
// squashing setups
42-
struct sq_param {
42+
struct squashing_param {
4343
double Thresh;
4444
};
4545

@@ -130,8 +130,8 @@ class Setup {
130130
} vis_param; ///< visualization parameters
131131

132132
union {
133-
sq_param sq;
134-
} sq_param; ///< squashing parameters
133+
squashing_param sq;
134+
} squ_param; ///< squashing parameters
135135

136136
};
137137

sources/Squash.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ int Squash::make_sq_dbase(Setup setup, Problem prob)
4747
sim = sq_similarity(prob.dbase[pos], prob.dbase[i]);
4848
else
4949
sim = sq_distance(prob.dbase[pos], prob.dbase[i], prob.feat);
50-
if(sim >= setup.sq_param.sq.Thresh) {
50+
if(sim >= setup.squ_param.sq.Thresh) {
5151
sq_set.push_back(prob.dbase[i]);
5252
set_squashed(i);
5353
k++;

0 commit comments

Comments
 (0)