GJK_nD
 All Classes Files Functions Typedefs Friends Pages
Public Types | Static Public Member Functions | List of all members
GJKnD Class Reference

An implementation of our extension of the classical GJK algorithm. More...

#include <GJK_nD.hpp>

Public Types

typedef Eigen::VectorXd Vector
 The vector type used in the GJKnD algorithm. More...
 
typedef Vector Point
 The point type used in the GJKnD algorithm. More...
 

Static Public Member Functions

static bool isDigitalHyperplane (const std::vector< Point > &setIn, const std::vector< Point > &setAbove, const std::vector< Point > &setBelow, Vector &normal, double &h, double &H)
 

Detailed Description

An implementation of our extension of the classical GJK algorithm.

Th GJKnD algorithm allows us to separate 3 sets of integer points with a couple of parallel hyperplanes describing a digital hyperplane, with one set of point inside the digital hyperplane, and the two other ones lying on their own opposite part of the digital hyperplane.

std::vector<Point> setIn, setUp, setDown;
// initialize the 3 pointsets with your nD data
...
Vector orthoDir;
double lower_bound, upper_bound;
bool dhpOK;
try {
dhpOK = isDigitalHyperplane(setIn, setUp, setDown,
orthoDir, lower_bound, upper_bound);
}
catch (const SingularSystem & e) {
std::cout << "Robustness problem: " << e.what()
<< " Unable to decide whether the sets are separable."
<< std::endl;
return;
}
if (dhpOK)
std::cout << "The sets describe a digital hyperplane: "
<< lower_bound << " < " << orthoDir.transpose() << " . X < "
<< upper_bound << std::endl;
else
std::cout << "The sets ares not separable by a pair of parallel "
<< "hyperplanes" << std::endl;

Member Typedef Documentation

The point type used in the GJKnD algorithm.

typedef Eigen::VectorXd GJKnD::Vector

The vector type used in the GJKnD algorithm.

Member Function Documentation

bool GJKnD::isDigitalHyperplane ( const std::vector< Point > &  setIn,
const std::vector< Point > &  setAbove,
const std::vector< Point > &  setBelow,
Vector normal,
double &  h,
double &  H 
)
static

The isDigitalHyperplane function looks for a couple of hyperplanes that separtes the 3 sets of input points.

Parameters
[in]setInthe set of points that shall lie between the couple of hyperplanes
[in]setAbovethe set of points that shall lie above the upper hyperplane
[in]setBelowthe set of points that shall lie below the lower hyperplane
[out]normalthe normal vector of the separting hyperplanes
[out]hthe shift parameter of the lower hyperplanes
[out]Hthe shift parameter of the upper hyperplanes
Returns
true if the couple of hyperplanes exists, false otherwise
Warning
Due to the underlying double type, robustness problems may occur and this function may throw a SingularSystem exception. The user should catch this exception and be aware that the fact the system is singular does not mean the sets are not separable.

The documentation for this class was generated from the following files: