Skip to content

Commit 4c5dede

Browse files
committed
refactor: objects comments
1 parent d587397 commit 4c5dede

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

src/GraphBLAS-sharp.Backend/Objects/Matrix.fs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,34 +113,49 @@ module ClMatrix =
113113

114114
member this.NNZ = this.Values.Length
115115

116+
/// <summary>
117+
/// Represents an abstraction over matrix, whose values and indices are in OpenCL device memory.
118+
/// </summary>
116119
[<RequireQualifiedAccess>]
117120
type ClMatrix<'a when 'a: struct> =
118121
| CSR of ClMatrix.CSR<'a>
119122
| COO of ClMatrix.COO<'a>
120123
| CSC of ClMatrix.CSC<'a>
121124
| LIL of ClMatrix.LIL<'a>
122125

126+
/// <summary>
127+
/// Row count.
128+
/// </summary>
123129
member this.RowCount =
124130
match this with
125131
| ClMatrix.CSR matrix -> matrix.RowCount
126132
| ClMatrix.COO matrix -> matrix.RowCount
127133
| ClMatrix.CSC matrix -> matrix.RowCount
128134
| ClMatrix.LIL matrix -> matrix.RowCount
129135

136+
/// <summary>
137+
/// Column count.
138+
/// </summary>
130139
member this.ColumnCount =
131140
match this with
132141
| ClMatrix.CSR matrix -> matrix.ColumnCount
133142
| ClMatrix.COO matrix -> matrix.ColumnCount
134143
| ClMatrix.CSC matrix -> matrix.ColumnCount
135144
| ClMatrix.LIL matrix -> matrix.ColumnCount
136145

146+
/// <summary>
147+
/// Release resources allocated for the matrix.
148+
/// </summary>
137149
member this.Dispose q =
138150
match this with
139151
| ClMatrix.CSR matrix -> (matrix :> IDeviceMemObject).Dispose q
140152
| ClMatrix.COO matrix -> (matrix :> IDeviceMemObject).Dispose q
141153
| ClMatrix.CSC matrix -> (matrix :> IDeviceMemObject).Dispose q
142154
| ClMatrix.LIL matrix -> (matrix :> IDeviceMemObject).Dispose q
143155

156+
/// <summary>
157+
/// Number of non-zero elements in matrix.
158+
/// </summary>
144159
member this.NNZ =
145160
match this with
146161
| ClMatrix.CSR matrix -> matrix.NNZ

src/GraphBLAS-sharp.Backend/Objects/Vector.fs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,25 @@ module ClVector =
2424

2525
member this.NNZ = this.Values.Length
2626

27+
/// <summary>
28+
/// Represents an abstraction over vector, whose values and indices are in OpenCL device memory.
29+
/// </summary>
2730
[<RequireQualifiedAccess>]
2831
type ClVector<'a when 'a: struct> =
2932
| Sparse of ClVector.Sparse<'a>
3033
| Dense of ClArray<'a option>
34+
35+
/// <summary>
36+
/// Gets the number of elements in vector.
37+
/// </summary>
3138
member this.Size =
3239
match this with
3340
| Sparse vector -> vector.Size
3441
| Dense vector -> vector.Size
3542

43+
/// <summary>
44+
/// Release resources allocated for the matrix.
45+
/// </summary>
3646
member this.Dispose(q) =
3747
match this with
3848
| Sparse vector -> vector.Dispose(q)

0 commit comments

Comments
 (0)