41 for (
size_t i = 0; i <
original.size()
and j < sub.size(); ++i)
44 return j == sub.size();
55 double cx = 0.0,
double cy = 0.0)
58 for (
size_t i = 0; i < n; ++i)
373 for (
int e = 1; e <= 10; ++e)
392 for (
int e = 1; e <= 10; ++e)
468 for (
int i = 0; i < 6; ++i)
475 for (
size_t k = 1;
k <= 4; ++
k)
480 for (
size_t j = 0; j <
k; ++j)
514 for (
size_t k = 1;
k <= 5; ++
k)
541 if (
verts.size() < 3)
545 for (
size_t i = 0; i <
verts.size(); ++i)
547 const auto & a =
verts(i);
548 const auto & b =
verts((i + 1) %
verts.size());
552 return std::abs(
sum) * 0.5;
620 auto result =
cs(
pts, 1);
635 auto result =
cs(
pts, 1);
Simple dynamic array with automatic resizing and functional operations.
T & append(const T &data)
Append a copy of data
Chaikin corner-cutting subdivision for polygon smoothing.
static Polygon smooth_polygon(const Polygon &poly, size_t iterations, const Geom_Number &ratio=Geom_Number(1, 4))
Smooth a closed polygon.
Douglas-Peucker polyline simplification.
Polygon simplify_polygon(const Polygon &poly, const Geom_Number &epsilon) const
Simplify a closed polygon.
Dynamic singly linked list with functional programming support.
T & append(const T &item)
static Array< Point > extract_vertices(const Polygon &poly)
Extract vertices from a polygon into an array for indexed access.
Represents a point with rectangular coordinates in a 2D plane.
A general (irregular) 2D polygon defined by a sequence of vertices.
void add_vertex(const Point &point)
Add a vertex to the polygon.
void close()
Close the polygon.
Visvalingam-Whyatt polyline simplification.
static Polygon simplify_polygon(const Polygon &poly, const Geom_Number &area_threshold)
Simplify a closed polygon.
static Polygon make_circle(size_t n, double radius=10.0, double cx=0.0, double cy=0.0)
static bool is_subsequence(const Array< Point > &original, const Array< Point > &sub)
static Array< Point > poly_verts(const Polygon &poly)
TEST_F(GeomAlgorithmsTest, DP_StraightLine)
__gmp_expr< T, __gmp_unary_expr< __gmp_expr< T, U >, __gmp_cos_function > > cos(const __gmp_expr< T, U > &expr)
__gmp_expr< T, __gmp_unary_expr< __gmp_expr< T, U >, __gmp_sin_function > > sin(const __gmp_expr< T, U > &expr)
Main namespace for Aleph-w library functions.
and
Check uniqueness with explicit hash + equality functors.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
double geom_number_to_double(const Geom_Number &n)
Converts a Geom_Number to its double precision representation.
mpq_class Geom_Number
Numeric type used by the geometry module.
T sum(const Container &container, const T &init=T{})
Compute sum of all elements.