Skip to content

Restructure2#2

Merged
ezander merged 21 commits intomasterfrom
restructure2
Mar 16, 2026
Merged

Restructure2#2
ezander merged 21 commits intomasterfrom
restructure2

Conversation

@ezander
Copy link
Copy Markdown
Owner

@ezander ezander commented Mar 16, 2026

Restructure and modernize dvrlib

This branch restructures the project layout, improves code quality, and extends tooling.

Project structure

  • Moved tests to test/, demo to demo/; library sources stay in src/
  • Migrated test suite from hand-rolled functions to Catch2 v3 (via FetchContent) with a custom listener
    for per-test colored output
  • Added a VDI2048 regression test with hardcoded expected values

Code quality

  • Removed inheritance of vector_view/matrix_view from vector/matrix (Liskov violation); views are now
    standalone classes with operator vector()/operator matrix() for copy-out
  • Fixed narrowing conversions, replaced 0 with nullptr, named the magic constant 1.96 as z_alpha_95 =
    Φ⁻¹(0.975)
  • Added .clang-tidy and .editorconfig; unified code style to 2-space indent throughout

Build and tooling

  • Added Makefile with targets: all, run-tests, run-demo, run-coverage, run-coverage-html, check, clean
  • check target runs clang-format in dry-run mode
  • Coverage via gcov (console summary) and optionally lcov (HTML report)
  • Updated CI workflow to use make run-tests

Demo

  • Reworked VDI2048 demo to follow the standard appendix more closely, with --keep-free flag to select the
    Z-algorithm variant and a side-by-side comparison target (run-demo-compare)

ezander added 21 commits March 16, 2026 14:06
That was a code smell, violating basic principles (i.e. LSP)
The demo now accepts --keep-free on the command line to select the
Z-algorithm variant (keeping free variables in the system), vs. the
default which eliminates free variables first. A --help flag is also
added. The Makefile gains run-demo-zalg and run-demo-compare targets,
the latter showing both variants side by side via diff.
@ezander ezander merged commit 69b9dfd into master Mar 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant