Skip to content

Commit 45a4047

Browse files
committed
Solved header bug
1 parent 3f902d7 commit 45a4047

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

examples/convexhull/convexHullExtras.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ int main(int argc, char *argv[]) {
3333
// Getting the path of the instance to test
3434
std::string filepath = argv[1];
3535

36-
bool usecompressed = false, useclassic = false;
36+
bool usecompressed = false;
37+
bool useclassic = false;
3738

3839
switch (atoi(argv[2])) {
3940
case 0: {

examples/convexhull/include/convexHullExtras.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ template <class I>
2121
class ConvexHullExtras : public StackAlgoExtras<emptyContext, Point2D, I> {
2222
public:
2323
ConvexHullExtras(std::string filePath, bool usecompressed, bool useclassic)
24-
: StackAlgoExtras<emptyContext, Point2D, I>(filePath) {}
24+
: StackAlgoExtras<emptyContext, Point2D, I>(filePath, usecompressed,
25+
useclassic) {}
2526

2627
private:
2728
// Functions to run the stack

extras/stackAlgoExtras.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ StackAlgoExtras<T, D, I>::StackAlgoExtras(std::string fileName,
6161
bool usecompressed, bool useclassic)
6262
: StackAlgo<T, D, I>(fileName, usecompressed) {
6363

64+
std::cout << "Debug compress = " << usecompressed
65+
<< ", classic = " << useclassic << std::endl;
66+
6467
if (usecompressed) {
6568
if (useclassic) {
6669
mClassicStack =

include/stackAlgo.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ StackAlgo<T, D, I>::StackAlgo(std::string fileName, bool usecompressed)
115115
}
116116
}
117117

118-
if (p < 2)
119-
throw("StackAlgo<T,D>::StackAlgo(std::string fileName), wrong header "
120-
"format ");
118+
if (p < 2) {
119+
throw("Wrong header format");
120+
}
121121
mStack = std::shared_ptr<Stack<T, D, I>>(
122122
new CompressedStack<T, D, I>(n, p, b, mContext));
123123
} else {

0 commit comments

Comments
 (0)