Repository navigation
Add is_in method to HPolytope for point membership testing - #2
Open
DHRUV-1-star wants to merge 2 commits into
Open
DHRUV-1-star wants to merge 2 commits into
DHRUV-1-star wants to merge 2 commits into
Conversation
Implement HPolytope.is_in with C++ oct-file binding to volesti's P.is_in() point membership algorithm. Supports both single d x 1 points and d x N matrices of points, with an optional tolerance parameter. Includes input validation, comprehensive BIST test cases, and documentation in Texinfo and README.
- Reject non-real x and tol at both Octave and C++ oct-file levels so complex inputs are not silently cast to real parts. - When d == 1, require vector inputs and reject non-vector matrices, transposing column vectors while reporting dimension errors for multi-dimensional matrices. - Add BIST tests for complex input rejection and 1D polytope handling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces the$Ax \le b$ .
is_inmethod to theHPolytopeclass, enabling point membership testing for H-representation convex polytopes against the linear inequality systemChanges Made
Oct-File C++ Binding (
src/__volesti_HPolytope__.cc):do_is_inmethod interfacing directly with volesti's underlyingP.is_in(pt, tol)point membership algorithm.xandtolare strictly real values (!args(3).isreal()/!args(4).isreal()) so imaginary components are never silently discarded.-1inside / on boundary within tolerance) to Octave logical return values.Octave Classdef Interface (
inst/HPolytope.m):is_in(P, x, tol)with strict input validation (checks for non-empty, real numeric matrix, rejection of complex/NaN/Inf values, non-negative real tolerance).help HPolytope.is_inand updated@seealso.BIST Test Suite (
inst/tests/HPolytope.m-tst):x, complextol, multi-dimensional matrix for 1D polytope, dimension mismatch).Documentation (
README.md):is_inmethod implementation.