Skip to content

Commit 2babfca

Browse files
committed
Updated name and referene to Upper Hull inst. of Convex Hull
Update README.md Modified convex to upper in a comment
1 parent d452e25 commit 2babfca

13 files changed

+99
-97
lines changed

CMakeLists.txt

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Please modify this file freely to adapt to the production of other
2-
## executables than convexhull and testrun
2+
## executables than upperhull and testrun
33

44
# Description of the different builds
55
# +---------------+--------------+--------------+----------|
@@ -87,18 +87,18 @@ get_property(inc_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
8787
message("inc_dirs = ${inc_dirs}")
8888

8989
# Convex Hulls : 8, 16, 32 or 64 bits and the version with extras
90-
file(GLOB SOURCES "examples/convexhull/convexHull8.cpp")
91-
add_executable(convexhull8 ${SOURCES})
92-
file(GLOB SOURCES "examples/convexhull/convexHull16.cpp")
93-
add_executable(convexhull16 ${SOURCES})
94-
file(GLOB SOURCES "examples/convexhull/convexHull32.cpp")
95-
add_executable(convexhull32 ${SOURCES})
96-
file(GLOB SOURCES "examples/convexhull/convexHull64.cpp")
97-
add_executable(convexhull64 ${SOURCES})
98-
file(GLOB SOURCES "examples/convexhull/convexHullExtras.cpp")
99-
add_executable(convexhullextras ${SOURCES})
100-
file(GLOB SOURCES "examples/convexhull/generateInputConvexHull.cpp")
101-
add_executable(generateInputConvexHull ${SOURCES})
90+
file(GLOB SOURCES "examples/upperhull/upperHull8.cpp")
91+
add_executable(upperhull8 ${SOURCES})
92+
file(GLOB SOURCES "examples/upperhull/upperHull16.cpp")
93+
add_executable(upperhull16 ${SOURCES})
94+
file(GLOB SOURCES "examples/upperhull/upperHull32.cpp")
95+
add_executable(upperhull32 ${SOURCES})
96+
file(GLOB SOURCES "examples/upperhull/upperHull64.cpp")
97+
add_executable(upperhull64 ${SOURCES})
98+
file(GLOB SOURCES "examples/upperhull/upperHullExtras.cpp")
99+
add_executable(upperhullextras ${SOURCES})
100+
file(GLOB SOURCES "examples/upperhull/generateInputUpperHull.cpp")
101+
add_executable(generateInputUpperHull ${SOURCES})
102102

103103

104104
# Test Run : 8, 16, 32 or 64 bits and the version with extras

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ template <class T, class D> void StackAlgo<T, D>::run() {
3535
}
3636
```
3737
## Use case
38-
Concrete examples such as a basic test run and the convex hull problem can be found in the [wiki](https://github.com/Azzaare/CompressedStacks.cpp/wiki).
38+
Concrete examples such as a basic test run and the upper hull problems can be found in the [wiki](https://github.com/Azzaare/CompressedStacks.cpp/wiki).
3939
4040
### Abstract example : ```Instance<T,D,I>```
4141
<p>An instance of a Stack Algorithm is described by a set of templates parameters T, D, and I and a set of methods used in the run function above.</p>

examples/convexhull/generateInputConvexHull.cpp renamed to examples/upperhull/generateInputUpperHull.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int main(int argc, char *argv[]) {
4444
std::uint_least64_t i = 0;
4545
while (i < n) {
4646

47-
// create output for the convex hull problem.
47+
// create output for the upper hull problem.
4848
// in this case, max and min stand for the maximum and minimum values of x
4949
// and y
5050
// generate a random point in the (min,max)2 range

examples/convexhull/include/convexHull.hpp renamed to examples/upperhull/include/upperHull.hpp

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// ConvexHull : Definition
2-
#ifndef CONVEXHULL
3-
#define CONVEXHULL
1+
// UpperHull : Definition
2+
#ifndef UPPERHULL
3+
#define UPPERHULL
44

55
/*==============================================================================
66
Includes
@@ -20,9 +20,9 @@ class emptyContext {};
2020
Instantiation of a problem
2121
==============================================================================*/
2222
template <class I>
23-
class ConvexHull : public StackAlgo<emptyContext, Point2D, I> {
23+
class UpperHull : public StackAlgo<emptyContext, Point2D, I> {
2424
public:
25-
ConvexHull(std::string filePath)
25+
UpperHull(std::string filePath)
2626
: StackAlgo<emptyContext, Point2D, I>(filePath) {}
2727

2828
private:
@@ -58,7 +58,7 @@ class ConvexHull : public StackAlgo<emptyContext, Point2D, I> {
5858
* reportStack
5959
==============================================================================*/
6060
template <class I>
61-
Point2D ConvexHull<I>::readInput(std::vector<std::string> line) {
61+
Point2D UpperHull<I>::readInput(std::vector<std::string> line) {
6262
double x = std::stof(line[0]);
6363
double y = std::stof(line[1]);
6464

@@ -68,7 +68,7 @@ Point2D ConvexHull<I>::readInput(std::vector<std::string> line) {
6868
return p;
6969
}
7070

71-
template <class I> std::shared_ptr<emptyContext> ConvexHull<I>::initStack() {
71+
template <class I> std::shared_ptr<emptyContext> UpperHull<I>::initStack() {
7272

7373
std::cout << "going to read two values " << std::endl;
7474

@@ -82,7 +82,7 @@ template <class I> std::shared_ptr<emptyContext> ConvexHull<I>::initStack() {
8282
return context;
8383
}
8484

85-
template <class I> bool ConvexHull<I>::popCondition(Point2D last) {
85+
template <class I> bool UpperHull<I>::popCondition(Point2D last) {
8686
Point2D minus1, minus2;
8787
total++;
8888
std::cout << std::endl << last << " <<<< pop condition enter " << std::endl;
@@ -114,26 +114,26 @@ template <class I> bool ConvexHull<I>::popCondition(Point2D last) {
114114

115115
return false;
116116
}
117-
template <class I> void ConvexHull<I>::prePop(Point2D data) {}
117+
template <class I> void UpperHull<I>::prePop(Point2D data) {}
118118
template <class I>
119-
void ConvexHull<I>::postPop(Point2D data, Data<emptyContext, Point2D, I> elt) {
119+
void UpperHull<I>::postPop(Point2D data, Data<emptyContext, Point2D, I> elt) {
120120
std::cout << elt.getData() << " <<<< (post-)Pop!" << std::endl;
121121
}
122-
template <class I> void ConvexHull<I>::noPop(Point2D data) {}
122+
template <class I> void UpperHull<I>::noPop(Point2D data) {}
123123

124-
template <class I> bool ConvexHull<I>::pushCondition(Point2D data) {
124+
template <class I> bool UpperHull<I>::pushCondition(Point2D data) {
125125
std::cout << data << " <<<< push condition returning true " << std::endl;
126126
return true;
127127
}
128128
template <class I>
129-
void ConvexHull<I>::prePush(Data<emptyContext, Point2D, I> elt) {}
129+
void UpperHull<I>::prePush(Data<emptyContext, Point2D, I> elt) {}
130130
template <class I>
131-
void ConvexHull<I>::postPush(Data<emptyContext, Point2D, I> elt) {
132-
std::cout << "ConvexHullStackAlgo::pushAction Nothing to see here "
131+
void UpperHull<I>::postPush(Data<emptyContext, Point2D, I> elt) {
132+
std::cout << "UpperHullStackAlgo::pushAction Nothing to see here "
133133
<< elt.getData() << std::endl;
134134
}
135-
template <class I> void ConvexHull<I>::noPush(Point2D data) {}
135+
template <class I> void UpperHull<I>::noPush(Point2D data) {}
136136

137-
template <class I> void ConvexHull<I>::reportStack() {}
137+
template <class I> void UpperHull<I>::reportStack() {}
138138

139-
#endif // CONVEXHULL
139+
#endif // UPPERHULL

examples/convexhull/include/convexHullExtras.hpp renamed to examples/upperhull/include/upperHullExtras.hpp

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// ConvexHull : Definition
2-
#ifndef CONVEXHULLEXTRAS
3-
#define CONVEXHULLEXTRAS
1+
// UpperHull : Definition
2+
#ifndef UPPERHULLEXTRAS
3+
#define UPPERHULLEXTRAS
44

55
/*==============================================================================
66
Includes
@@ -18,9 +18,9 @@ class emptyContext {};
1818
==============================================================================*/
1919

2020
template <class I>
21-
class ConvexHullExtras : public StackAlgoExtras<emptyContext, Point2D, I> {
21+
class UpperHullExtras : public StackAlgoExtras<emptyContext, Point2D, I> {
2222
public:
23-
ConvexHullExtras(std::string filePath, bool usecompressed, bool useclassic)
23+
UpperHullExtras(std::string filePath, bool usecompressed, bool useclassic)
2424
: StackAlgoExtras<emptyContext, Point2D, I>(filePath, usecompressed,
2525
useclassic) {}
2626

@@ -57,7 +57,7 @@ class ConvexHullExtras : public StackAlgoExtras<emptyContext, Point2D, I> {
5757
* reportStack
5858
==============================================================================*/
5959
template <class I>
60-
Point2D ConvexHullExtras<I>::readInput(std::vector<std::string> line) {
60+
Point2D UpperHullExtras<I>::readInput(std::vector<std::string> line) {
6161
double x = std::stof(line[0]);
6262
double y = std::stof(line[1]);
6363

@@ -69,7 +69,7 @@ Point2D ConvexHullExtras<I>::readInput(std::vector<std::string> line) {
6969
}
7070

7171
template <class I>
72-
std::shared_ptr<emptyContext> ConvexHullExtras<I>::initStack() {
72+
std::shared_ptr<emptyContext> UpperHullExtras<I>::initStack() {
7373
// std::cout << "going to read two values " << std::endl;
7474

7575
// first, read and push two values
@@ -85,7 +85,7 @@ std::shared_ptr<emptyContext> ConvexHullExtras<I>::initStack() {
8585
return context;
8686
}
8787

88-
template <class I> bool ConvexHullExtras<I>::popCondition(Point2D last) {
88+
template <class I> bool UpperHullExtras<I>::popCondition(Point2D last) {
8989
Point2D minus1, minus2;
9090
std::cout << std::endl << last << " <<<< pop condition enter " << std::endl;
9191
StackAlgo<emptyContext, Point2D, I>::println();
@@ -103,27 +103,27 @@ template <class I> bool ConvexHullExtras<I>::popCondition(Point2D last) {
103103

104104
return false;
105105
}
106-
template <class I> void ConvexHullExtras<I>::prePop(Point2D data) {}
106+
template <class I> void UpperHullExtras<I>::prePop(Point2D data) {}
107107
template <class I>
108-
void ConvexHullExtras<I>::postPop(Point2D data,
109-
Data<emptyContext, Point2D, I> elt) {
108+
void UpperHullExtras<I>::postPop(Point2D data,
109+
Data<emptyContext, Point2D, I> elt) {
110110
// std::cout << elt.getData() << " <<<< Pop!" << std::endl;
111111
}
112-
template <class I> void ConvexHullExtras<I>::noPop(Point2D data) {}
112+
template <class I> void UpperHullExtras<I>::noPop(Point2D data) {}
113113

114-
template <class I> bool ConvexHullExtras<I>::pushCondition(Point2D data) {
114+
template <class I> bool UpperHullExtras<I>::pushCondition(Point2D data) {
115115
// std::cout << data << " <<<< push condition returning true " << std::endl;
116116
return true;
117117
}
118118
template <class I>
119-
void ConvexHullExtras<I>::prePush(Data<emptyContext, Point2D, I> elt) {}
119+
void UpperHullExtras<I>::prePush(Data<emptyContext, Point2D, I> elt) {}
120120
template <class I>
121-
void ConvexHullExtras<I>::postPush(Data<emptyContext, Point2D, I> elt) {
122-
// std::cout << "ConvexHullStackAlgo::pushAction Nothing to see here " <<
121+
void UpperHullExtras<I>::postPush(Data<emptyContext, Point2D, I> elt) {
122+
// std::cout << "UpperHullStackAlgo::pushAction Nothing to see here " <<
123123
// elt.getData() << std::endl;
124124
}
125-
template <class I> void ConvexHullExtras<I>::noPush(Point2D data) {}
125+
template <class I> void UpperHullExtras<I>::noPush(Point2D data) {}
126126

127-
template <class I> void ConvexHullExtras<I>::reportStack() {}
127+
template <class I> void UpperHullExtras<I>::reportStack() {}
128128

129-
#endif // CONVEXHULLEXTRAS
129+
#endif // UPPERHULLEXTRAS

examples/convexhull/convexHull32.cpp renamed to examples/upperhull/upperHull16.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
// ConvexHull : Implementation
1+
// UpperHull : Implementation
22

33
/*==============================================================================
44
Includes
55
==============================================================================*/
6-
#include "include/convexHull.hpp"
6+
#include "include/upperHull.hpp"
77
#include <cstdint>
88

99
/*==============================================================================
1010
Type alias for the different integer size (based on the size of the input)
1111
==============================================================================*/
1212

13-
// using ConvexHull8 = ConvexHull<std::uint_least8_t>;
14-
// using ConvexHull16 = ConvexHull<std::uint_least16_t>;
15-
using ConvexHull32 = ConvexHull<std::uint_least32_t>;
16-
// using ConvexHull64 = ConvexHull<std::uint_least64_t>;
13+
// using UpperHull8 = UpperHull<std::uint_least8_t>;
14+
using UpperHull16 = UpperHull<std::uint_least16_t>;
15+
// using UpperHull32 = UpperHull<std::uint_least32_t>;
16+
// using UpperHull64 = UpperHull<std::uint_least64_t>;
1717

1818
/*==============================================================================
1919
How to use
@@ -23,7 +23,7 @@ int main(int argc, char *argv[]) {
2323
// Getting the path of the instance to test
2424
std::string filepath = argv[1];
2525

26-
ConvexHull32 stack(filepath);
26+
UpperHull16 stack(filepath);
2727
stack.run();
2828
// stack.println();
2929

Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
// ConvexHull : Implementation
1+
// UpperHull : Implementation
22

33
/*==============================================================================
44
Includes
55
==============================================================================*/
6-
#include "include/convexHull.hpp"
6+
#include "include/upperHull.hpp"
77
#include <cstdint>
88

99
/*==============================================================================
1010
Type alias for the different integer size (based on the size of the input)
1111
==============================================================================*/
1212

13-
using ConvexHull8 = ConvexHull<std::uint_least8_t>;
14-
// using ConvexHull16 = ConvexHull<std::uint_least16_t>;
15-
// using ConvexHull32 = ConvexHull<std::uint_least32_t>;
16-
// using ConvexHull64 = ConvexHull<std::uint_least64_t>;
13+
// using UpperHull8 = UpperHull<std::uint_least8_t>;
14+
// using UpperHull16 = UpperHull<std::uint_least16_t>;
15+
using UpperHull32 = UpperHull<std::uint_least32_t>;
16+
// using UpperHull64 = UpperHull<std::uint_least64_t>;
1717

1818
/*==============================================================================
1919
How to use
@@ -23,9 +23,9 @@ int main(int argc, char *argv[]) {
2323
// Getting the path of the instance to test
2424
std::string filepath = argv[1];
2525

26-
ConvexHull8 stack(filepath);
26+
UpperHull32 stack(filepath);
2727
stack.run();
28-
//stack.println();
28+
// stack.println();
2929

3030
return 0;
3131
}
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
// ConvexHull : Implementation
1+
// UpperHull : Implementation
22

33
/*==============================================================================
44
Includes
55
==============================================================================*/
6-
#include "include/convexHull.hpp"
6+
#include "include/upperHull.hpp"
77
#include <cstdint>
88

99
/*==============================================================================
1010
Type alias for the different integer size (based on the size of the input)
1111
==============================================================================*/
1212

13-
// using ConvexHull8 = ConvexHull<std::uint_least8_t>;
14-
using ConvexHull16 = ConvexHull<std::uint_least16_t>;
15-
// using ConvexHull32 = ConvexHull<std::uint_least32_t>;
16-
// using ConvexHull64 = ConvexHull<std::uint_least64_t>;
13+
// using UpperHull8 = UpperHull<std::uint_least8_t>;
14+
// using UpperHull16 = UpperHull<std::uint_least16_t>;
15+
// using UpperHull32 = UpperHull<std::uint_least32_t>;
16+
using UpperHull64 = UpperHull<std::uint_least64_t>;
1717

1818
/*==============================================================================
1919
How to use
@@ -23,9 +23,9 @@ int main(int argc, char *argv[]) {
2323
// Getting the path of the instance to test
2424
std::string filepath = argv[1];
2525

26-
ConvexHull16 stack(filepath);
26+
UpperHull64 stack(filepath);
2727
stack.run();
28-
//stack.println();
28+
// stack.println();
2929

3030
return 0;
3131
}
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
// ConvexHull : Implementation
1+
// UpperHull : Implementation
22

33
/*==============================================================================
44
Includes
55
==============================================================================*/
6-
#include "include/convexHull.hpp"
6+
#include "include/upperHull.hpp"
77
#include <cstdint>
88

99
/*==============================================================================
1010
Type alias for the different integer size (based on the size of the input)
1111
==============================================================================*/
1212

13-
// using ConvexHull8 = ConvexHull<std::uint_least8_t>;
14-
// using ConvexHull16 = ConvexHull<std::uint_least16_t>;
15-
// using ConvexHull32 = ConvexHull<std::uint_least32_t>;
16-
using ConvexHull64 = ConvexHull<std::uint_least64_t>;
13+
using UpperHull8 = UpperHull<std::uint_least8_t>;
14+
// using UpperHull16 = UpperHull<std::uint_least16_t>;
15+
// using UpperHull32 = UpperHull<std::uint_least32_t>;
16+
// using UpperHull64 = UpperHull<std::uint_least64_t>;
1717

1818
/*==============================================================================
1919
How to use
@@ -23,9 +23,9 @@ int main(int argc, char *argv[]) {
2323
// Getting the path of the instance to test
2424
std::string filepath = argv[1];
2525

26-
ConvexHull64 stack(filepath);
26+
UpperHull8 stack(filepath);
2727
stack.run();
28-
//stack.println();
28+
// stack.println();
2929

3030
return 0;
3131
}

0 commit comments

Comments
 (0)