Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void getLowerBoundIndexTest()
        public virtual void getLowerBoundIndexTest()
        {
            int i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-2.0, -1.0), -0.0);

            assertEquals(i, 1);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(1.0, 2.0), -0.0);
            assertEquals(i, 0);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(1.0, 2.0, 3.0), 2.5);
            assertEquals(i, 1);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(1.0, 2.0, 3.0), 2.0);
            assertEquals(i, 1);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(1.0, 2.0, 3.0), -2.0);
            assertEquals(i, 0);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-2.0, -1.0, 0.0), -0.0);
            assertEquals(i, 2);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-2.0, -1.0, 0.0), 0.0);
            assertEquals(i, 2);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-2.0, -1.0, 0.0), -0.0);
            assertEquals(i, 2);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-2.0, -1.0, -0.0), -0.0);
            assertEquals(i, 2);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-1.0, 0.0, 1.0), -0.0);
            assertEquals(i, 1);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-1.0, 0.0, 1.0), 0.0);
            assertEquals(i, 1);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-1.0, -0.0, 1.0), 0.0);
            assertEquals(i, 1);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-1.0, -0.0, 1.0), -0.0);
            assertEquals(i, 1);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(0.0, 1.0, 2.0), -0.0);
            assertEquals(i, 0);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(0.0, 1.0, 2.0), 0.0);
            assertEquals(i, 0);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-0.0, 1.0, 2.0), 0.0);
            assertEquals(i, 0);
            i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-0.0, 1.0, 2.0), -0.0);
            assertEquals(i, 0);
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expectedExceptions = IllegalArgumentException.class) public void testNullDimensions2()
        public virtual void testNullDimensions2()
        {
            FunctionUtils.fromTensorIndex(2, null);
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expectedExceptions = IllegalArgumentException.class) public void testWrongLength()
        public virtual void testWrongLength()
        {
            FunctionUtils.toTensorIndex(new int[] { 1, 2 }, new int[] { 1, 2, 3 });
        }
Ejemplo n.º 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expectedExceptions = IllegalArgumentException.class) public void testNullDimensions1()
        public virtual void testNullDimensions1()
        {
            FunctionUtils.toTensorIndex(new int[] { 1, 2, 3 }, null);
        }
Ejemplo n.º 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expectedExceptions = IllegalArgumentException.class) public void testNullIndices()
        public virtual void testNullIndices()
        {
            FunctionUtils.toTensorIndex(null, new int[] { 1, 2, 3 });
        }