Skip to content

Commit 5c1fce8

Browse files
authored
Merge pull request #54 from wo80/dev
Release version 4.3.0
2 parents 9f7ac1d + 6024091 commit 5c1fce8

File tree

18 files changed

+210
-55
lines changed

18 files changed

+210
-55
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
ko_fi: cwoltering
44
liberapay: cwoltering
5-
custom: ['http://wo80.bplaced.net/donate.html']
5+
custom: ['https://wo80.webspace.rocks/donate/']

.github/workflows/dotnet.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v5
1616
- name: Setup .NET
17-
uses: actions/setup-dotnet@v3
17+
uses: actions/setup-dotnet@v5
1818
with:
19-
dotnet-version: 8.0.x
19+
dotnet-version: 10.0.x
2020
- name: Restore dependencies
2121
run: dotnet restore
2222
- name: Build

CHANGELOG.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
### Version 4.3.0 - 2025-11-11
2+
3+
* Add net10.0 and remove net6.0 target framework.
4+
* Minor optimizations for matrix-vector multiplication.
5+
* Minor optimizations checking empty Span.
6+
7+
### Version 4.2.0 - 2024-09-15
8+
9+
* Make `SymbolicColumnStorage` class public and update `StronglyConnectedComponents` and `DulmageMendelsohn` decomposition accordingly.
10+
11+
### Version 4.1.0 - 2024-06-14
12+
13+
* Add overload for creating a sparse matrix from an enumerable of `ValueTuple`.
14+
* Add matrix `EnumerateIndexedAsValueTuples()` to enumerate entries as `ValueTuple`.
15+
16+
### Version 4.0.0 - 2024-04-03
17+
18+
The major version change is due to the removal of obsolete methods in the `Converter` class. Visibility of that class was changed from public to internal. In case those obsolete methods were still used, please switch to the static conversion methods provided by the `SparseMatrix` class.
19+
20+
Additional changes:
21+
22+
* Add helper method `Helper.ValidateStorage(...)` to validate the structure of a sparse matrix.
23+
* Update to `GetHashCode()` method of `CompressedColumnStorage` class.
24+
* Improvements to documentation.
25+
26+
### Version 3.8.1 - 2023-11-15
27+
28+
* Add overloads for permutation `Invert()` and `IsValid()` methods taking the permutation length as argument.
29+
30+
### Version 3.8.0 - 2023-05-20
31+
32+
* Add overloads for the factorization `Solve()` methods taking `Span<T>` as argument. Note that this introduces a dependency on `System.Memory` for the netstandard2.0 assembly.
33+
34+
### Version 3.7.0 - 2022-05-04
35+
36+
* Add sparse matrix `OfDiagonals` static method (similar to MATLAB spdiags).
37+
38+
### Version 3.6.0 - 2021-11-25
39+
40+
* Remove .NET 4.5 target framework, upgrade .NET 5.0 to 6.0.
41+
* Add constructor that takes explicit non-zeros count to `CoordinateStorage` class.
42+
43+
### Version 3.5.0 - 2021-01-14
44+
45+
* Remove .NET 4.0 target framework, add .NET 5.0.
46+
47+
### Version 3.4.9 - 2020-11-06
48+
49+
* Add `CoordinateStorage` constructor that uses existing storage arrays.
50+
* Convert `CoordinateStorage` to sparse matrix in place.
51+
52+
### Version 3.4.7 - 2020-08-28
53+
54+
* BREAKING: make `SparseLDL` constructor private (use static create methods instead).
55+
* Add complex version of `SparseLDL`.
56+
* Add `matrix.EnumerateIndexed(action)` overload.
57+
58+
### Version 3.4.6 - 2020-07-21
59+
60+
* Add `SolveTranspose` method for `SparseQR`.
61+
62+
### Version 3.4.5 - 2020-06-11
63+
64+
This release introduces the static `SparseMatrix.AutoTrimStorage` option, which enables control over hidden memory allocations in matrix addition and multiplication. By default, the matrix storage will be resized to exactly fit the non-zeros count, which involves new memory allocations. If you want to avoid this, set `AutoTrimStorage` to `false`.
65+
66+
Additional changes:
67+
68+
* Add public helper methods `Helper.TrimStrorage(...)` and `Helper.SortIndices(...)`
69+
* Add `DenseMatrix.OfJaggedArray(...)`
70+
71+
### Version 3.4.3 - 2020-05-25
72+
73+
* Add a sparse matrix multiplication overload that accepts the result matrix as a parameter.
74+
75+
### Version 3.4.2 - 2020-05-13
76+
77+
* Make CSparse.NET CLS compliant
78+
* Mark public methods of Converter class as obsolete
79+
80+
### Version 3.4.1 - 2019-10-02
81+
82+
* Improved validation of matrix constructor arguments
83+
* Fixes an issue with `CoordinateStorage` throwing `IndexOutOfRangeException` (introduced in v3.4.0)
84+
85+
### Version 3.4.0 - 2019-09-15
86+
87+
* Parallel dense and sparse matrix multiplication (by Andreas Girgensohn)
88+
* General performance improvements for sparse matrix addition and multiplication
89+
90+
### Version 3.3.0 - 2019-04-29
91+
92+
* Support more target frameworks (including netstandard2.0).
93+
* Public access to members of Dulmage-Mendelsohn decomposition.
94+
* Compute strongly connected components.
95+
96+
### Version 3.2.3 - 2018-11-30
97+
98+
* Added matrix creation helper (e.g. call `SparseMatrix.OfIndexed(s)` to convert coordinate storage).
99+
100+
### Version 3.2.2 - 2018-10-12
101+
102+
* Added MatrixMarket writer.
103+
* BREAKING: make `IProgress interface` compatible with .NET 4.5.
104+
105+
### Version 3.2.1 - 2018-09-17
106+
107+
### Version 3.2.0 - 2018-03-09
108+
109+
* Added new `DenseMatrix` type.
110+
* BREAKING: removed deprecated `CompressedColumnStorage` type.
111+
* BREAKING: removed deprecated `matrix.Norm(int)` method.
112+
113+
### Version 3.1.10 - 2018-03-06
114+
115+
* Rename `CompressedColumnStorage` to `SparseMatrix`.
116+
* BREAKING: `matrix.Multiply(x, y)` overwrites y (instead of update).
117+
* BREAKING: sparse matrix `PermuteColumns` returns a new matrix (instead of update).
118+
119+
### Version 3.1.9 - 2017-01-06
120+
121+
* BREAKING: use static `Create` methods (e.g. `SparseLU.Create(...)`) instead of constructors.
122+
123+
### Version 3.1.4 - 2015-09-19
124+
125+
* Initial release of CSparse.NET (based on Tim Davis CSparse version 3.1.4)

CSparse.Tests/CSparse.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
@@ -41,9 +41,9 @@
4141
</ItemGroup>
4242

4343
<ItemGroup>
44-
<PackageReference Include="NUnit" Version="4.2.2" />
45-
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
46-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
44+
<PackageReference Include="NUnit" Version="4.4.0" />
45+
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
46+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
4747
</ItemGroup>
4848

4949
<ItemGroup>

CSparse.Tests/Complex/Factorization/SparseLUTest.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ namespace CSparse.Tests.Complex.Factorization
33
using CSparse.Complex;
44
using CSparse.Complex.Factorization;
55
using NUnit.Framework;
6+
using System;
67
using Complex = System.Numerics.Complex;
78

89
public class SparseLUTest
@@ -30,6 +31,14 @@ public void TestSolve()
3031
A.Multiply(-1.0, x, 1.0, r);
3132

3233
Assert.That(Vector.Norm(r.Length, r) < EPS, Is.True);
34+
35+
// Test exceptions:
36+
37+
var e1 = Assert.Throws<ArgumentNullException>(() => lu.Solve(b, null));
38+
var e2 = Assert.Throws<ArgumentNullException>(() => lu.Solve(null, x));
39+
40+
Assert.That(e1.ParamName, Is.EqualTo("result"));
41+
Assert.That(e2.ParamName, Is.EqualTo("input"));
3342
}
3443

3544
[Test]

CSparse.Tests/Double/Factorization/SparseLUTest.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ namespace CSparse.Tests.Double.Factorization
33
using CSparse.Double;
44
using CSparse.Double.Factorization;
55
using NUnit.Framework;
6+
using System;
67

78
public class SparseLUTest
89
{
@@ -29,6 +30,14 @@ public void TestSolve()
2930
A.Multiply(-1.0, x, 1.0, r);
3031

3132
Assert.That(Vector.Norm(r.Length, r) < EPS, Is.True);
33+
34+
// Test exceptions:
35+
36+
var e1 = Assert.Throws<ArgumentNullException>(() => lu.Solve(b, null));
37+
var e2 = Assert.Throws<ArgumentNullException>(() => lu.Solve(null, x));
38+
39+
Assert.That(e1.ParamName, Is.EqualTo("result"));
40+
Assert.That(e2.ParamName, Is.EqualTo("input"));
3241
}
3342

3443
[Test]

CSparse.sln

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.31025.194
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36705.20 d17.14
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSparse", "CSparse\CSparse.csproj", "{BE369FD3-02F6-4A13-8DA2-E44A819FAE3C}"
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSparse.Tests", "CSparse.Tests\CSparse.Tests.csproj", "{84D239FA-7BA0-4E5D-89FF-C29C5267CDB0}"
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A01A8F54-DCC1-4E01-B6B4-1C653B382D30}"
1111
ProjectSection(SolutionItems) = preProject
12+
CHANGELOG.md = CHANGELOG.md
1213
README.md = README.md
1314
EndProjectSection
1415
EndProject

CSparse/CSparse.csproj

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,55 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net8.0;net10.0</TargetFrameworks>
55
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
66
<GenerateDocumentationFile>True</GenerateDocumentationFile>
77
<PackageId>CSparse</PackageId>
88
<Summary>A concise library for solving sparse linear systems with direct methods.</Summary>
99
<Description>CSparse.NET provides numerical methods for sparse LU, Cholesky and QR decomposition of real and complex linear systems.</Description>
1010
<Product>CSparse.NET</Product>
1111
<Company />
12-
<Copyright>Copyright Christian Woltering © 2012-2024</Copyright>
12+
<Copyright>Copyright Christian Woltering © 2012-2025</Copyright>
1313
<Authors>Christian Woltering</Authors>
14-
<AssemblyVersion>4.2.0.0</AssemblyVersion>
15-
<FileVersion>4.2.0.0</FileVersion>
14+
<AssemblyVersion>4.3.0.0</AssemblyVersion>
15+
<FileVersion>4.3.0.0</FileVersion>
1616
<PackageTags>math sparse matrix lu cholesky qr decomposition factorization </PackageTags>
17-
<Version>4.2.0</Version>
17+
<Version>4.3.0</Version>
1818
<AssemblyName>CSparse</AssemblyName>
1919
<RootNamespace>CSparse</RootNamespace>
2020
<PackageLicenseExpression>LGPL-2.1-only</PackageLicenseExpression>
2121
<PackageProjectUrl>https://github.com/wo80/CSparse.NET</PackageProjectUrl>
2222
<RepositoryUrl>https://github.com/wo80/CSparse.NET.git</RepositoryUrl>
2323
<RepositoryType>git</RepositoryType>
24-
<PackageReleaseNotes>
25-
Version 4.2.0
24+
<PackageReleaseNotes>Version 4.3.0
2625

27-
* Make SymbolicColumnStorage class public and update StronglyConnectedComponents and DulmageMendelsohn decomposition accordingly.
26+
* Add net10.0 and remove net6.0 target framework.
27+
* Minor optimizations for matrix-vector multiplication.
28+
* Minor optimizations checking empty Span.
2829

29-
Version 4.1.0
30+
Version 4.2.0
3031

31-
* Add overload for creating a sparse matrix from an enumerable of ValueTuple.
32-
* Add matrix EnumerateIndexedAsValueTuples() to enumerate entries as ValueTuple.
32+
* Make SymbolicColumnStorage class public and update StronglyConnectedComponents and DulmageMendelsohn decomposition accordingly.
3333

34-
Version 4.0.0
34+
Version 4.1.0
3535

36-
The major version change is due to the removal of obsolete methods in the Converter class. Visibility of that class was changed from public to internal. In case those obsolete methods were still used, please switch to the static conversion methods provided by the SparseMatrix class.
36+
* Add overload for creating a sparse matrix from an enumerable of ValueTuple.
37+
* Add matrix EnumerateIndexedAsValueTuples() to enumerate entries as ValueTuple.
3738

38-
Other changes in this version:
39+
Version 4.0.0
3940

40-
* Addition of helper method Helper.ValidateStorage(...) to validate the structure of a sparse matrix.
41-
* Update to GetHashCode() method of CompressedColumnStorage class.
42-
* Improvements to documentation.
43-
</PackageReleaseNotes>
41+
The major version change is due to the removal of obsolete methods in the Converter class. Visibility of that class was changed from public to internal. In case those obsolete methods were still used, please switch to the static conversion methods provided by the SparseMatrix class.
42+
43+
Other changes in this version:
44+
45+
* Addition of helper method Helper.ValidateStorage(...) to validate the structure of a sparse matrix.
46+
* Update to GetHashCode() method of CompressedColumnStorage class.
47+
* Improvements to documentation.
48+
</PackageReleaseNotes>
4449
</PropertyGroup>
4550

4651
<ItemGroup>
47-
<PackageReference Include="System.Memory" Version="4.5.5" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
52+
<PackageReference Include="System.Memory" Version="4.6.3" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
4853
</ItemGroup>
4954

5055
<ItemGroup>

CSparse/Complex/Factorization/SparseCholesky.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ public int NonZerosCount
120120
/// <param name="result">The left hand side vector, <c>x</c>.</param>
121121
public void Solve(ReadOnlySpan<Complex> input, Span<Complex> result)
122122
{
123-
if (input == null) throw new ArgumentNullException(nameof(input));
123+
if (input.IsEmpty) throw new ArgumentNullException(nameof(input));
124124

125-
if (result == null) throw new ArgumentNullException(nameof(result));
125+
if (result.IsEmpty) throw new ArgumentNullException(nameof(result));
126126

127127
var x = this.temp;
128128

CSparse/Complex/Factorization/SparseLDL.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ public int NonZerosCount
126126
/// <param name="result">Solution vector x.</param>
127127
public void Solve(ReadOnlySpan<Complex> input, Span<Complex> result)
128128
{
129-
if (input == null) throw new ArgumentNullException(nameof(input));
129+
if (input.IsEmpty) throw new ArgumentNullException(nameof(input));
130130

131-
if (result == null) throw new ArgumentNullException(nameof(result));
131+
if (result.IsEmpty) throw new ArgumentNullException(nameof(result));
132132

133133
var x = temp;
134134

0 commit comments

Comments
 (0)