[Sparse_Matrix] Add a runnable example that solves a Matrix Market system end to end

Open
#407 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
cmake, cpp

Research direction

Start with Sparse_Matrix/CMakeLists.txt and the test assets in Sparse_Matrix/test/assets/; check how existing test executables are built and how the library loads Matrix Market files. Build the requested examples/solve_mtx.cpp target with the solver options and output described in the issue, then verify the stated command converges and prints the residual and that CI builds the example.

Written by the indexing model from the issue text.

Description

area: sparse-matrix priority: P3 size: S type: enhancement

Summary

The library has no example program, so the only usage documentation is the README snippets, which don't compile (see the README issue). A small CLI would double as a smoke test and a docs-site demo.

Location

  • Sparse_Matrix/CMakeLists.txt
  • Sparse_Matrix/test/assets/

Evidence

find Sparse_Matrix -name '*example*' is empty; the only executables are under test/.

Expected

An examples/solve_mtx.cpp target: load a .mtx, pick a solver/preconditioner, print iterations, residual and timing.

Proposed fix

Add option(SMM_WITH_EXAMPLES), an example using SMM::loadMatrix, BiCGStab + SGS/ILU0 and ConjugateGradient + IC0; reference it from both READMEs. Optionally add a relative-residual (||r||/||b||) stopping mode, since the current absolute L2 criterion depends on problem scale.

Acceptance criteria

  • ./solve_mtx test/assets/mesh1e1_structural_48_48_177.mtx --solver cg converges and prints the residual
  • Example is built in CI

Repository audit, November 2026 · Phase 9 · New features · evidence: found by code reading · ref core-cpp-045


Generated by Claude Code

Dominant language
C++
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ibra-kdbra/Math-Problems

All issues in ibra-kdbra/Math-Problems

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.