@@ -565,6 +565,17 @@ public Matrix<T> DenseOfIndexed(int rows, int columns, IEnumerable<Tuple<int, in
565565 return Dense ( DenseColumnMajorMatrixStorage < T > . OfIndexedEnumerable ( rows , columns , enumerable ) ) ;
566566 }
567567
568+ /// <summary>
569+ /// Create a new dense matrix as a copy of the given indexed enumerable.
570+ /// Keys must be provided at most once, zero is assumed if a key is omitted.
571+ /// This new matrix will be independent from the enumerable.
572+ /// A new memory block will be allocated for storing the matrix.
573+ /// </summary>
574+ public Matrix < T > DenseOfIndexed ( int rows , int columns , IEnumerable < ( int , int , T ) > enumerable )
575+ {
576+ return Dense ( DenseColumnMajorMatrixStorage < T > . OfIndexedEnumerable ( rows , columns , enumerable ) ) ;
577+ }
578+
568579 /// <summary>
569580 /// Create a new dense matrix as a copy of the given enumerable.
570581 /// The enumerable is assumed to be in column-major order (column by column).
@@ -911,6 +922,17 @@ public Matrix<T> SparseOfIndexed(int rows, int columns, IEnumerable<Tuple<int, i
911922 return Sparse ( SparseCompressedRowMatrixStorage < T > . OfIndexedEnumerable ( rows , columns , enumerable ) ) ;
912923 }
913924
925+ /// <summary>
926+ /// Create a new sparse matrix as a copy of the given indexed enumerable.
927+ /// Keys must be provided at most once, zero is assumed if a key is omitted.
928+ /// This new matrix will be independent from the enumerable.
929+ /// A new memory block will be allocated for storing the matrix.
930+ /// </summary>
931+ public Matrix < T > SparseOfIndexed ( int rows , int columns , IEnumerable < ( int , int , T ) > enumerable )
932+ {
933+ return Sparse ( SparseCompressedRowMatrixStorage < T > . OfIndexedEnumerable ( rows , columns , enumerable ) ) ;
934+ }
935+
914936 /// <summary>
915937 /// Create a new sparse matrix as a copy of the given enumerable.
916938 /// The enumerable is assumed to be in row-major order (row by row).
@@ -1537,6 +1559,17 @@ public Vector<T> DenseOfIndexed(int length, IEnumerable<Tuple<int, T>> enumerabl
15371559 return Dense ( DenseVectorStorage < T > . OfIndexedEnumerable ( length , enumerable ) ) ;
15381560 }
15391561
1562+ /// <summary>
1563+ /// Create a new dense vector as a copy of the given indexed enumerable.
1564+ /// Keys must be provided at most once, zero is assumed if a key is omitted.
1565+ /// This new vector will be independent from the enumerable.
1566+ /// A new memory block will be allocated for storing the vector.
1567+ /// </summary>
1568+ public Vector < T > DenseOfIndexed ( int length , IEnumerable < ( int , T ) > enumerable )
1569+ {
1570+ return Dense ( DenseVectorStorage < T > . OfIndexedEnumerable ( length , enumerable ) ) ;
1571+ }
1572+
15401573 /// <summary>
15411574 /// Create a new sparse vector straight from an initialized vector storage instance.
15421575 /// The storage is used directly without copying.
@@ -1611,6 +1644,17 @@ public Vector<T> SparseOfIndexed(int length, IEnumerable<Tuple<int, T>> enumerab
16111644 {
16121645 return Sparse ( SparseVectorStorage < T > . OfIndexedEnumerable ( length , enumerable ) ) ;
16131646 }
1647+
1648+ /// <summary>
1649+ /// Create a new sparse vector as a copy of the given indexed enumerable.
1650+ /// Keys must be provided at most once, zero is assumed if a key is omitted.
1651+ /// This new vector will be independent from the enumerable.
1652+ /// A new memory block will be allocated for storing the vector.
1653+ /// </summary>
1654+ public Vector < T > SparseOfIndexed ( int length , IEnumerable < ( int , T ) > enumerable )
1655+ {
1656+ return Sparse ( SparseVectorStorage < T > . OfIndexedEnumerable ( length , enumerable ) ) ;
1657+ }
16141658 }
16151659
16161660 internal static class BuilderInstance < T > where T : struct , IEquatable < T > , IFormattable
0 commit comments