COO operations#4
Conversation
…matrix and vector reducing
…ite scalar. Added transpose for matrix in coordinate format. Changed matrix representation to class
| @@ -0,0 +1,14 @@ | |||
| namespace GraphBLAS.FSharp | |||
|
|
|||
| type COORegularMask2D(rows: array<int>, columns: array<int>, rowCount: int, columnCount: int) = | |||
There was a problem hiding this comment.
According to the F# style guide, int[] is preferred rather than int array or array<int>.
There was a problem hiding this comment.
Can we add lint tool to automate code style checking?
| abstract Item: Mask2D<'a> -> Matrix<'a> with get, set | ||
| abstract Item: Mask1D<'a> * int -> Vector<'a> with get, set | ||
| abstract Item: int * Mask1D<'a> -> Vector<'a> with get, set | ||
| abstract Item: Mask2D -> Matrix<'a> with get, set |
There was a problem hiding this comment.
Mask is an optional parameter (Some or None), so we need to use Mask2D option instead of simple Mask2D
|
|
||
| let matrixColumnCount = matrix.ColumnCount | ||
|
|
||
| let plus = !> semiring.PlusMonoid.Append |
There was a problem hiding this comment.
Here we can use single case DU deconstruction like this let (BinaryOp plus) = context.PlusMonoid.Append
| type COOVector<'a when 'a : struct and 'a : equality>(dyads: array<'a * int>, length: int) = | ||
| inherit Vector<'a>() | ||
|
|
||
| let mutable dyads = Array.distinct dyads |
There was a problem hiding this comment.
In GraphBLAS API there is an additional parameter dup, which responsible for processing duplicates in input pairs.
| // | Complemented2D of Matrix<'a> | ||
| // | None | ||
|
|
||
| and [<AbstractClass>] Mask1D() = |
There was a problem hiding this comment.
Why should these classes be abstract? I thought we were going to represent a single implementation for the mask, and it would be based on different implementations of the sparse matrix and vector. So, it seems to me, that using a mask should look like this: currentVisited.VxmInplace matrix (Mask1D levels) BooleanSemiring.OrAnd. This question requires discussion. Ultimately, in C API the raw matrix or vector is passed to the operations as mask.
There was a problem hiding this comment.
If we will only use sparse representations of the matrix and the vector (or the dense representation of the vector, but with an explicit indication of the semiring inside), will there be problems with the implementation of the mask as DU? (Except for the inability to overload indexers).
| @@ -0,0 +1,14 @@ | |||
| namespace GraphBLAS.FSharp | |||
|
|
|||
| type COORegularMask2D(rows: array<int>, columns: array<int>, rowCount: int, columnCount: int) = | |||
There was a problem hiding this comment.
Can we add lint tool to automate code style checking?
| @@ -0,0 +1,113 @@ | |||
| namespace GraphBLAS.FSharp | |||
There was a problem hiding this comment.
Why CSR matrix and related stuff are also added in this PR? Looks like it is a reason of the merge conflict.
There was a problem hiding this comment.
I guess you should pull the current master to your branch first.
There was a problem hiding this comment.
That stuff is added because it uses entity that I changed (mask). I had to correct this files to avoid problems with them. But to be honest I can't understand why these corrections are recognized as conflicts, I'll try to pull master
…tion Coo element wise addition optimization
Proposed Changes
Added matrix in COO format and sparse vector. Changed mask representation into class, added regular one- and two-dimensional masks in COO format.
Types of changes
Checklist
Further comments