AIToolbox
A library that offers tools for AI problem solving.
Polytope.hpp File Reference
#include <array>
#include <optional>
#include <Eigen/Dense>
#include <AIToolbox/TypeTraits.hpp>
#include <AIToolbox/Utils/Core.hpp>
#include <AIToolbox/Utils/Combinatorics.hpp>
#include <AIToolbox/Utils/IndexMap.hpp>
#include <AIToolbox/Utils/LP.hpp>

Go to the source code of this file.

Classes

class  AIToolbox::WitnessLP
 This class implements an easy interface to do Witness discovery through linear programming. More...
 

Namespaces

 AIToolbox
 

Typedefs

using AIToolbox::Hyperplane = Vector
 Defines a plane in a simplex where each value is the height at that corner. More...
 
using AIToolbox::Point = ProbabilityVector
 Defines a point inside a simplex. Coordinates sum to 1. More...
 
using AIToolbox::PointSurface = std::pair< std::vector< Point >, std::vector< double > >
 A surface within a simplex defined by points and their height. Should not contain the corners. More...
 
using AIToolbox::CompactHyperplanes = Matrix2D
 A compact set of (probably |A|) hyperplanes, one per column (probably |S| rows). This is generally used with PointSurface; otherwise we use a vector<Hyperplane>. More...
 

Functions

bool AIToolbox::dominates (const Hyperplane &lhs, const Hyperplane &rhs)
 This function checks whether an Hyperplane dominates another. More...
 
template<typename Iterator , typename P = std::identity>
Iterator AIToolbox::findBestAtPoint (const Point &point, Iterator begin, Iterator end, double *value=nullptr, P p=P{})
 This function returns an iterator pointing to the best Hyperplane for the specified point. More...
 
template<typename Iterator , typename P = std::identity>
Iterator AIToolbox::findBestAtSimplexCorner (const size_t corner, Iterator begin, Iterator end, double *value=nullptr, P p=P{})
 This function returns an iterator pointing to the best Hyperplane for the specified corner of the simplex space. More...
 
template<typename Iterator , typename P = std::identity>
Iterator AIToolbox::findBestDeltaDominated (const Point &point, const Hyperplane &plane, double delta, Iterator begin, Iterator end, P p=P{})
 This function returns, if it exists, an iterator to the highest Hyperplane that delta-dominates the input one. More...
 
template<typename Iterator , typename P = std::identity>
Iterator AIToolbox::extractBestAtPoint (const Point &point, Iterator begin, Iterator bound, Iterator end, P p=P{})
 This function finds and moves the Hyperplane with the highest value for the given point at the beginning of the specified range. More...
 
template<typename Iterator , typename P = std::identity>
Iterator AIToolbox::extractBestAtSimplexCorners (const size_t S, Iterator begin, Iterator bound, Iterator end, P p=P{})
 This function finds and moves all best Hyperplanes in the simplex corners at the beginning of the specified range. More...
 
template<typename PIterator , typename VIterator , typename P = std::identity>
PIterator AIToolbox::extractBestUsefulPoints (PIterator pbegin, PIterator pend, VIterator begin, VIterator end, P p=P{})
 This function finds and moves all non-useful points at the end of the input range. More...
 
template<typename NewIt , typename OldIt , typename P1 = std::identity, typename P2 = std::identity>
PointSurface AIToolbox::findVerticesNaive (NewIt beginNew, NewIt endNew, OldIt alphasBegin, OldIt alphasEnd, P1 p1=P1{}, P2 p2=P2{})
 This function implements a naive vertex enumeration algorithm. More...
 
template<typename Range , typename P = std::identity>
PointSurface AIToolbox::findVerticesNaive (const Range &range, P p=P{})
 This function returns all vertices for a given range of planes. More...
 
double AIToolbox::computeOptimisticValue (const Point &p, const std::vector< Point > &points, const std::vector< double > &values)
 This function computes the optimistic value of a point given known vertices and values. More...
 
std::tuple< double, Vector > AIToolbox::LPInterpolation (const Point &p, const CompactHyperplanes &ubQ, const PointSurface &ubV)
 This function computes the exact value of the input Point w.r.t. the given surfaces. More...
 
std::tuple< double, Vector > AIToolbox::sawtoothInterpolation (const Point &p, const CompactHyperplanes &ubQ, const PointSurface &ubV)
 This function computes an approximate, but quick, upper bound on the surface value at the input point. More...