Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
dd0f1eb
refactor(doxyfile): Refactor Doxyfile to standardize settings
lrleon Jan 28, 2026
4a4e122
Merge branch 'master' of github.com:lrleon/Aleph-w
lrleon Feb 3, 2026
8863f79
Merge branch 'master' of github.com:lrleon/Aleph-w
lrleon Feb 9, 2026
b3b795d
Merge branch 'master' of github.com:lrleon/Aleph-w
lrleon Feb 9, 2026
9e162e8
Merge branch 'master' of github.com:lrleon/Aleph-w
lrleon Feb 10, 2026
95914a2
Merge branches 'master' and 'master' of github.com:lrleon/Aleph-w
lrleon Feb 10, 2026
a0b3061
removed not needed loop
lrleon Feb 10, 2026
18097d2
Merge branch 'master' of github.com:lrleon/Aleph-w
lrleon Feb 11, 2026
fe7f669
Merge branch 'master' of github.com:lrleon/Aleph-w
lrleon Feb 11, 2026
772570d
refactor(geometry): Consolidate point utilities into point.H
lrleon Feb 11, 2026
7195a7a
feat(geom): Add advanced computational geometry algorithms
lrleon Feb 12, 2026
cafac53
refactor(geom): Refactor, add, and update geometry algorithms
lrleon Feb 12, 2026
2becf83
feat(geom): Implement advanced 2D geometric algorithms
lrleon Feb 13, 2026
0112954
feat(geom): Add rotated ellipse, bezier curves, 3D primitives
lrleon Feb 13, 2026
f764f96
refactor(geom): Rename distance and contains methods, add new tests
lrleon Feb 13, 2026
a790c30
feat(geometry): Add comprehensive examples and visual tests
lrleon Feb 13, 2026
d4d13ff
refactor(geom): Rework polygon algorithms and update tests
lrleon Feb 13, 2026
d17da42
refactor(geom): Split tests, add Greiner-Hormann, fix primitives
lrleon Feb 13, 2026
3487d96
refactor(geom): Rework algorithms, add polygon utilities
lrleon Feb 14, 2026
94ab0e8
feat(geometry): Add TikZ examples for polygons and Voronoi diagrams
lrleon Feb 14, 2026
022d0f6
feat(tikzgeom): Add scene API, algorithm helpers, and multi-sort
lrleon Feb 14, 2026
d635f31
test(geom): Refactor geometry tests and add new features
lrleon Feb 14, 2026
b50cda9
refactor(geom): Refactor segment intersection, polygon updates
lrleon Feb 15, 2026
a1005b9
refactor(geom): Refine polygon triangulation logic
lrleon Feb 15, 2026
fb1abdf
refactor(geom): Improve visibility polygon and add noexcept
lrleon Feb 15, 2026
bf83d41
refactor(geom): Migrate LineEq to use Geom_Number
lrleon Feb 15, 2026
58c3538
> Gemini 2.5 generated this response due to high traffic on Gemini 3
lrleon Feb 15, 2026
3dea283
feat(geom): Add Constrained Delaunay Triangulation
lrleon Feb 15, 2026
ef8c8ff
feat(geom): Implement GJK convex polygon distance & MEC
lrleon Feb 15, 2026
57b25ef
feat(geom): Add polygon simplification algorithms
lrleon Feb 15, 2026
0033eea
feat(geometry): Add constrained Delaunay triangulation example
lrleon Feb 15, 2026
478baf3
feat(geom): Add PolygonOffset algorithm and container conversions
lrleon Feb 16, 2026
88fb47a
feat(geom): Add segment-segment intersection example and enhance TikZ…
lrleon Feb 17, 2026
d26dbfb
refactor(geom): Enhance geometry primitives and EEPIC drawing
lrleon Feb 17, 2026
d738bd2
refactor(geom): Improve segment intersection logic
lrleon Feb 17, 2026
356ffa3
refactor(geom): Refactor TikZ drawing functions for better reusability
lrleon Feb 17, 2026
3ad1d45
refactor(geom): Improve Chaikin test and update TMPointLocation
lrleon Feb 17, 2026
e9daae7
refactor(geom): Update Coverity configuration and enhance error handl…
lrleon Feb 18, 2026
1707f05
refactor(geom): Simplify control flow and improve readability in geom…
lrleon Feb 18, 2026
accc903
refactor(geom): Adjust ostream overload for mpq_class in global names…
lrleon Feb 18, 2026
5ff2dcc
refactor(geom): Improve GMP stream operators and syntax
lrleon Feb 18, 2026
1bf7fad
refactor(test): Improve funnel trace output and fix dynlist tests
lrleon Feb 19, 2026
3c1bb0c
Update Tests/dynlist.cc
lrleon Feb 19, 2026
15d9261
fix(ci): Update gcov ignore parse errors setting
lrleon Feb 19, 2026
1f3357e
Merge branch 'geom' of github.com:lrleon/Aleph-w into geom
lrleon Feb 19, 2026
2a2900f
test(dynlist): Remove extraneous closing brace
lrleon Feb 19, 2026
1b739e5
refactor(tpl_dynDlist): Improve code quality and fix warnings
lrleon Feb 19, 2026
161c245
fix(ci): Update gcov ignore parse errors
lrleon Feb 19, 2026
c5fbc21
docs(tests): Add Doxygen comments and license header
lrleon Feb 19, 2026
b938c0c
docs(geometry): Add Doxygen comments for AlephArrayConvertible concep…
lrleon Feb 19, 2026
b6e83e7
docs(geom): Enhance Doxygen documentation across geometry modules
lrleon Feb 19, 2026
edad54e
docs(geom): Enhance Doxygen documentation across geometry modules
lrleon Feb 19, 2026
e896b0c
docs(geom): Enhance Doxygen comments for Voronoi and related classes
lrleon Feb 19, 2026
e1e5838
Update README.md
lrleon Feb 19, 2026
c7b17c7
Update Tests/segment_test.cc
lrleon Feb 19, 2026
861288b
Update Tests/point_test.cc
lrleon Feb 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Aleph-w is a comprehensive C++20 library for graph algorithms and data structure
- **MUST**: Use `std::optional` instead of sentinel values or nullable pointers where semantically clear
- **MUST**: Use `if constexpr` for compile-time branching in templates
- **MUST**: Use concepts to constrain template parameters (see section below)
- **MUST**: Use and, or, not for logical operations (instead of &&, ||, !)
Comment thread
lrleon marked this conversation as resolved.
Comment thread
lrleon marked this conversation as resolved.
- **SHOULD**: Use `std::span` for non-owning views of contiguous sequences
- **SHOULD**: Consider `std::variant` for type-safe unions
- **SHOULD**: Use fold expressions for variadic template expansion
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,20 @@ jobs:

- name: Test
run: |
mkdir -p build/test_artifacts/golden_svg
export ALEPH_TEST_GOLDEN_DIR="$PWD/build/test_artifacts/golden_svg"
ctest --test-dir build --output-on-failure --parallel 2 --timeout 600

- name: Upload test logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: ctest-logs-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.build_type }}
if-no-files-found: ignore
path: |
build/Testing/Temporary/LastTest.log
build/CMakeCache.txt
build/test_artifacts/golden_svg

coverage:
name: coverage (ubuntu-24.04, gcc, Debug)
Expand Down Expand Up @@ -275,6 +279,8 @@ jobs:

- name: Test
run: |
mkdir -p build-coverage/test_artifacts/golden_svg
export ALEPH_TEST_GOLDEN_DIR="$PWD/build-coverage/test_artifacts/golden_svg"
# Exclude this benchmark from coverage runs because instrumentation
# changes timing characteristics and can make this test flaky.
ctest --test-dir build-coverage --output-on-failure --parallel 2 --timeout 600 \
Expand All @@ -292,7 +298,7 @@ jobs:
--gcov-ignore-errors source_not_found
--gcov-ignore-errors no_working_dir_found
--gcov-ignore-errors output_error
--gcov-ignore-parse-errors negative_hits.warn
--gcov-ignore-parse-errors all
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using --gcov-ignore-parse-errors all is very broad and can hide genuine coverage parsing issues (including regressions). Prefer a narrower set of ignore modes (or adding new specific ones as needed) so coverage failures remain actionable.

Suggested change
--gcov-ignore-parse-errors all

Copilot uses AI. Check for mistakes.
--exclude "(^|.*/)Tests/.*"
--exclude "(^|.*/)Examples/.*"
--exclude "(^|.*/)build-coverage/.*"
Expand Down Expand Up @@ -346,9 +352,11 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ctest-logs-coverage
if-no-files-found: ignore
path: |
build-coverage/Testing/Temporary/LastTest.log
build-coverage/CMakeCache.txt
build-coverage/test_artifacts/golden_svg

sanitizers:
name: sanitizers (ubuntu-24.04, gcc, Debug)
Expand Down Expand Up @@ -399,17 +407,21 @@ jobs:
- name: Test
env:
ASAN_OPTIONS: detect_leaks=1
ALEPH_TEST_GOLDEN_DIR: ${{ github.workspace }}/build-asan/test_artifacts/golden_svg
run: |
mkdir -p "$ALEPH_TEST_GOLDEN_DIR"
ctest --test-dir build-asan --output-on-failure --parallel 2 --timeout 600

- name: Upload test logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: ctest-logs-sanitizers
if-no-files-found: ignore
path: |
build-asan/Testing/Temporary/LastTest.log
build-asan/CMakeCache.txt
build-asan/test_artifacts/golden_svg

tsan:
name: tsan (ubuntu-24.04, clang, Debug)
Expand Down Expand Up @@ -465,17 +477,21 @@ jobs:
- name: Test
env:
TSAN_OPTIONS: halt_on_error=1
ALEPH_TEST_GOLDEN_DIR: ${{ github.workspace }}/build-tsan/test_artifacts/golden_svg
run: |
mkdir -p "$ALEPH_TEST_GOLDEN_DIR"
ctest --test-dir build-tsan --output-on-failure --parallel 2 --timeout 600

- name: Upload test logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: ctest-logs-tsan
if-no-files-found: ignore
path: |
build-tsan/Testing/Temporary/LastTest.log
build-tsan/CMakeCache.txt
build-tsan/test_artifacts/golden_svg

ci-success-push:
name: CI Success
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
name: Coverity Scan

on:
# Trigger on push to workflow file and relevant source/build files
push:
paths:
- '.github/workflows/coverity.yml'
- 'src/**'
- 'include/**'
- '**/*.c'
- '**/*.cc'
- '**/*.cpp'
- '**/*.cxx'
- 'CMakeLists.txt'
# Weekly automatic scan on the default branch only. GitHub cron schedules run in UTC.
# Currently aligned to run at 06:00 UTC on Sunday, intended to be ~4 hours after the full_analysis workflow (02:00 UTC).
schedule:
- cron: '0 6 * * 0'
# Manual trigger - can select any branch from GitHub Actions UI
workflow_dispatch:
# Optional trigger for Pull Requests via label
pull_request:
types: [labeled]

permissions:
contents: read

jobs:
coverity:
name: Coverity Static Analysis
# Only run if manually triggered or if the 'run-coverity' label was added to a PR
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && github.event.label.name == 'run-coverity')
Comment thread
lrleon marked this conversation as resolved.
Comment thread
lrleon marked this conversation as resolved.
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition github.event.label.name == 'run-coverity' should use github.event.action == 'labeled' && contains(github.event.pull_request.labels.*.name, 'run-coverity') to properly check if the label exists. The current syntax is incorrect for checking PR labels in GitHub Actions.

Suggested change
(github.event_name == 'pull_request' && github.event.label.name == 'run-coverity')
(github.event_name == 'pull_request' && github.event.action == 'labeled' && contains(github.event.pull_request.labels.*.name, 'run-coverity'))

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-24.04

env:
Expand Down
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ set(HLIST
tpl_slist.H tpl_snode.H tpl_lhash.H tpl_dynLhash.H
tpl_odhash.H tpl_memArray.H tpl_dynArray.H ahFuntional.H hash-dry.H
bloom-filter.H ah-dry.H graph-dry.H tpl_con_queue.H
q-consumer-threads.H ah-string-utils.H ah-comb.H geom_algorithms.H
q-consumer-threads.H ah-string-utils.H ah-unique.H ah-comb.H geom_algorithms.H
tikzgeom.H
tikzgeom_algorithms.H
Comment thread
lrleon marked this conversation as resolved.
tikzgeom_scene.H
tpl_fenwick_tree.H
tpl_segment_tree.H
tpl_cartesian_tree.H
Expand All @@ -132,7 +135,6 @@ set(LIBCCCSRCS
hash-dry.C
aleph-graph.C
ahNow.C
point.C
euclidian-graph-common.C
)

Expand Down Expand Up @@ -200,4 +202,4 @@ message(STATUS " Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS " C++ standard: C++${CMAKE_CXX_STANDARD}")
message(STATUS " Build examples: ${BUILD_EXAMPLES}")
message(STATUS " Build tests: ${BUILD_TESTS}")
message(STATUS " Compiler: ${CMAKE_CXX_COMPILER_ID}")
message(STATUS " Compiler: ${CMAKE_CXX_COMPILER_ID}")
33 changes: 33 additions & 0 deletions Examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,39 @@ set(EXAMPLE_PROGRAMS
cartesian_tree_example
mo_algorithm_example
mo_on_trees_example
robust_predicates_example
segment_segment_intersection_example
voronoi_clipped_cells_example
delaunay_voronoi_example
constrained_delaunay_example
point_in_polygon_example
polygon_intersection_example
tikz_polygons_example
tikz_convex_hull_example
tikz_intersection_example
tikz_voronoi_power_example
tikz_advanced_algorithms_example
tikz_funnel_animation_example
tikz_funnel_beamer_example
tikz_funnel_beamer_twocol_example
tikz_funnel_beamer_handout_example
tikz_scene_example
tikz_scene_beamer_example
tikz_scene_overlays_example
tikz_missing_primitives_example
tikz_visibility_calipers_example
tikz_render_features_example
tikz_tree_structures_example
halfplane_intersection_example
convex_hull_comparison_example
closest_pair_example
convex_polygon_distance_gjk_example
rotating_calipers_example
minimum_enclosing_circle_example
polygon_simplification_example
polygon_offset_example
chaikin_smoothing_example
trapezoidal_map_example
)

# Function to get source file from program name
Expand Down
145 changes: 145 additions & 0 deletions Examples/chaikin_smoothing_example.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
/*
Aleph_w

Data structures & Algorithms
version 2.0.0b
https://github.com/lrleon/Aleph-w

This file is part of Aleph-w library

Copyright (c) 2002-2026 Leandro Rabindranath Leon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

/// @file chaikin_smoothing_example.cc
/// @brief Demonstrates Chaikin corner-cutting polygon smoothing with TikZ output.

# include <tikzgeom_algorithms.H>
# include <cassert>
# include <cmath>
# include <iostream>
# include <fstream>

using namespace std;
using namespace Aleph;

/// Build a 5-pointed star polygon centered at the origin.
static Polygon make_star(double outer_r = 10.0, double inner_r = 4.0)
{
Polygon poly;
for (int i = 0; i < 10; ++i)
{
double angle = M_PI / 2.0 + 2.0 * M_PI * i / 10.0;
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example relies on M_PI, which is not guaranteed by the C++ standard library. Use std::numbers::pi (C++20 <numbers>) or a project constant to prevent cross-platform build failures.

Copilot uses AI. Check for mistakes.
double r = (i % 2 == 0) ? outer_r : inner_r;
poly.add_vertex(Point(r * cos(angle), r * sin(angle)));
}
poly.close();
return poly;
}

/// Build an L-shaped polygon.
static Polygon make_L_shape()
{
Polygon poly;
poly.add_vertex(Point(0, 0));
poly.add_vertex(Point(6, 0));
poly.add_vertex(Point(6, 3));
poly.add_vertex(Point(3, 3));
poly.add_vertex(Point(3, 8));
poly.add_vertex(Point(0, 8));
poly.close();
return poly;
}

int main()
{
// 1. Star polygon
Polygon star = make_star();
auto star_verts = GeomPolygonUtils::extract_vertices(star);
cout << "Star: " << star_verts.size() << " vertices" << endl;

// Smooth at 1..4 iterations
for (size_t k = 1; k <= 4; ++k)
{
Polygon smoothed = ChaikinSmoothing::smooth_polygon(star, k);
auto sv = GeomPolygonUtils::extract_vertices(smoothed);
cout << " iter " << k << ": " << sv.size() << " vertices" << endl;
}

// 2. L-shaped polygon
Polygon lshape = make_L_shape();
auto l_verts = GeomPolygonUtils::extract_vertices(lshape);
cout << "L-shape: " << l_verts.size() << " vertices" << endl;

for (size_t k = 1; k <= 3; ++k)
{
Polygon smoothed = ChaikinSmoothing::smooth_polygon(lshape, k);
auto sv = GeomPolygonUtils::extract_vertices(smoothed);
cout << " iter " << k << ": " << sv.size() << " vertices" << endl;
}

// 3. TikZ output
ofstream tex("chaikin_smoothing_output.tex");
tex << "\\documentclass[border=5mm]{standalone}\n"
<< "\\usepackage{tikz}\n"
<< "\\usepackage{subcaption}\n"
<< "\\begin{document}\n"
<< "\\begin{figure}\n";

auto draw_subfig = [&](const char * caption, const Polygon & original,
const Polygon & smoothed)
{
Tikz_Plane plane(60, 60);
put_smoothing_result(plane, original, smoothed);
tex << "\\begin{minipage}{0.45\\textwidth}\\centering\n";
plane.draw(tex);
tex << "\\captionof{subfigure}{" << caption << "}\n"
<< "\\end{minipage}\\hfill\n";
};

// Star: original, 1, 2, 4 iterations
draw_subfig("Star original", star, star);
Polygon star1 = ChaikinSmoothing::smooth_polygon(star, 1);
draw_subfig("Star iter=1", star, star1);
tex << "\n\\medskip\n\n";
Polygon star2 = ChaikinSmoothing::smooth_polygon(star, 2);
draw_subfig("Star iter=2", star, star2);
Polygon star4 = ChaikinSmoothing::smooth_polygon(star, 4);
draw_subfig("Star iter=4", star, star4);

tex << "\n\\bigskip\n\n";

// L-shape: original, 1, 2, 3 iterations
draw_subfig("L-shape original", lshape, lshape);
Polygon l1 = ChaikinSmoothing::smooth_polygon(lshape, 1);
draw_subfig("L-shape iter=1", lshape, l1);
tex << "\n\\medskip\n\n";
Polygon l2 = ChaikinSmoothing::smooth_polygon(lshape, 2);
draw_subfig("L-shape iter=2", lshape, l2);
Polygon l3 = ChaikinSmoothing::smooth_polygon(lshape, 3);
draw_subfig("L-shape iter=3", lshape, l3);

tex << "\\end{figure}\n"
<< "\\end{document}\n";

cout << "TikZ output written to chaikin_smoothing_output.tex" << endl;

return 0;
}
Loading