Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
halfplane_intersection_example.cc File Reference

2D linear-programming feasible region via half-plane intersection. More...

#include <geom_algorithms.H>
#include <cassert>
#include <fstream>
#include <iomanip>
#include <iostream>
Include dependency graph for halfplane_intersection_example.cc:

Go to the source code of this file.

Functions

static void print_banner (const char *title)
 
static Geom_Number objective (const Point &p)
 
static void write_polygon_wkt (ostream &out, const Polygon &poly)
 
static bool export_csv (const char *path, const Polygon &feasible, const Point &best_point, const Geom_Number &best_value)
 
int main (int argc, char **argv)
 

Detailed Description

2D linear-programming feasible region via half-plane intersection.

Demonstrates:

  • HalfPlaneIntersection bounded half-plane intersection.
  • Interpreting the output polygon as the feasible region of linear constraints in 2D.
See also
geom_algorithms.H
HalfPlaneIntersection

Definition in file halfplane_intersection_example.cc.

Function Documentation

◆ export_csv()

static bool export_csv ( const char *  path,
const Polygon feasible,
const Point best_point,
const Geom_Number best_value 
)
static

◆ main()

◆ objective()

static Geom_Number objective ( const Point p)
static

Definition at line 61 of file halfplane_intersection_example.cc.

References Aleph::Point::get_x(), and Aleph::Point::get_y().

Referenced by export_csv(), and main().

◆ print_banner()

static void print_banner ( const char *  title)
static

Definition at line 55 of file halfplane_intersection_example.cc.

Referenced by main().

◆ write_polygon_wkt()

static void write_polygon_wkt ( ostream &  out,
const Polygon poly 
)
static