SparseMatrix
A C++ class to represent a sparse matrix in compressed row format. Useful for FEM codes.
Install / Use
/learn @mygulamali/SparseMatrixREADME
SparseMatrix
Synopsis
SparseMatrix is a small C++ class to represent a sparse square matrix in compressed row format. It's very useful for FEM codes when coupled with a decent matrix solver (eg. Algebraic Multigrid Method).
Explanation
The SparseMatrix class stores matrix entries in compressed row format. That is, each each diagonal element is stored together with any non-zero off-diagonal elements. This makes it very memory efficient for storing large sparse matrices such as those used in the finite element method.
I wrote this class as part of a job interview and thought I'd add open source it so that others might benefit. Much of the API is commented in Doxygen format, and the class is templated for flexibility. A very basic solve method is also included for testing purposes.
Testing is performed via googletest, which you need to download and unzip into the main directory.
Hope it helps!
License
This software is released under the terms and conditions of The MIT License. Please see the license.txt file for more details.
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
