2626import org .apache .sysds .hops .estim .EstimatorBasicWorst ;
2727import org .apache .sysds .hops .estim .EstimatorBitsetMM ;
2828import org .apache .sysds .hops .estim .EstimatorLayeredGraph ;
29+ import org .apache .sysds .hops .estim .EstimatorRowWise ;
2930import org .apache .sysds .hops .estim .SparsityEstimator ;
3031import org .apache .sysds .hops .estim .SparsityEstimator .OpCode ;
3132import org .apache .sysds .runtime .matrix .data .MatrixBlock ;
@@ -40,7 +41,7 @@ public class OpSingleTest extends AutomatedTestBase
4041 private final static int m = 600 ;
4142 private final static int k = 300 ;
4243 private final static double sparsity = 0.2 ;
43- // private final static OpCode eqzero = OpCode.EQZERO;
44+ // private final static OpCode eqzero = OpCode.EQZERO;
4445 private final static OpCode diag = OpCode .DIAG ;
4546 private final static OpCode neqzero = OpCode .NEQZERO ;
4647 private final static OpCode trans = OpCode .TRANS ;
@@ -237,7 +238,33 @@ public void testLGCasetrans() {
237238// public void testSampleCasereshape() {
238239// runSparsityEstimateTest(new EstimatorSample(), m, k, sparsity, reshape);
239240// }
240-
241+
242+ // Row Wise Sparsity Estimator
243+ // @Test
244+ // public void testRowWiseEqzero() {
245+ // runSparsityEstimateTest(new EstimatorRowWise(), m, k, sparsity, eqzero);
246+ // }
247+
248+ // @Test
249+ // public void testRowWiseDiag() {
250+ // runSparsityEstimateTest(new EstimatorRowWise(), m, m, sparsity, diag);
251+ // }
252+
253+ @ Test
254+ public void testRowWiseNeqzero () {
255+ runSparsityEstimateTest (new EstimatorRowWise (), m , k , sparsity , neqzero );
256+ }
257+
258+ @ Test
259+ public void testRowWiseTrans () {
260+ runSparsityEstimateTest (new EstimatorRowWise (), m , k , sparsity , trans );
261+ }
262+
263+ @ Test
264+ public void testRowWiseReshape () {
265+ runSparsityEstimateTest (new EstimatorRowWise (), m , k , sparsity , reshape );
266+ }
267+
241268 private static void runSparsityEstimateTest (SparsityEstimator estim , int m , int k , double sp , OpCode op ) {
242269 MatrixBlock m1 = MatrixBlock .randOperations (m , k , sp , 1 , 1 , "uniform" , 3 );
243270 MatrixBlock m2 = new MatrixBlock ();
@@ -252,13 +279,7 @@ private static void runSparsityEstimateTest(SparsityEstimator estim, int m, int
252279 est = estim .estim (m1 , op );
253280 break ;
254281 case NEQZERO :
255- m2 = m1 ;
256- est = estim .estim (m1 , op );
257- break ;
258282 case TRANS :
259- m2 = m1 ;
260- est = estim .estim (m1 , op );
261- break ;
262283 case RESHAPE :
263284 m2 = m1 ;
264285 est = estim .estim (m1 , op );
0 commit comments