@Test public void hasNonZeroEntryInRow() { testTensor1.setEntry(0.5d, 0, 0, 0); testTensor1.setEntry(1.0d, 0, 0, 0); testTensor1.setEntry(2.0d, 1, 0, 1); testTensor1.setEntry(3.0d, 0, 2, 2); testTensor1.setEntry(3.0d, 1, 2, 2); testTensor1.setEntry(4.0d, 3, 3, 2); testTensor1.setEntry(4.0d, 3, 3, 0); Assert.assertTrue(testTensor1.hasNonZeroEntryInRow(0, 0)); Assert.assertTrue(testTensor1.hasNonZeroEntryInRow(1, 1)); Assert.assertTrue(testTensor1.hasNonZeroEntryInRow(0, 2)); Assert.assertTrue(testTensor1.hasNonZeroEntryInRow(1, 2)); Assert.assertTrue(testTensor1.hasNonZeroEntryInRow(3, 2)); Assert.assertTrue(testTensor1.hasNonZeroEntryInRow(3, 0)); Assert.assertFalse(testTensor1.hasNonZeroEntryInRow(0, 1)); Assert.assertFalse(testTensor1.hasNonZeroEntryInRow(1, 0)); Assert.assertFalse(testTensor1.hasNonZeroEntryInRow(1, 0)); Assert.assertFalse(testTensor1.hasNonZeroEntryInRow(2, 0)); Assert.assertFalse(testTensor1.hasNonZeroEntryInRow(2, 1)); Assert.assertFalse(testTensor1.hasNonZeroEntryInRow(2, 2)); }
public boolean hasNonZeroEntryInRow(int x1, int x3) { return (slices.get(x3).getRow(x1).max() > 0.0d); }
ThirdOrderSparseTensor { public boolean hasNonZeroEntryInRow(int x1, int x3) { return (slices.get(x3).getRow(x1).max() > 0.0d); } }
ThirdOrderSparseTensor { public boolean hasNonZeroEntryInRow(int x1, int x3) { return (slices.get(x3).getRow(x1).max() > 0.0d); } ThirdOrderSparseTensor(int dimX1, int dimX2); }
ThirdOrderSparseTensor { public boolean hasNonZeroEntryInRow(int x1, int x3) { return (slices.get(x3).getRow(x1).max() > 0.0d); } ThirdOrderSparseTensor(int dimX1, int dimX2); void resize(int dimX1, int dimX2); void setEntry(double value, int x1, int x2, int x3); double getEntry(int x1, int x2, int x3); int getNonZeroEntries(int dimX3); int[] getDimensions(); void writeSliceToFile(String fileName, int slice); Collection<Integer> getNonZeroIndicesOfRow(int x1, int x3); boolean hasNonZeroEntryInRow(int x1, int x3); }
ThirdOrderSparseTensor { public boolean hasNonZeroEntryInRow(int x1, int x3) { return (slices.get(x3).getRow(x1).max() > 0.0d); } ThirdOrderSparseTensor(int dimX1, int dimX2); void resize(int dimX1, int dimX2); void setEntry(double value, int x1, int x2, int x3); double getEntry(int x1, int x2, int x3); int getNonZeroEntries(int dimX3); int[] getDimensions(); void writeSliceToFile(String fileName, int slice); Collection<Integer> getNonZeroIndicesOfRow(int x1, int x3); boolean hasNonZeroEntryInRow(int x1, int x3);  }