Search in sources :

Example 16 with LongType

use of net.imglib2.type.numeric.integer.LongType in project imagej-ops by imagej.

the class UnaryRealTypeMathTest method testSinh.

@Test
public void testSinh() {
    final LongType in = new LongType(1234567890);
    final DoubleType out = new DoubleType();
    ops.run(Sinh.class, out, in);
    assertEquals(out.get(), Math.sinh(1234567890), 0.0);
}
Also used : LongType(net.imglib2.type.numeric.integer.LongType) DoubleType(net.imglib2.type.numeric.real.DoubleType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Example 17 with LongType

use of net.imglib2.type.numeric.integer.LongType in project imagej-ops by imagej.

the class UnaryRealTypeMathTest method testFloor.

@Test
public void testFloor() {
    final LongType in = new LongType(LARGE_NUM);
    final LongType out = (LongType) ops.run(Floor.class, in.createVariable(), in);
    assertEquals(out.get(), LARGE_NUM - 1);
}
Also used : Floor(net.imagej.ops.math.UnaryRealTypeMath.Floor) LongType(net.imglib2.type.numeric.integer.LongType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Example 18 with LongType

use of net.imglib2.type.numeric.integer.LongType in project imagej-ops by imagej.

the class UnaryRealTypeMathTest method testExpMinusOne.

@Test
public void testExpMinusOne() {
    final LongType in = new LongType(1234567890);
    final DoubleType out = new DoubleType();
    ops.run(ExpMinusOne.class, out, in);
    assertEquals(out.get(), Math.exp(1234567890) - 1, 0.0);
}
Also used : LongType(net.imglib2.type.numeric.integer.LongType) DoubleType(net.imglib2.type.numeric.real.DoubleType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Example 19 with LongType

use of net.imglib2.type.numeric.integer.LongType in project imagej-ops by imagej.

the class UnaryRealTypeMathTest method testReciprocal.

@Test
public void testReciprocal() {
    final LongType in = new LongType(1234567890);
    final DoubleType out = new DoubleType();
    ops.run(Reciprocal.class, out, in, 0.0);
    assertEquals(out.get(), 1.0 / 1234567890, 0.0);
}
Also used : LongType(net.imglib2.type.numeric.integer.LongType) DoubleType(net.imglib2.type.numeric.real.DoubleType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Example 20 with LongType

use of net.imglib2.type.numeric.integer.LongType in project imagej-ops by imagej.

the class UnaryRealTypeMathTest method testInvert.

@Test
public void testInvert() {
    final LongType in = new LongType(LARGE_NUM);
    final LongType out = (LongType) ops.run(Invert.class, in.createVariable(), in, 9007199254740992.0, 9007199254740994.0);
    assertEquals(out.get(), LARGE_NUM + 1);
}
Also used : Invert(net.imagej.ops.math.UnaryRealTypeMath.Invert) LongType(net.imglib2.type.numeric.integer.LongType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Aggregations

LongType (net.imglib2.type.numeric.integer.LongType)50 AbstractOpTest (net.imagej.ops.AbstractOpTest)48 Test (org.junit.Test)48 DoubleType (net.imglib2.type.numeric.real.DoubleType)37 ArrayList (java.util.ArrayList)1 Abs (net.imagej.ops.math.UnaryRealTypeMath.Abs)1 Ceil (net.imagej.ops.math.UnaryRealTypeMath.Ceil)1 Floor (net.imagej.ops.math.UnaryRealTypeMath.Floor)1 Invert (net.imagej.ops.math.UnaryRealTypeMath.Invert)1 MaxConstant (net.imagej.ops.math.UnaryRealTypeMath.MaxConstant)1 MinConstant (net.imagej.ops.math.UnaryRealTypeMath.MinConstant)1 NearestInt (net.imagej.ops.math.UnaryRealTypeMath.NearestInt)1 Negate (net.imagej.ops.math.UnaryRealTypeMath.Negate)1 Round (net.imagej.ops.math.UnaryRealTypeMath.Round)1 Sqr (net.imagej.ops.math.UnaryRealTypeMath.Sqr)1 LocalThresholdTest (net.imagej.ops.threshold.apply.LocalThresholdTest)1 FinalInterval (net.imglib2.FinalInterval)1 RandomAccessibleInterval (net.imglib2.RandomAccessibleInterval)1 UnsignedLongType (net.imglib2.type.numeric.integer.UnsignedLongType)1