Skip to content

Commit

Permalink
Name the portions of the ValueTuple
Browse files Browse the repository at this point in the history
  • Loading branch information
miniksa committed Jun 11, 2024
1 parent 1b18f0b commit 0e6c53c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CSparse/Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,14 @@ public static CoordinateStorage<T> FromEnumerable<T>(IEnumerable<Tuple<int, int,
/// <param name="rowCount">Number of rows.</param>
/// <param name="columnCount">Number of columns.</param>
/// <returns>Coordinate storage.</returns>
public static CoordinateStorage<T> FromEnumerable<T>(IEnumerable<(int, int, T)> enumerable, int rowCount, int columnCount)
public static CoordinateStorage<T> FromEnumerable<T>(IEnumerable<(int row, int column, T value)> enumerable, int rowCount, int columnCount)
where T : struct, IEquatable<T>, IFormattable
{
var storage = new CoordinateStorage<T>(rowCount, columnCount, Math.Max(rowCount, columnCount));

foreach (var item in enumerable)
{
storage.At(item.Item1, item.Item2, item.Item3);
storage.At(item.row, item.column, item.value);
}

return storage;
Expand Down
2 changes: 1 addition & 1 deletion CSparse/Storage/CompressedColumnStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static CompressedColumnStorage<T> OfIndexed(int rows, int columns, IEnume
/// <summary>
/// Create a new sparse matrix as a copy of the given indexed enumerable using a value tuple.
/// </summary>
public static CompressedColumnStorage<T> OfIndexed(int rows, int columns, IEnumerable<(int, int, T)> enumerable)
public static CompressedColumnStorage<T> OfIndexed(int rows, int columns, IEnumerable<(int row, int column, T value)> enumerable)
{
var c = Converter.FromEnumerable<T>(enumerable, rows, columns);

Expand Down

0 comments on commit 0e6c53c

Please sign in to comment.