@@ -29,7 +29,7 @@ type CSRMatrix<'a when 'a : struct and 'a : equality>(csrTuples: CSRFormat<'a>)
2929 let rowCount = base .RowCount
3030 let columnCount = base .ColumnCount
3131
32- let spMV ( vector : Vector < 'a >) ( mask : Mask1D ) ( semiring : Semiring < 'a >) : Vector < 'a > =
32+ let spMV ( vector : DenseVector < 'a >) ( mask : Mask1D ) ( semiring : Semiring < 'a >) : Vector < 'a > =
3333 let csrMatrixRowCount = rowCount
3434 let csrMatrixColumnCount = columnCount
3535 let vectorLength = vector.Length
@@ -67,7 +67,7 @@ type CSRMatrix<'a when 'a : struct and 'a : equality>(csrTuples: CSRFormat<'a>)
6767 csrTuples.Values
6868 csrTuples.Columns
6969 csrTuples.RowPointers
70- vector.AsArray
70+ vector.Values
7171
7272 let eval = opencl {
7373 do ! RunCommand command binder
@@ -76,81 +76,77 @@ type CSRMatrix<'a when 'a : struct and 'a : equality>(csrTuples: CSRFormat<'a>)
7676
7777 upcast DenseVector( oclContext.RunSync eval, semiring.PlusMonoid)
7878
79+ new ( rows: int[], columns: int[], values: 'a[]) = CSRMatrix( CSRFormat.CreateEmpty())
80+
7981 member this.Values = csrTuples.Values
8082 member this.Columns = csrTuples.Columns
8183 member this.RowPointers = csrTuples.RowPointers
8284
83- override this.Mask = failwith " Not implemented"
84- override this.Complemented = failwith " Not implemented"
85-
86- override this.Item
87- with get ( mask : Mask2D option ) : Matrix < 'a > = failwith " Not Implemented"
88- and set ( mask : Mask2D option ) ( value : Matrix < 'a >) = failwith " Not Implemented"
89- override this.Item
90- with get ( vectorMask : Mask1D option , colIdx : int ) : Vector < 'a > = failwith " Not Implemented"
91- and set ( vectorMask : Mask1D option , colIdx : int ) ( value : Vector < 'a >) = failwith " Not Implemented"
92- override this.Item
93- with get ( rowIdx : int , vectorMask : Mask1D option ) : Vector < 'a > = failwith " Not Implemented"
94- and set ( rowIdx : int , vectorMask : Mask1D option ) ( value : Vector < 'a >) = failwith " Not Implemented"
95- override this.Item
96- with get ( rowIdx : int , colIdx : int ) : Scalar < 'a > = failwith " Not Implemented"
97- and set ( rowIdx : int , colIdx : int ) ( value : Scalar < 'a >) = failwith " Not Implemented"
98- override this.Fill
99- with set ( mask : Mask2D option ) ( value : Scalar < 'a >) = failwith " Not Implemented"
100- override this.Fill
101- with set ( vectorMask : Mask1D option , colIdx : int ) ( value : Scalar < 'a >) = failwith " Not Implemented"
102- override this.Fill
103- with set ( rowIdx : int , vectorMask : Mask1D option ) ( value : Scalar < 'a >) = failwith " Not Implemented"
85+ override this.Extract ( mask : Mask2D option ) : Matrix < 'a > = failwith " Not Implemented"
86+ override this.Extract ( colMask : Mask1D option * int ) : Vector < 'a > = failwith " Not Implemented"
87+ override this.Extract ( rowMask : int * Mask1D option ) : Vector < 'a > = failwith " Not Implemented"
88+ override this.Extract ( idx : int * int ) : Scalar < 'a > = failwith " Not Implemented"
89+ override this.Assign ( mask : Mask2D option , value : Matrix < 'a >) : unit = failwith " Not Implemented"
90+ override this.Assign ( colMask : Mask1D option * int , value : Vector < 'a >) : unit = failwith " Not Implemented"
91+ override this.Assign ( rowMask : int * Mask1D option , value : Vector < 'a >) : unit = failwith " Not Implemented"
92+ override this.Assign ( idx : int * int , value : Scalar < 'a >) : unit = failwith " Not Implemented"
93+ override this.Assign ( mask : Mask2D option , value : Scalar < 'a >) : unit = failwith " Not Implemented"
94+ override this.Assign ( colMask : Mask1D option * int , value : Scalar < 'a >) : unit = failwith " Not Implemented"
95+ override this.Assign ( rowMask : int * Mask1D option , value : Scalar < 'a >) : unit = failwith " Not Implemented"
10496
10597 override this.Mxm a b c = failwith " Not Implemented"
10698 override this.Mxv a b c = failwith " Not Implemented"
10799 override this.EWiseAdd a b c = failwith " Not Implemented"
108100 override this.EWiseMult a b c = failwith " Not Implemented"
109101 override this.Apply a b = failwith " Not Implemented"
102+ override this.Prune a b = failwith " Not Implemented"
110103 override this.ReduceIn a b = failwith " Not Implemented"
111104 override this.ReduceOut a b = failwith " Not Implemented"
112105 override this.Reduce a = failwith " Not Implemented"
113106 override this.T = failwith " Not Implemented"
114107
108+ override this.Mask = failwith " Not implemented"
109+ override this.Complemented = failwith " Not implemented"
110+
115111and SparseVector < 'a when 'a : struct and 'a : equality >( size : int , listOfNonzeroes : ( int * 'a ) list ) =
116112 inherit Vector< 'a>( size)
117113
118- member this.AsList : ( int * 'a ) list = listOfNonzeroes
119-
120- override this.AsArray = failwith " Not Implemented"
121114 override this.Clear () = failwith " Not Implemented"
122-
123- override this.Mask = failwith " Not implemented"
124- override this.Complemented = failwith " Not implemented"
125-
126- override this.Item
127- with get ( mask : Mask1D option ) : Vector < 'a > = failwith " Not Implemented"
128- and set ( mask : Mask1D option ) ( value : Vector < 'a >) = failwith " Not Implemented"
129- override this.Item
130- with get ( idx : int ) : Scalar < 'a > = failwith " Not Implemented"
131- and set ( idx : int ) ( value : Scalar < 'a >) = failwith " Not Implemented"
132- override this.Fill
133- with set ( mask : Mask1D option ) ( value : Scalar < 'a >) = failwith " Not Implemented"
115+ override this.Extract ( mask : Mask1D option ) : Vector < 'a > = failwith " Not Implemented"
116+ override this.Extract ( idx : int ) : Scalar < 'a > = failwith " Not Implemented"
117+ override this.Assign ( mask : Mask1D option , vector : Vector < 'a >) : unit = failwith " Not Implemented"
118+ override this.Assign ( idx : int , Scalar ( value : 'a )) : unit = failwith " Not Implemented"
119+ override this.Assign ( mask : Mask1D option , Scalar ( value : 'a )) : unit = failwith " Not Implemented"
134120
135121 override this.Vxm ( matrix : Matrix < 'a >) ( mask : Mask1D option ) ( semiring : Semiring < 'a >) : Vector < 'a > = failwith " Not Implemented"
136122 override this.EWiseAdd a b c = failwith " Not Implemented"
137123 override this.EWiseMult a b c = failwith " Not Implemented"
138124 override this.Apply a b = failwith " Not Implemented"
125+ override this.Prune a b = failwith " Not Implemented"
139126 override this.Reduce ( monoid : Monoid < 'a >) = failwith " Not Implemented"
140127
128+ override this.Mask = failwith " Not implemented"
129+ override this.Complemented = failwith " Not implemented"
130+
141131and DenseVector < 'a when 'a : struct and 'a : equality >( vector : 'a [], monoid : Monoid < 'a >) =
142132 inherit Vector< 'a>( vector.Length)
143133
144- // Not Implemented
145- new ( monoid: Monoid< 'a>) = DenseVector( Array.zeroCreate< 'a> 0 , monoid)
146- // Not Implemented
147- new ( listOfIndices: int list, monoid: Monoid< 'a>) = DenseVector( Array.zeroCreate< 'a> 0 , monoid)
148-
149134 member this.Monoid = monoid
150- member this.Values = vector
135+ member this.Values : 'a [] = vector
151136
152- override this.AsArray = failwith " Not Implemented"
153137 override this.Clear () = failwith " Not Implemented"
138+ override this.Extract ( mask : Mask1D option ) : Vector < 'a > = failwith " Not Implemented"
139+ override this.Extract ( idx : int ) : Scalar < 'a > = failwith " Not Implemented"
140+ override this.Assign ( mask : Mask1D option , vector : Vector < 'a >) : unit = failwith " Not Implemented"
141+ override this.Assign ( idx : int , Scalar ( value : 'a )) : unit = failwith " Not Implemented"
142+ override this.Assign ( mask : Mask1D option , Scalar ( value : 'a )) : unit = failwith " Not Implemented"
143+
144+ override this.Vxm a b c = failwith " Not Implemented"
145+ override this.EWiseAdd a b c = failwith " Not Implemented"
146+ override this.EWiseMult a b c = failwith " Not Implemented"
147+ override this.Apply a b = failwith " Not Implemented"
148+ override this.Prune a b = failwith " Not Implemented"
149+ override this.Reduce ( monoid : Monoid < 'a >) = failwith " Not Implemented"
154150
155151 override this.Mask =
156152 let indices =
@@ -163,18 +159,3 @@ and DenseVector<'a when 'a : struct and 'a : equality>(vector: 'a[], monoid: Mon
163159 [| for i in 0 .. this.Length - 1 do
164160 if this.Values.[ i] <> this.Monoid.Zero then yield i |]
165161 Some <| Mask1D( indices, this.Length, true )
166-
167- override this.Item
168- with get ( mask : Mask1D option ) : Vector < 'a > = failwith " Not Implemented"
169- and set ( mask : Mask1D option ) ( value : Vector < 'a >) = failwith " Not Implemented"
170- override this.Item
171- with get ( idx : int ) : Scalar < 'a > = failwith " Not Implemented"
172- and set ( idx : int ) ( value : Scalar < 'a >) = failwith " Not Implemented"
173- override this.Fill
174- with set ( mask : Mask1D option ) ( value : Scalar < 'a >) = failwith " Not Implemented"
175-
176- override this.Vxm a b c = failwith " Not Implemented"
177- override this.EWiseAdd a b c = failwith " Not Implemented"
178- override this.EWiseMult a b c = failwith " Not Implemented"
179- override this.Apply a b = failwith " Not Implemented"
180- override this.Reduce ( monoid : Monoid < 'a >) = failwith " Not Implemented"
0 commit comments