A concise library for solving sparse linear systems with direct methods. The code is a C# port of CSparse, written by Tim Davis and part of the SuiteSparse project.
Features
- Sparse LU, Cholesky, LDL' and QR decomposition of real and complex systems
- Fill-reducing orderings
- Dulmage-Mendelsohn decomposition
All methods are described in detail in the excellent textbook Direct Methods for Sparse Linear Systems, SIAM, Philadelphia, PA, 2006 by Tim Davis.
Examples
- Creating a sparse LU factorization
- Creating a sparse Cholesky factorization
- Creating a sparse LDL' factorization
- Creating a sparse QR factorization
- Using Math.NET Numerics and CSparse.NET
Related projects
- CSparse.Interop - Bindings to native solvers like MKL, Suitesparse, SuperLU and ARPACK.
- CSparse.Extensions - Extension methods, dense direct factorizations and iterative solvers.
Supporters
CSparse.NET has received support/donations from the following projects:
- BriefFiniteElement.NET - https://github.com/BriefFiniteElementNet
LGPL Compliance & Building for SAInt
This repository is a fork of CSparse.NET maintained by encoord for use in the SAInt software.
Purpose
To comply with the LGPL-2.1+ license, we provide this source code along with the strong-naming key (CSparseKey.snk) used to sign the official build distributed with SAInt.
This ensures that users can modify this library, rebuild it, and replace the DLL in their SAInt installation. Because the public signing key is included here, your modified build will have the same strong name identity (Public Key Token) as the official version, allowing the signed SAInt application to load it without errors.
How to Build and Replace
If you wish to modify the CSparse library and use it within SAInt, follow these steps:
-
Clone the Repository
git clone https://github.com/encoord/CSparse.NET.git cd CSparse.NET -
Verify Signing Configuration The project is pre-configured to sign the assembly using
CSparseKey.snk(located in the root/project folder). You can verify this in Visual Studio by right-clicking the Project > Properties > Signing, where "Sign the assembly" should be checked and set toCSparseKey.snk. -
Build the Project You can build using Visual Studio. We recommend building in Release mode to match the optimization of the installed software.
-
Replace the DLL
- Locate your new build artifact (e.g.,
bin\Release\netstandard2.0\CSparse.dll). - Navigate to your SAInt installation directory.
- Backup the existing
CSparse.dll. - Copy your new
CSparse.dllinto the folder. - Restart SAInt. The application will now use your modified library.
- Locate your new build artifact (e.g.,
License
CSparse: a Concise Sparse Matrix package.
Copyright (c) 2006-2022, Timothy A. Davis. All Rights Reserved.
SPDX-License-Identifier: LGPL-2.1+
This library is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
the Free Software Foundation; either version 2.1 of the License, or (at your option)
any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301 USA