How odd-tortoise/plocky works
Project type and purpose
• PlockY is a header-only C++ library (no client “frontend”). Its purpose is to load block-structured matrices and vectors from custom file formats (.blk/.vblk), decompose them according to user-defined splitting strategies, and solve the resulting linear systems iteratively.
File structure
• Top‐level:
• /PlockY: core headers (loader factories, block types, solver base, strategy, step, regrouper, etc.)
• examples/: consumer code showing how to load files, define strategies, run the solver
• test/: unit & integration tests (uses Catch2)
• benchmarks/: performance tests against various block sizes and data sets
• docs/: Doxygen config; CMake target to generate API docs
• data/ & benchmarks_data/: sample .blk/.vblk and CSV/MTX files to feed into the library
• CMakeLists.txt + GitHub workflows: build, test, profile on multiple platforms
README for additional insights
• Confirms architecture layers: File I/O, Data model, Splitting strategy, Solver
• Highlights dependencies: Eigen for numerics, Catch2 for testing, gperftools for profiling
a. Main components
1. Data Input Layer
– .blk Parser (BlockMatrixLoader + AbstractBlockLoaderFactory + CSV/MTX factory)
– .vblk Parser (BlockVectorLoader + same factory)
2. Data Model
– Block (abstract) → DenseBlock, SparseBlock, VecBlock
– BlockMatrix, BlockVector
3. Splitting Strategy Layer
– Step (one splitting operation)
– Strategy (sequence of Steps + Regrouper for block reordering)
4. Solver Layer
– Solver (or BlockSolverBase subclass)
– Iterative loop (tolerance, max iterations, relaxation factor)
5. Linear Algebra Engine
– Eigen (linked internally; all matrix operations delegate to Eigen types)
6. Support & Integration
– loader_helper (common I/O utilities)
– Logging/Profiling hooks (gperftools integration)
7. Build & Test Infrastructure
– CMake
– CI workflows (.github/workflows)
– Tests (Catch2)
– Examples & Benchmarks
b. Relationships and interactions
• Data files → parsed by Loader → instantiated as BlockMatrix/BlockVector
• BlockMatrix/BlockVector → passed to Strategy to generate an ordered sequence of Steps
• Strategy + Data Model → feed into Solver
• Solver ↔ Eigen (matrix‐vector operations)
• Regrouper can reorder Data Model between Steps
• Tests/examples/benchmarks invoke Loader → Strategy → Solver
• CMake orchestrates build/test/doc generation; CI automates builds on push
c. Architectural patterns/design principles
• Factory Method (AbstractBlockLoaderFactory → CSV | MTX)
• Strategy Pattern (Strategy + Steps encapsulate algorithm choices)
• Header‐only modularity (single‐header inclusion)
• Separation of concerns: I/O vs. data model vs. algorithm vs. build/test
d. Relevant technologies/frameworks
• Eigen (linear algebra)
• Catch2 (unit/integration tests)
• gperftools (profiling)
• CMake (build system)
• GitHub Actions (CI)
• Doxygen (docs)