@@ -7,29 +7,16 @@ namespace CSparse
7
7
/// <summary>
8
8
/// Converter for different types of storages.
9
9
/// </summary>
10
- public static class Converter
10
+ internal static class Converter
11
11
{
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
-
25
12
/// <summary>
26
13
/// Convert a coordinate storage to compressed sparse column (CSC) format.
27
14
/// </summary>
28
15
/// <param name="storage">Coordinate storage.</param>
29
16
/// <param name="cleanup">Remove and sum duplicate entries.</param>
30
17
/// <param name="inplace">Do the conversion in place (re-using the coordinate storage arrays).</param>
31
18
/// <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 ,
33
20
bool cleanup = true , bool inplace = false ) where T : struct , IEquatable < T > , IFormattable
34
21
{
35
22
int nrows = storage . RowCount ;
@@ -110,7 +97,7 @@ internal static CompressedColumnStorage<T> ToCompressedColumnStorage_<T>(Coordin
110
97
/// <remarks>
111
98
/// On return, the coordinate storage input arrays contain the compressed sparse
112
99
/// 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 .
114
101
///
115
102
/// The entries of the output matrix are not sorted (the row indices in each
116
103
/// column are not in increasing order).
@@ -193,15 +180,8 @@ private static void ConvertInPlace<T>(int columns, int nz, T[] values, int[] row
193
180
/// </summary>
194
181
/// <param name="array">2D array storage.</param>
195
182
/// <returns>Coordinate storage.</returns>
196
- [ Obsolete ( "Will be removed in future versions. Use SparseMatrix.OfArray(...) instead." ) ]
197
183
public static CoordinateStorage < T > FromDenseArray < T > ( T [ , ] array )
198
184
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
205
185
{
206
186
int rowCount = array . GetLength ( 0 ) ;
207
187
int columnCount = array . GetLength ( 1 ) ;
@@ -219,48 +199,15 @@ internal static CoordinateStorage<T> FromDenseArray_<T>(T[,] array)
219
199
return storage ;
220
200
}
221
201
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
-
248
202
/// <summary>
249
203
/// Convert a column major array to coordinate storage.
250
204
/// </summary>
251
205
/// <param name="array">Column major array storage.</param>
252
206
/// <param name="rowCount">Number of rows.</param>
253
207
/// <param name="columnCount">Number of columns.</param>
254
208
/// <returns>Coordinate storage.</returns>
255
- [ Obsolete ( "Will be removed in future versions. Use SparseMatrix.OfColumnMajor(...) instead." ) ]
256
209
public static CoordinateStorage < T > FromColumnMajorArray < T > ( T [ ] array , int rowCount , int columnCount )
257
210
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
264
211
{
265
212
var storage = new CoordinateStorage < T > ( rowCount , columnCount , Math . Max ( rowCount , columnCount ) ) ;
266
213
@@ -281,15 +228,8 @@ internal static CoordinateStorage<T> FromColumnMajorArray_<T>(T[] array, int row
281
228
/// <param name="array">jagged array storage.</param>
282
229
/// <returns>Coordinate storage.</returns>
283
230
/// <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." ) ]
285
231
public static CoordinateStorage < T > FromJaggedArray < T > ( T [ ] [ ] array )
286
232
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
293
233
{
294
234
int rowCount = array . Length ;
295
235
int columnCount = array [ 0 ] . Length ;
@@ -314,15 +254,8 @@ internal static CoordinateStorage<T> FromJaggedArray_<T>(T[][] array)
314
254
/// <param name="rowCount">Number of rows.</param>
315
255
/// <param name="columnCount">Number of columns.</param>
316
256
/// <returns>Coordinate storage.</returns>
317
- [ Obsolete ( "Will be removed in future versions. Use SparseMatrix.OfRowMajor(...) instead." ) ]
318
257
public static CoordinateStorage < T > FromRowMajorArray < T > ( T [ ] array , int rowCount , int columnCount )
319
258
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
326
259
{
327
260
var storage = new CoordinateStorage < T > ( rowCount , columnCount , Math . Max ( rowCount , columnCount ) ) ;
328
261
@@ -344,15 +277,8 @@ internal static CoordinateStorage<T> FromRowMajorArray_<T>(T[] array, int rowCou
344
277
/// <param name="rowCount">Number of rows.</param>
345
278
/// <param name="columnCount">Number of columns.</param>
346
279
/// <returns>Coordinate storage.</returns>
347
- [ Obsolete ( "Will be removed in future versions. Use SparseMatrix.OfIndexed(...) instead." ) ]
348
280
public static CoordinateStorage < T > FromEnumerable < T > ( IEnumerable < Tuple < int , int , T > > enumerable , int rowCount , int columnCount )
349
281
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
356
282
{
357
283
var storage = new CoordinateStorage < T > ( rowCount , columnCount , Math . Max ( rowCount , columnCount ) ) ;
358
284
0 commit comments