Skip to content

Commit

Permalink
Updated name and referene to Upper Hull inst. of Convex Hull
Browse files Browse the repository at this point in the history
Update README.md

Modified convex to upper in a comment
  • Loading branch information
Azzaare committed Jun 6, 2017
1 parent d452e25 commit 2babfca
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 97 deletions.
26 changes: 13 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Please modify this file freely to adapt to the production of other
## executables than convexhull and testrun
## executables than upperhull and testrun

# Description of the different builds
# +---------------+--------------+--------------+----------|
Expand Down Expand Up @@ -87,18 +87,18 @@ get_property(inc_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
message("inc_dirs = ${inc_dirs}")

# Convex Hulls : 8, 16, 32 or 64 bits and the version with extras
file(GLOB SOURCES "examples/convexhull/convexHull8.cpp")
add_executable(convexhull8 ${SOURCES})
file(GLOB SOURCES "examples/convexhull/convexHull16.cpp")
add_executable(convexhull16 ${SOURCES})
file(GLOB SOURCES "examples/convexhull/convexHull32.cpp")
add_executable(convexhull32 ${SOURCES})
file(GLOB SOURCES "examples/convexhull/convexHull64.cpp")
add_executable(convexhull64 ${SOURCES})
file(GLOB SOURCES "examples/convexhull/convexHullExtras.cpp")
add_executable(convexhullextras ${SOURCES})
file(GLOB SOURCES "examples/convexhull/generateInputConvexHull.cpp")
add_executable(generateInputConvexHull ${SOURCES})
file(GLOB SOURCES "examples/upperhull/upperHull8.cpp")
add_executable(upperhull8 ${SOURCES})
file(GLOB SOURCES "examples/upperhull/upperHull16.cpp")
add_executable(upperhull16 ${SOURCES})
file(GLOB SOURCES "examples/upperhull/upperHull32.cpp")
add_executable(upperhull32 ${SOURCES})
file(GLOB SOURCES "examples/upperhull/upperHull64.cpp")
add_executable(upperhull64 ${SOURCES})
file(GLOB SOURCES "examples/upperhull/upperHullExtras.cpp")
add_executable(upperhullextras ${SOURCES})
file(GLOB SOURCES "examples/upperhull/generateInputUpperHull.cpp")
add_executable(generateInputUpperHull ${SOURCES})


# Test Run : 8, 16, 32 or 64 bits and the version with extras
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ template <class T, class D> void StackAlgo<T, D>::run() {
}
```
## Use case
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).
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).
### Abstract example : ```Instance<T,D,I>```
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) {
std::uint_least64_t i = 0;
while (i < n) {

// create output for the convex hull problem.
// create output for the upper hull problem.
// in this case, max and min stand for the maximum and minimum values of x
// and y
// generate a random point in the (min,max)2 range
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ConvexHull : Definition
#ifndef CONVEXHULL
#define CONVEXHULL
// UpperHull : Definition
#ifndef UPPERHULL
#define UPPERHULL

/*==============================================================================
Includes
Expand All @@ -20,9 +20,9 @@ class emptyContext {};
Instantiation of a problem
==============================================================================*/
template <class I>
class ConvexHull : public StackAlgo<emptyContext, Point2D, I> {
class UpperHull : public StackAlgo<emptyContext, Point2D, I> {
public:
ConvexHull(std::string filePath)
UpperHull(std::string filePath)
: StackAlgo<emptyContext, Point2D, I>(filePath) {}

private:
Expand Down Expand Up @@ -58,7 +58,7 @@ class ConvexHull : public StackAlgo<emptyContext, Point2D, I> {
* reportStack
==============================================================================*/
template <class I>
Point2D ConvexHull<I>::readInput(std::vector<std::string> line) {
Point2D UpperHull<I>::readInput(std::vector<std::string> line) {
double x = std::stof(line[0]);
double y = std::stof(line[1]);

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

template <class I> std::shared_ptr<emptyContext> ConvexHull<I>::initStack() {
template <class I> std::shared_ptr<emptyContext> UpperHull<I>::initStack() {

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

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

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

return false;
}
template <class I> void ConvexHull<I>::prePop(Point2D data) {}
template <class I> void UpperHull<I>::prePop(Point2D data) {}
template <class I>
void ConvexHull<I>::postPop(Point2D data, Data<emptyContext, Point2D, I> elt) {
void UpperHull<I>::postPop(Point2D data, Data<emptyContext, Point2D, I> elt) {
std::cout << elt.getData() << " <<<< (post-)Pop!" << std::endl;
}
template <class I> void ConvexHull<I>::noPop(Point2D data) {}
template <class I> void UpperHull<I>::noPop(Point2D data) {}

template <class I> bool ConvexHull<I>::pushCondition(Point2D data) {
template <class I> bool UpperHull<I>::pushCondition(Point2D data) {
std::cout << data << " <<<< push condition returning true " << std::endl;
return true;
}
template <class I>
void ConvexHull<I>::prePush(Data<emptyContext, Point2D, I> elt) {}
void UpperHull<I>::prePush(Data<emptyContext, Point2D, I> elt) {}
template <class I>
void ConvexHull<I>::postPush(Data<emptyContext, Point2D, I> elt) {
std::cout << "ConvexHullStackAlgo::pushAction Nothing to see here "
void UpperHull<I>::postPush(Data<emptyContext, Point2D, I> elt) {
std::cout << "UpperHullStackAlgo::pushAction Nothing to see here "
<< elt.getData() << std::endl;
}
template <class I> void ConvexHull<I>::noPush(Point2D data) {}
template <class I> void UpperHull<I>::noPush(Point2D data) {}

template <class I> void ConvexHull<I>::reportStack() {}
template <class I> void UpperHull<I>::reportStack() {}

#endif // CONVEXHULL
#endif // UPPERHULL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ConvexHull : Definition
#ifndef CONVEXHULLEXTRAS
#define CONVEXHULLEXTRAS
// UpperHull : Definition
#ifndef UPPERHULLEXTRAS
#define UPPERHULLEXTRAS

/*==============================================================================
Includes
Expand All @@ -18,9 +18,9 @@ class emptyContext {};
==============================================================================*/

template <class I>
class ConvexHullExtras : public StackAlgoExtras<emptyContext, Point2D, I> {
class UpperHullExtras : public StackAlgoExtras<emptyContext, Point2D, I> {
public:
ConvexHullExtras(std::string filePath, bool usecompressed, bool useclassic)
UpperHullExtras(std::string filePath, bool usecompressed, bool useclassic)
: StackAlgoExtras<emptyContext, Point2D, I>(filePath, usecompressed,
useclassic) {}

Expand Down Expand Up @@ -57,7 +57,7 @@ class ConvexHullExtras : public StackAlgoExtras<emptyContext, Point2D, I> {
* reportStack
==============================================================================*/
template <class I>
Point2D ConvexHullExtras<I>::readInput(std::vector<std::string> line) {
Point2D UpperHullExtras<I>::readInput(std::vector<std::string> line) {
double x = std::stof(line[0]);
double y = std::stof(line[1]);

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

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

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

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

return false;
}
template <class I> void ConvexHullExtras<I>::prePop(Point2D data) {}
template <class I> void UpperHullExtras<I>::prePop(Point2D data) {}
template <class I>
void ConvexHullExtras<I>::postPop(Point2D data,
Data<emptyContext, Point2D, I> elt) {
void UpperHullExtras<I>::postPop(Point2D data,
Data<emptyContext, Point2D, I> elt) {
// std::cout << elt.getData() << " <<<< Pop!" << std::endl;
}
template <class I> void ConvexHullExtras<I>::noPop(Point2D data) {}
template <class I> void UpperHullExtras<I>::noPop(Point2D data) {}

template <class I> bool ConvexHullExtras<I>::pushCondition(Point2D data) {
template <class I> bool UpperHullExtras<I>::pushCondition(Point2D data) {
// std::cout << data << " <<<< push condition returning true " << std::endl;
return true;
}
template <class I>
void ConvexHullExtras<I>::prePush(Data<emptyContext, Point2D, I> elt) {}
void UpperHullExtras<I>::prePush(Data<emptyContext, Point2D, I> elt) {}
template <class I>
void ConvexHullExtras<I>::postPush(Data<emptyContext, Point2D, I> elt) {
// std::cout << "ConvexHullStackAlgo::pushAction Nothing to see here " <<
void UpperHullExtras<I>::postPush(Data<emptyContext, Point2D, I> elt) {
// std::cout << "UpperHullStackAlgo::pushAction Nothing to see here " <<
// elt.getData() << std::endl;
}
template <class I> void ConvexHullExtras<I>::noPush(Point2D data) {}
template <class I> void UpperHullExtras<I>::noPush(Point2D data) {}

template <class I> void ConvexHullExtras<I>::reportStack() {}
template <class I> void UpperHullExtras<I>::reportStack() {}

#endif // CONVEXHULLEXTRAS
#endif // UPPERHULLEXTRAS
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// ConvexHull : Implementation
// UpperHull : Implementation

/*==============================================================================
Includes
==============================================================================*/
#include "include/convexHull.hpp"
#include "include/upperHull.hpp"
#include <cstdint>

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

// using ConvexHull8 = ConvexHull<std::uint_least8_t>;
// using ConvexHull16 = ConvexHull<std::uint_least16_t>;
using ConvexHull32 = ConvexHull<std::uint_least32_t>;
// using ConvexHull64 = ConvexHull<std::uint_least64_t>;
// using UpperHull8 = UpperHull<std::uint_least8_t>;
using UpperHull16 = UpperHull<std::uint_least16_t>;
// using UpperHull32 = UpperHull<std::uint_least32_t>;
// using UpperHull64 = UpperHull<std::uint_least64_t>;

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

ConvexHull32 stack(filepath);
UpperHull16 stack(filepath);
stack.run();
// stack.println();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// ConvexHull : Implementation
// UpperHull : Implementation

/*==============================================================================
Includes
==============================================================================*/
#include "include/convexHull.hpp"
#include "include/upperHull.hpp"
#include <cstdint>

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

using ConvexHull8 = ConvexHull<std::uint_least8_t>;
// using ConvexHull16 = ConvexHull<std::uint_least16_t>;
// using ConvexHull32 = ConvexHull<std::uint_least32_t>;
// using ConvexHull64 = ConvexHull<std::uint_least64_t>;
// using UpperHull8 = UpperHull<std::uint_least8_t>;
// using UpperHull16 = UpperHull<std::uint_least16_t>;
using UpperHull32 = UpperHull<std::uint_least32_t>;
// using UpperHull64 = UpperHull<std::uint_least64_t>;

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

ConvexHull8 stack(filepath);
UpperHull32 stack(filepath);
stack.run();
//stack.println();
// stack.println();

return 0;
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// ConvexHull : Implementation
// UpperHull : Implementation

/*==============================================================================
Includes
==============================================================================*/
#include "include/convexHull.hpp"
#include "include/upperHull.hpp"
#include <cstdint>

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

// using ConvexHull8 = ConvexHull<std::uint_least8_t>;
using ConvexHull16 = ConvexHull<std::uint_least16_t>;
// using ConvexHull32 = ConvexHull<std::uint_least32_t>;
// using ConvexHull64 = ConvexHull<std::uint_least64_t>;
// using UpperHull8 = UpperHull<std::uint_least8_t>;
// using UpperHull16 = UpperHull<std::uint_least16_t>;
// using UpperHull32 = UpperHull<std::uint_least32_t>;
using UpperHull64 = UpperHull<std::uint_least64_t>;

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

ConvexHull16 stack(filepath);
UpperHull64 stack(filepath);
stack.run();
//stack.println();
// stack.println();

return 0;
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// ConvexHull : Implementation
// UpperHull : Implementation

/*==============================================================================
Includes
==============================================================================*/
#include "include/convexHull.hpp"
#include "include/upperHull.hpp"
#include <cstdint>

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

// using ConvexHull8 = ConvexHull<std::uint_least8_t>;
// using ConvexHull16 = ConvexHull<std::uint_least16_t>;
// using ConvexHull32 = ConvexHull<std::uint_least32_t>;
using ConvexHull64 = ConvexHull<std::uint_least64_t>;
using UpperHull8 = UpperHull<std::uint_least8_t>;
// using UpperHull16 = UpperHull<std::uint_least16_t>;
// using UpperHull32 = UpperHull<std::uint_least32_t>;
// using UpperHull64 = UpperHull<std::uint_least64_t>;

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

ConvexHull64 stack(filepath);
UpperHull8 stack(filepath);
stack.run();
//stack.println();
// stack.println();

return 0;
}
Loading

0 comments on commit 2babfca

Please sign in to comment.