Package net.imglib2.type.numeric.integer
Class UnsignedLongType
- java.lang.Object
-
- net.imglib2.type.numeric.complex.AbstractComplexType<T>
-
- net.imglib2.type.numeric.real.AbstractRealType<T>
-
- net.imglib2.type.numeric.integer.AbstractIntegerType<T>
-
- net.imglib2.type.numeric.integer.GenericLongType<UnsignedLongType>
-
- net.imglib2.type.numeric.integer.UnsignedLongType
-
- All Implemented Interfaces:
java.lang.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
public class UnsignedLongType extends GenericLongType<UnsignedLongType>
TODO
-
-
Field Summary
Fields Modifier and Type Field Description private static doubleMAX_LONG_PLUS_ONEprivate static doubleMAX_VALUE_PLUS_ONEprivate static NativeTypeFactory<UnsignedLongType,LongAccess>typeFactory-
Fields inherited from class net.imglib2.type.numeric.integer.GenericLongType
dataAccess, i, img
-
-
Constructor Summary
Constructors Constructor Description UnsignedLongType()UnsignedLongType(long value)UnsignedLongType(java.math.BigInteger value)UnsignedLongType(LongAccess access)UnsignedLongType(NativeImg<?,? extends LongAccess> img)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(UnsignedLongType c)static intcompare(long a, long b)Deprecated.UseLong.compareUnsigned(long, long)instead.intcompareTo(UnsignedLongType other)UnsignedLongTypecopy()UnsignedLongTypecreateVariable()Creates a newTypevariable which can only store one value.voiddec()voiddiv(UnsignedLongType c)static longdivide(long d1, long d2)Unsigned division ofd1byd2.(package private) static longdoubleToUnsignedLong(double real)UnsignedLongTypeduplicateTypeOnSameNativeImg()Creates a newNativeTypewhich stores in the same physical array.longget()This method returns the value of the UnsignedLongType as a signed long.java.math.BigIntegergetBigInteger()This method returns the unsigned representation of this UnsignedLongType as aBigInteger.intgetInteger()longgetIntegerLong()java.math.BigIntegergetMaxBigIntegerValue()Returns the true maximum value as a BigInteger, since it cannot be precisely represented as adouble.doublegetMaxValue()The maximum value that can be stored isMath.pow( 2, 64 ) - 1, which can't be represented with exact precision using a doubledoublegetMinValue()NativeTypeFactory<UnsignedLongType,LongAccess>getNativeTypeFactory()doublegetRealDouble()floatgetRealFloat()voidinc()voidmul(double c)voidmul(float c)voidmul(UnsignedLongType c)voidset(long value)voidset(java.math.BigInteger bi)voidsetBigInteger(java.math.BigInteger b)voidsetInteger(int f)voidsetInteger(long f)voidsetOne()voidsetReal(double real)voidsetReal(float real)voidsetZero()voidsub(UnsignedLongType c)java.lang.StringtoString()(package private) static doubleunsignedLongToDouble(long l)-
Methods inherited from class net.imglib2.type.numeric.integer.GenericLongType
equals, getBitsPerPixel, getEntitiesPerPixel, getLong, getValue, hashCode, index, set, setLong, setValue, updateContainer, valueEquals
-
Methods inherited from class net.imglib2.type.numeric.integer.AbstractIntegerType
getMinIncrement
-
Methods inherited from class net.imglib2.type.numeric.real.AbstractRealType
getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, pow, pow, setImaginary, setImaginary
-
Methods inherited from class net.imglib2.type.numeric.complex.AbstractComplexType
complexConjugate, setComplexNumber, setComplexNumber
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.imglib2.type.numeric.ComplexType
complexConjugate, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, setComplexNumber, setComplexNumber, setImaginary, setImaginary
-
Methods inherited from interface net.imglib2.type.NativeType
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
-
Methods inherited from interface net.imglib2.type.operators.PowFloatingPoint
pow
-
-
-
-
Field Detail
-
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
private static final NativeTypeFactory<UnsignedLongType,LongAccess> typeFactory
-
-
Constructor Detail
-
UnsignedLongType
public UnsignedLongType(NativeImg<?,? extends LongAccess> img)
-
UnsignedLongType
public UnsignedLongType(long value)
-
UnsignedLongType
public UnsignedLongType(java.math.BigInteger value)
-
UnsignedLongType
public UnsignedLongType(LongAccess access)
-
UnsignedLongType
public UnsignedLongType()
-
-
Method Detail
-
duplicateTypeOnSameNativeImg
public UnsignedLongType 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
public NativeTypeFactory<UnsignedLongType,LongAccess> 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
public void add(UnsignedLongType c)
- Specified by:
addin interfaceAdd<UnsignedLongType>- Overrides:
addin classGenericLongType<UnsignedLongType>
-
div
public void div(UnsignedLongType c)
- Specified by:
divin interfaceDiv<UnsignedLongType>- Overrides:
divin classGenericLongType<UnsignedLongType>- See Also:
divide(long, long)
-
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:
java.lang.ArithmeticException- when c equals zero.
-
mul
public void mul(UnsignedLongType c)
- Specified by:
mulin interfaceMul<UnsignedLongType>- Overrides:
mulin classGenericLongType<UnsignedLongType>
-
sub
public void sub(UnsignedLongType c)
- 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
public java.lang.String 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
public java.math.BigInteger 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
public void setBigInteger(java.math.BigInteger b)
-
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
public void set(java.math.BigInteger bi)
-
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
public java.math.BigInteger getMaxBigIntegerValue()
Returns the true maximum value as a BigInteger, since it cannot be precisely represented as adouble.
-
getMinValue
public double getMinValue()
-
compare
@Deprecated public static final int compare(long a, long b)Deprecated.UseLong.compareUnsigned(long, long)instead.
-
createVariable
public UnsignedLongType createVariable()
Description copied from interface:TypeCreates a newTypevariable which can only store one value.- Returns:
- a new
Typevariable
-
copy
public UnsignedLongType copy()
Description copied from interface:Type- Returns:
- a new
Typevariable
-
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
public int compareTo(UnsignedLongType other)
- Specified by:
compareToin interfacejava.lang.Comparable<UnsignedLongType>- Overrides:
compareToin classGenericLongType<UnsignedLongType>
-
-