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 TypeMethodDescriptionvoid
static final int
compare
(long a, long b) int
copy()
NativeImg
<UnsignedLongType, ? extends LongAccess> createSuitableNativeImg
(NativeImgFactory<UnsignedLongType> storageFactory, long[] dim) TheNativeType
creates theNativeImg
used for storing image data; based on the given storage strategy and its size.Creates a newType
variable which can only store one value.void
dec()
void
static final long
divide
(long d1, long d2) Unsigned division ofd1
byd2
.Creates a newNativeType
which stores in the same physical array.long
get()
This method returns the value of the UnsignedLongType as a signed long.This method returns the unsigned representation of this UnsignedLongType as aBigInteger
.int
long
Returns the true maximum value as a BigInteger, since it cannot be precisely represented as adouble
.double
The maximum value that can be stored isMath.pow( 2, 64 ) - 1
, which can't be represented with exact precision using a doubledouble
int
hashCode()
void
inc()
void
mul
(double c) void
mul
(float c) void
void
set
(long value) void
set
(BigInteger bi) void
void
setInteger
(int f) void
setInteger
(long f) void
setOne()
void
setZero()
void
toString()
Methods inherited from class net.imglib2.type.numeric.integer.GenericLongType
decIndex, decIndex, getBitsPerPixel, getEntitiesPerPixel, getIndex, getLong, getValue, incIndex, incIndex, set, setLong, setValue, updateContainer, updateIndex, valueEquals
Methods inherited from class net.imglib2.type.numeric.integer.AbstractIntegerType
getMinIncrement, getRealDouble, getRealFloat, setReal, setReal
Methods inherited from class net.imglib2.type.numeric.real.AbstractRealType
equals, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, 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
-
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:NativeType
TheNativeType
creates theNativeImg
used 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:NativeType
Creates a newNativeType
which stores in the same physical array. This is only used internally.- Returns:
- a new
NativeType
instance working on the sameNativeImg
-
mul
public void mul(float c) - Specified by:
mul
in interfaceMulFloatingPoint
- Overrides:
mul
in classGenericLongType<UnsignedLongType>
-
mul
public void mul(double c) - Specified by:
mul
in interfaceMulFloatingPoint
- Overrides:
mul
in classGenericLongType<UnsignedLongType>
-
add
- Specified by:
add
in interfaceAdd<UnsignedLongType>
- Overrides:
add
in classGenericLongType<UnsignedLongType>
-
div
- Specified by:
div
in interfaceDiv<UnsignedLongType>
- Overrides:
div
in classGenericLongType<UnsignedLongType>
- See Also:
-
divide
public static final long divide(long d1, long d2) Unsigned division ofd1
byd2
. 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:
mul
in interfaceMul<UnsignedLongType>
- Overrides:
mul
in classGenericLongType<UnsignedLongType>
-
sub
- Specified by:
sub
in interfaceSub<UnsignedLongType>
- Overrides:
sub
in classGenericLongType<UnsignedLongType>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classGenericLongType<UnsignedLongType>
-
setOne
public void setOne()- Specified by:
setOne
in interfaceSetOne
- Overrides:
setOne
in classGenericLongType<UnsignedLongType>
-
setZero
public void setZero()- Specified by:
setZero
in interfaceSetZero
- Overrides:
setZero
in classGenericLongType<UnsignedLongType>
-
inc
public void inc()- Specified by:
inc
in interfaceRealType<UnsignedLongType>
- Overrides:
inc
in classGenericLongType<UnsignedLongType>
-
dec
public void dec()- Specified by:
dec
in interfaceRealType<UnsignedLongType>
- Overrides:
dec
in classGenericLongType<UnsignedLongType>
-
toString
- Overrides:
toString
in 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:
compareTo
in interfaceComparable<UnsignedLongType>
- Overrides:
compareTo
in 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:Type
Creates a newType
variable which can only store one value.- Returns:
- a new
Type
variable
-
copy
Description copied from interface:Type
- Returns:
- a new
Type
variable
-