|
1 | 1 | namespace GraphBLAS.FSharp |
2 | 2 |
|
3 | | -module MatrixBackend = |
4 | | - type Matrix<'a when 'a : struct and 'a : equality> with |
5 | | - static member Build(denseMatrix: 'T[,], zero: 'T, matrixType: MatrixBackendFormat) : Matrix<'T> = |
6 | | - failwith "Not Implemented" |
7 | | - |
8 | | - static member Build(rowCount: int, columnCount: int, rows: int[], columns: int[], values: 'T[], matrixType: MatrixBackendFormat) : Matrix<'T> = |
9 | | - match matrixType with |
10 | | - | CSR -> upcast CSRMatrix(rows, columns, values) |
11 | | - | COO -> upcast COOMatrix(rowCount, columnCount, rows, columns, values) |
12 | | - | _ -> failwith "Not Implemented" |
13 | | - |
14 | | - static member Build(pathToMatrix: string, matrixType: MatrixBackendFormat) : Matrix<'T> = |
15 | | - failwith "Not Implemented" |
16 | | - |
17 | | - static member Build(rowCount: int, columnCount: int, initializer: int -> int -> 'T, matrixType: MatrixBackendFormat) : Matrix<'T> = |
18 | | - failwith "Not Implemented" |
19 | | - |
20 | | - static member ZeroCreate(rowCount: int, columnCount: int, matrixType: MatrixBackendFormat) : Matrix<'T> = |
21 | | - failwith "Not Implemented" |
22 | | - |
23 | | -[<AutoOpen>] |
24 | | -module MatrixExtensions = |
25 | | - open MatrixBackend |
26 | | - type Matrix<'a when 'a : struct and 'a : equality> with |
27 | | - static member Build(denseMatrix: 'T[,], zero: 'T) : Matrix<'T> = |
28 | | - Matrix.Build(denseMatrix, zero, matrixBackendFormat) |
| 3 | +[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>] |
| 4 | +module Matrix = |
| 5 | + let toSeq (matrix: Matrix<'a>) = failwith "Not Implemented" |
29 | 6 |
|
30 | | - static member Build(rowCount: int, columnCount: int, rows: int[], columns: int[], values: 'T[]) : Matrix<'T> = |
31 | | - Matrix.Build(rowCount, columnCount, rows, columns, values) |
| 7 | + let build (rowCount: int) (columnCount: int) (rows: int[]) (columns: int[]) (values: 'a[]) (matrixType: MatrixBackendFormat) : Matrix<'a> = |
| 8 | + match matrixType with |
| 9 | + | CSR -> upcast CSRMatrix(rows, columns, values) |
| 10 | + | COO -> upcast COOMatrix(rowCount, columnCount, rows, columns, values) |
| 11 | + | _ -> failwith "Not Implemented" |
32 | 12 |
|
33 | | - static member Build(pathToMatrix: string) : Matrix<'T> = |
34 | | - Matrix.Build(pathToMatrix, matrixBackendFormat) |
| 13 | + let ofArray2D (array: 'a[,]) (zero: 'a) (matrixType: MatrixBackendFormat) : Matrix<'a> = |
| 14 | + failwith "Not Implemented yet" |
35 | 15 |
|
36 | | - static member Build(rowCount: int, columnCount: int, initializer: int -> int -> 'T) : Matrix<'T> = |
37 | | - Matrix.Build(rowCount, columnCount, initializer, matrixBackendFormat) |
| 16 | + let fromFile (pathToMatrix: string) (matrixType: MatrixBackendFormat) : Matrix<'a> = |
| 17 | + failwith "Not Implemented yet" |
38 | 18 |
|
39 | | - static member ZeroCreate(rowCount: int, columnCount: int) : Matrix<'T> = |
40 | | - Matrix.ZeroCreate(rowCount, columnCount) |
| 19 | + let init (rowCount: int) (columnCount: int) (initializer: int -> int -> 'a) (matrixType: MatrixBackendFormat) : Matrix<'a> = |
| 20 | + failwith "Not Implemented yet" |
41 | 21 |
|
42 | | -[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>] |
43 | | -module Matrix = |
44 | | - let toSeq (matrix: Matrix<'a>) = failwith "Not Implemented" |
| 22 | + let zeroCreate (rowCount: int) (columnCount: int) (matrixType: MatrixBackendFormat) : Matrix<'a> = |
| 23 | + failwith "Not Implemented yet" |
0 commit comments