Package net.imglib2.type.numeric.integer
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,SetOne,SetZero,Sub<UnsignedLongType>,ValueEquals<UnsignedLongType>,Type<UnsignedLongType>
TODO
- Author:
- Stephan Preibisch, Stephan Saalfeld, Albert Cardona, Mark Hiner
-
Field Summary
Fields inherited from class net.imglib2.type.numeric.integer.GenericLongType
dataAccess, 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) intcopy()NativeImg<UnsignedLongType, ? extends LongAccess> createSuitableNativeImg(NativeImgFactory<UnsignedLongType> storageFactory, long[] dim) TheNativeTypecreates theNativeImgused for storing image data; based on the given storage strategy and its size.Creates a newTypevariable which can only store one value.voiddec()voidstatic final longdivide(long d1, long d2) Unsigned division ofd1byd2.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 doubledoubleinthashCode()voidinc()voidmul(double c) voidmul(float c) voidvoidset(long value) voidset(BigInteger bi) voidvoidsetInteger(int f) voidsetInteger(long f) voidsetOne()voidsetZero()voidtoString()Methods inherited from class net.imglib2.type.numeric.integer.GenericLongType
decIndex, decIndex, getBitsPerPixel, getEntitiesPerPixel, getIndex, getLong, getValue, incIndex, incIndex, set, setLong, setValue, updateContainer, updateIndex, valueEqualsMethods inherited from class net.imglib2.type.numeric.integer.AbstractIntegerType
getMinIncrement, getRealDouble, getRealFloat, setReal, setRealMethods inherited from class net.imglib2.type.numeric.real.AbstractRealType
equals, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, setImaginary, setImaginaryMethods inherited from class net.imglib2.type.numeric.complex.AbstractComplexType
complexConjugate, setComplexNumber, setComplexNumberMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.imglib2.type.numeric.ComplexType
complexConjugate, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, setComplexNumber, setComplexNumber, setImaginary, setImaginary
-
Constructor Details
-
UnsignedLongType
-
UnsignedLongType
public UnsignedLongType(long value) -
UnsignedLongType
-
UnsignedLongType
-
UnsignedLongType
public UnsignedLongType()
-
-
Method Details
-
createSuitableNativeImg
public NativeImg<UnsignedLongType,? extends LongAccess> createSuitableNativeImg(NativeImgFactory<UnsignedLongType> storageFactory, long[] dim) Description copied from interface:NativeTypeTheNativeTypecreates theNativeImgused for storing image data; based on the given storage strategy and its size. It basically only decides here which BasicType it uses (float, int, byte, bit, ...) and how many entities per pixel it needs (e.g. 2 floats per pixel for a complex number). This enables the separation of containers and the basic types. -
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
-
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>
-
hashCode
public int hashCode()- Overrides:
hashCodein 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
-
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() -
compareTo
- Specified by:
compareToin interfaceComparable<UnsignedLongType>- Overrides:
compareToin classGenericLongType<UnsignedLongType>
-
compare
public static final int compare(long a, long b) - Parameters:
a-b-- Returns:
- -1 if
a < b, 0 ifa == b, 1 ifa > b.
-
createVariable
Description copied from interface:TypeCreates a newTypevariable which can only store one value.- Returns:
- a new
Typevariable
-
copy
Description copied from interface:Type- Returns:
- a new
Typevariable
-