numerical-patterns

Implement C++20 numerical patterns for dense and sparse matrix operations.

40|8|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/ysyecust/everything-claude-code --skill numerical-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: numerical-patterns
Source: https://github.com/ysyecust/everything-claude-code/tree/main/skills/numerical-patterns
Command: npx skills add https://github.com/ysyecust/everything-claude-code --skill numerical-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the challenge of implementing robust, high-performance numerical patterns in C++20.

Core Features & Use Cases

  • Dense and Sparse Matrix Structures: wrappers and patterns for dense operations with a simple API and CSR-based sparse matrices.
  • Iterative Solvers: templates for Conjugate Gradient and GMRES to solve large linear systems efficiently.
  • Numerical Stability: techniques like Kahan summation and robust norm computations to reduce floating-point error.
  • HPC I/O: guidance and patterns for scalable data management with MPI-IO and HDF5 in HPC workflows.
  • Use Case: A simulation workflow requiring large-scale linear solves and data I/O can reuse these patterns to implement robust, portable solvers.

Quick Start

Instantiate DenseMatrix or SparseMatrixCSR in your C++20 project, prepare vectors b and initial guess x, and invoke ConjugateGradient or GMRES to solve Ax = b. Leverage the included numerical stability utilities and plan your I/O with MPI-IO or HDF5 as needed.

Frequently Asked Questions about numerical-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement high-performance numerical solvers for large linear systems in C++20?

You can implement numerical solvers in C++20 using templates for Conjugate Gradient and GMRES to efficiently solve large linear systems. Instantiate DenseMatrix or SparseMatrixCSR, prepare vectors b and initial guess x, and invoke the solver for Ax = b.

What is the best way to reduce floating-point error in scientific computing applications?

To reduce floating-point error in scientific computing, apply numerical stability techniques like Kahan summation and robust norm computations. These utilities are designed to minimize floating-point errors during dense and sparse matrix operations.

Can I use MPI-IO and HDF5 for scalable HPC I/O in my simulation workflow?

Yes, you can use MPI-IO and HDF5 for scalable HPC I/O in your simulation workflow. The patterns provide guidance for scalable data management, enabling robust and portable data input and output in high-performance computing environments.

Does this approach support both dense and sparse matrix operations?

Yes, the approach supports both dense and sparse matrix operations in C++20. It provides wrappers for dense operations with a simple API and CSR-based sparse matrix structures, enabling flexible handling of various numerical patterns.

When do I need CSR-based sparse matrices instead of dense matrices for numerical patterns?

You need CSR-based sparse matrices instead of dense matrices when handling large-scale systems where most elements are zero, saving memory and computation. Dense matrices are suitable for smaller or fully populated matrices requiring a simpler API.

Why does numerical stability matter when implementing iterative solvers like GMRES?

Numerical stability matters when implementing iterative solvers like GMRES because floating-point errors accumulate over iterations, potentially causing divergence. Incorporating Kahan summation and robust norm computations ensures results remain accurate and reliable.