Class UnsignedLongType
java.lang.Object
net.imglib2.type.numeric.complex.AbstractComplexType<UnsignedLongType>
net.imglib2.type.numeric.real.AbstractRealType<UnsignedLongType>
net.imglib2.type.numeric.integer.AbstractIntegerType<UnsignedLongType>
net.imglib2.type.numeric.integer.GenericLongType<UnsignedLongType>
net.imglib2.type.numeric.integer.UnsignedLongType
- All Implemented Interfaces:
Comparable<UnsignedLongType>, NativeType<UnsignedLongType>, ComplexType<UnsignedLongType>, IntegerType<UnsignedLongType>, NumericType<UnsignedLongType>, RealType<UnsignedLongType>, Add<UnsignedLongType>, Div<UnsignedLongType>, Mul<UnsignedLongType>, MulFloatingPoint, Pow<UnsignedLongType>, PowFloatingPoint, SetOne, SetZero, Sub<UnsignedLongType>, ValueEquals<UnsignedLongType>, Type<UnsignedLongType>
- Direct Known Subclasses:
VolatileUnsignedLongType.WrappedUnsignedLongType
TODO
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final doubleprivate static final doubleprivate static final NativeTypeFactory<UnsignedLongType, LongAccess> Fields inherited from class GenericLongType
dataAccess, i, img -
Constructor Summary
ConstructorsConstructorDescriptionUnsignedLongType(long value) UnsignedLongType(BigInteger value) UnsignedLongType(LongAccess access) UnsignedLongType(NativeImg<?, ? extends LongAccess> img) -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic final intcompare(long a, long b) Deprecated.intcompareTo(UnsignedLongType other) copy()Creates a newTypevariable which can only store one value.voiddec()voidstatic final longdivide(long d1, long d2) Unsigned division ofd1byd2.(package private) static longdoubleToUnsignedLong(double real) Creates a newNativeTypewhich stores in the same physical array.longget()This method returns the value of the UnsignedLongType as a signed long.This method returns the unsigned representation of this UnsignedLongType as aBigInteger.intlongReturns the true maximum value as a BigInteger, since it cannot be precisely represented as adouble.doubleThe maximum value that can be stored isMath.pow( 2, 64 ) - 1, which can't be represented with exact precision using a doubledoubledoublefloatvoidinc()voidmul(double c) voidmul(float c) voidvoidset(long value) voidset(BigInteger bi) voidvoidsetInteger(int f) voidsetInteger(long f) voidsetOne()voidsetReal(double real) voidsetReal(float real) voidsetZero()voidtoString()(package private) static doubleunsignedLongToDouble(long l) Methods inherited from class GenericLongType
equals, getBitsPerPixel, getEntitiesPerPixel, getLong, getValue, hashCode, index, set, setLong, setValue, updateContainer, valueEqualsMethods inherited from class AbstractIntegerType
getMinIncrementMethods inherited from class AbstractRealType
getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, pow, pow, setImaginary, setImaginaryMethods inherited from class AbstractComplexType
complexConjugate, setComplexNumber, setComplexNumberMethods inherited from interface ComplexType
complexConjugate, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, setComplexNumber, setComplexNumber, setImaginary, setImaginaryMethods inherited from interface NativeType
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndexMethods inherited from interface PowFloatingPoint
pow
-
Field Details
-
MAX_VALUE_PLUS_ONE
private static final double MAX_VALUE_PLUS_ONE -
MAX_LONG_PLUS_ONE
private static final double MAX_LONG_PLUS_ONE -
typeFactory
-
-
Constructor Details
-
UnsignedLongType
-
UnsignedLongType
public UnsignedLongType(long value) -
UnsignedLongType
-
UnsignedLongType
-
UnsignedLongType
public UnsignedLongType()
-
-
Method Details
-
duplicateTypeOnSameNativeImg
Description copied from interface:NativeTypeCreates a newNativeTypewhich stores in the same physical array. This is only used internally.- Returns:
- a new
NativeTypeinstance working on the sameNativeImg
-
getNativeTypeFactory
- Specified by:
getNativeTypeFactoryin interfaceNativeType<UnsignedLongType>- Specified by:
getNativeTypeFactoryin classGenericLongType<UnsignedLongType>
-
mul
public void mul(float c) - Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classGenericLongType<UnsignedLongType>
-
mul
public void mul(double c) - Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classGenericLongType<UnsignedLongType>
-
add
- Specified by:
addin interfaceAdd<UnsignedLongType>- Overrides:
addin classGenericLongType<UnsignedLongType>
-
div
- Specified by:
divin interfaceDiv<UnsignedLongType>- Overrides:
divin classGenericLongType<UnsignedLongType>- See Also:
-
divide
public static final long divide(long d1, long d2) Unsigned division ofd1byd2. See "Division by Invariant Integers using Multiplication", by Torbjorn Granlund and Peter L. Montgomery, 1994. http://gmplib.org/~tege/divcnst-pldi94.pdf- Throws:
ArithmeticException- when c equals zero.
-
mul
- Specified by:
mulin interfaceMul<UnsignedLongType>- Overrides:
mulin classGenericLongType<UnsignedLongType>
-
sub
- Specified by:
subin interfaceSub<UnsignedLongType>- Overrides:
subin classGenericLongType<UnsignedLongType>
-
setOne
public void setOne()- Specified by:
setOnein interfaceSetOne- Overrides:
setOnein classGenericLongType<UnsignedLongType>
-
setZero
public void setZero()- Specified by:
setZeroin interfaceSetZero- Overrides:
setZeroin classGenericLongType<UnsignedLongType>
-
inc
public void inc()- Specified by:
incin interfaceRealType<UnsignedLongType>- Overrides:
incin classGenericLongType<UnsignedLongType>
-
dec
public void dec()- Specified by:
decin interfaceRealType<UnsignedLongType>- Overrides:
decin classGenericLongType<UnsignedLongType>
-
toString
- Overrides:
toStringin classGenericLongType<UnsignedLongType>
-
get
public long get()This method returns the value of the UnsignedLongType as a signed long. To get the unsigned value, usegetBigInteger(). -
getBigInteger
This method returns the unsigned representation of this UnsignedLongType as aBigInteger. -
set
public void set(long value) -
getInteger
public int getInteger() -
getIntegerLong
public long getIntegerLong() -
setInteger
public void setInteger(int f) -
setInteger
public void setInteger(long f) -
setBigInteger
-
setReal
public void setReal(double real) - Specified by:
setRealin interfaceComplexType<UnsignedLongType>- Overrides:
setRealin classAbstractIntegerType<UnsignedLongType>
-
doubleToUnsignedLong
static long doubleToUnsignedLong(double real) -
setReal
public void setReal(float real) - Specified by:
setRealin interfaceComplexType<UnsignedLongType>- Overrides:
setRealin classAbstractIntegerType<UnsignedLongType>
-
set
-
getMaxValue
public double getMaxValue()The maximum value that can be stored isMath.pow( 2, 64 ) - 1, which can't be represented with exact precision using a double -
getMaxBigIntegerValue
Returns the true maximum value as a BigInteger, since it cannot be precisely represented as adouble. -
getMinValue
public double getMinValue() -
compare
Deprecated.UseLong.compareUnsigned(long, long)instead. -
createVariable
-
copy
-
getRealFloat
public float getRealFloat()- Specified by:
getRealFloatin interfaceComplexType<UnsignedLongType>- Overrides:
getRealFloatin classAbstractIntegerType<UnsignedLongType>
-
getRealDouble
public double getRealDouble()- Specified by:
getRealDoublein interfaceComplexType<UnsignedLongType>- Overrides:
getRealDoublein classAbstractIntegerType<UnsignedLongType>
-
unsignedLongToDouble
static double unsignedLongToDouble(long l) -
compareTo
- Specified by:
compareToin interfaceComparable<UnsignedLongType>- Overrides:
compareToin classGenericLongType<UnsignedLongType>
-
Long.compareUnsigned(long, long)instead.