@@ -7,29 +7,16 @@ namespace CSparse
77 /// <summary>
88 /// Converter for different types of storages.
99 /// </summary>
10- public static class Converter
10+ internal static class Converter
1111 {
12- /// <summary>
13- /// Convert a coordinate storage to compressed sparse column (CSC) format.
14- /// </summary>
15- /// <param name="storage">Coordinate storage.</param>
16- /// <param name="cleanup">Remove and sum duplicate entries.</param>
17- /// <returns>Compressed sparse column storage.</returns>
18- [ Obsolete ( "Will be removed in future versions. Use SparseMatrix.OfIndexed(...) instead." ) ]
19- public static CompressedColumnStorage < T > ToCompressedColumnStorage < T > ( CoordinateStorage < T > storage ,
20- bool cleanup = true ) where T : struct , IEquatable < T > , IFormattable
21- {
22- return ToCompressedColumnStorage_ ( storage , cleanup ) ;
23- }
24-
2512 /// <summary>
2613 /// Convert a coordinate storage to compressed sparse column (CSC) format.
2714 /// </summary>
2815 /// <param name="storage">Coordinate storage.</param>
2916 /// <param name="cleanup">Remove and sum duplicate entries.</param>
3017 /// <param name="inplace">Do the conversion in place (re-using the coordinate storage arrays).</param>
3118 /// <returns>Compressed sparse column storage.</returns>
32- internal static CompressedColumnStorage < T > ToCompressedColumnStorage_ < T > ( CoordinateStorage < T > storage ,
19+ public static CompressedColumnStorage < T > ToCompressedColumnStorage < T > ( CoordinateStorage < T > storage ,
3320 bool cleanup = true , bool inplace = false ) where T : struct , IEquatable < T > , IFormattable
3421 {
3522 int nrows = storage . RowCount ;
@@ -110,7 +97,7 @@ internal static CompressedColumnStorage<T> ToCompressedColumnStorage_<T>(Coordin
11097 /// <remarks>
11198 /// On return, the coordinate storage input arrays contain the compressed sparse
11299 /// column data structure for the resulting matrix. The <paramref name="work"/>
113- /// array contains a copy of the column pointer .
100+ /// array contains a copy of the column pointers .
114101 ///
115102 /// The entries of the output matrix are not sorted (the row indices in each
116103 /// column are not in increasing order).
@@ -193,15 +180,8 @@ private static void ConvertInPlace<T>(int columns, int nz, T[] values, int[] row
193180 /// </summary>
194181 /// <param name="array">2D array storage.</param>
195182 /// <returns>Coordinate storage.</returns>
196- [ Obsolete ( "Will be removed in future versions. Use SparseMatrix.OfArray(...) instead." ) ]
197183 public static CoordinateStorage < T > FromDenseArray < T > ( T [ , ] array )
198184 where T : struct , IEquatable < T > , IFormattable
199- {
200- return FromDenseArray_ ( array ) ;
201- }
202-
203- internal static CoordinateStorage < T > FromDenseArray_ < T > ( T [ , ] array )
204- where T : struct , IEquatable < T > , IFormattable
205185 {
206186 int rowCount = array . GetLength ( 0 ) ;
207187 int columnCount = array . GetLength ( 1 ) ;
@@ -219,48 +199,15 @@ internal static CoordinateStorage<T> FromDenseArray_<T>(T[,] array)
219199 return storage ;
220200 }
221201
222- /// <summary>
223- /// Convert a jagged array to compressed sparse column (CSC) format.
224- /// </summary>
225- /// <param name="array">Jagged array storage.</param>
226- /// <returns>Compressed sparse column storage.</returns>
227- [ Obsolete ( "Will be removed in future versions. Use SparseMatrix.OfJaggedArray(...) instead." ) ]
228- public static CompressedColumnStorage < T > ToCompressedColumnStorage < T > ( T [ ] [ ] array )
229- where T : struct , IEquatable < T > , IFormattable
230- {
231- int nrows = array . Length ;
232- int ncols = array [ 0 ] . Length ;
233-
234- var storage = new CoordinateStorage < T > ( nrows , ncols , nrows ) ;
235-
236- for ( int i = 0 ; i < nrows ; i ++ )
237- {
238- for ( int j = 0 ; j < ncols ; j ++ )
239- {
240- storage . At ( i , j , array [ i ] [ j ] ) ;
241- }
242- }
243-
244- return ToCompressedColumnStorage_ < T > ( storage , false ) ;
245- }
246-
247-
248202 /// <summary>
249203 /// Convert a column major array to coordinate storage.
250204 /// </summary>
251205 /// <param name="array">Column major array storage.</param>
252206 /// <param name="rowCount">Number of rows.</param>
253207 /// <param name="columnCount">Number of columns.</param>
254208 /// <returns>Coordinate storage.</returns>
255- [ Obsolete ( "Will be removed in future versions. Use SparseMatrix.OfColumnMajor(...) instead." ) ]
256209 public static CoordinateStorage < T > FromColumnMajorArray < T > ( T [ ] array , int rowCount , int columnCount )
257210 where T : struct , IEquatable < T > , IFormattable
258- {
259- return FromColumnMajorArray_ ( array , rowCount , columnCount ) ;
260- }
261-
262- internal static CoordinateStorage < T > FromColumnMajorArray_ < T > ( T [ ] array , int rowCount , int columnCount )
263- where T : struct , IEquatable < T > , IFormattable
264211 {
265212 var storage = new CoordinateStorage < T > ( rowCount , columnCount , Math . Max ( rowCount , columnCount ) ) ;
266213
@@ -281,15 +228,8 @@ internal static CoordinateStorage<T> FromColumnMajorArray_<T>(T[] array, int row
281228 /// <param name="array">jagged array storage.</param>
282229 /// <returns>Coordinate storage.</returns>
283230 /// <remarks>All rows of the array are assumed to be equal in length</remarks>
284- [ Obsolete ( "Will be removed in future versions. Use SparseMatrix.OfColumnMajor(...) instead." ) ]
285231 public static CoordinateStorage < T > FromJaggedArray < T > ( T [ ] [ ] array )
286232 where T : struct , IEquatable < T > , IFormattable
287- {
288- return FromJaggedArray_ ( array ) ;
289- }
290-
291- internal static CoordinateStorage < T > FromJaggedArray_ < T > ( T [ ] [ ] array )
292- where T : struct , IEquatable < T > , IFormattable
293233 {
294234 int rowCount = array . Length ;
295235 int columnCount = array [ 0 ] . Length ;
@@ -314,15 +254,8 @@ internal static CoordinateStorage<T> FromJaggedArray_<T>(T[][] array)
314254 /// <param name="rowCount">Number of rows.</param>
315255 /// <param name="columnCount">Number of columns.</param>
316256 /// <returns>Coordinate storage.</returns>
317- [ Obsolete ( "Will be removed in future versions. Use SparseMatrix.OfRowMajor(...) instead." ) ]
318257 public static CoordinateStorage < T > FromRowMajorArray < T > ( T [ ] array , int rowCount , int columnCount )
319258 where T : struct , IEquatable < T > , IFormattable
320- {
321- return FromRowMajorArray_ ( array , rowCount , columnCount ) ;
322- }
323-
324- internal static CoordinateStorage < T > FromRowMajorArray_ < T > ( T [ ] array , int rowCount , int columnCount )
325- where T : struct , IEquatable < T > , IFormattable
326259 {
327260 var storage = new CoordinateStorage < T > ( rowCount , columnCount , Math . Max ( rowCount , columnCount ) ) ;
328261
@@ -344,15 +277,8 @@ internal static CoordinateStorage<T> FromRowMajorArray_<T>(T[] array, int rowCou
344277 /// <param name="rowCount">Number of rows.</param>
345278 /// <param name="columnCount">Number of columns.</param>
346279 /// <returns>Coordinate storage.</returns>
347- [ Obsolete ( "Will be removed in future versions. Use SparseMatrix.OfIndexed(...) instead." ) ]
348280 public static CoordinateStorage < T > FromEnumerable < T > ( IEnumerable < Tuple < int , int , T > > enumerable , int rowCount , int columnCount )
349281 where T : struct , IEquatable < T > , IFormattable
350- {
351- return FromEnumerable_ ( enumerable , rowCount , columnCount ) ;
352- }
353-
354- internal static CoordinateStorage < T > FromEnumerable_ < T > ( IEnumerable < Tuple < int , int , T > > enumerable , int rowCount , int columnCount )
355- where T : struct , IEquatable < T > , IFormattable
356282 {
357283 var storage = new CoordinateStorage < T > ( rowCount , columnCount , Math . Max ( rowCount , columnCount ) ) ;
358284
0 commit comments