Class ComplexFloatType
- All Implemented Interfaces:
NativeType<ComplexFloatType>, ComplexType<ComplexFloatType>, NumericType<ComplexFloatType>, Add<ComplexFloatType>, Div<ComplexFloatType>, Mul<ComplexFloatType>, MulFloatingPoint, Pow<ComplexFloatType>, PowFloatingPoint, SetOne, SetZero, Sub<ComplexFloatType>, ValueEquals<ComplexFloatType>, Type<ComplexFloatType>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FloatAccessprivate final Indexprotected final NativeImg<?, ? extends FloatAccess> private static final NativeTypeFactory<ComplexFloatType, FloatAccess> -
Constructor Summary
ConstructorsConstructorDescriptionComplexFloatType(float r, float i) ComplexFloatType(FloatAccess access) ComplexFloatType(NativeImg<?, ? extends FloatAccess> complexfloatStorage) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcopy()Creates a newTypevariable which can only store one value.voidCreates a newNativeTypewhich stores in the same physical array.booleanGet the number of entities in the storage array required to store one pixel value.doublefloatdoublefloatinthashCode()index()Get the (modifiable) index into the current data array.voidvoidset(float r, float i) voidSets the value of anotherType.voidsetImaginary(double i) voidsetImaginary(float i) voidsetReal(double r) voidsetReal(float r) voidvoidvoidThis method is used by an accessor (e.g., aCursor) to request an update of the current data array.booleanMethods inherited from class AbstractComplexType
getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, mul, mul, pow, pow, setComplexNumber, setComplexNumber, setOne, setZero, toStringMethods inherited from interface NativeType
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
-
Field Details
-
i
-
img
-
dataAccess
-
typeFactory
-
-
Constructor Details
-
ComplexFloatType
-
ComplexFloatType
public ComplexFloatType(float r, float i) -
ComplexFloatType
-
ComplexFloatType
public ComplexFloatType()
-
-
Method Details
-
updateContainer
Description copied from interface:NativeTypeThis method is used by an accessor (e.g., aCursor) to request an update of the current data array.As an example consider a
CellCursormoving on aCellImg. The cursor maintains aNativeTypewhich provides access to the image data. When the cursor moves from one cell to the next, the underlying data array of theNativeTypemust be switched to the data array of the new cell.To achieve this, the
CellCursorcallsupdateContainer()with itself as the argument.updateContainer()in turn will callNativeImg.update(Object)on it's container, passing along the reference to the cursor. In this example, the container would be aCellImg. While theNativeTypedoes not know about the type of the cursor, the container does.CellImgknows that it is passed aCellCursorinstance, which can be used to figure out the current cell and the underlying data array, which is then returned to theNativeType.The idea behind this concept is maybe not obvious. The
NativeTypeknows which basic type is used (float, int, byte, ...). However, it does not know how the data is stored (ArrayImg,CellImg, ...). This prevents the need for multiple implementations ofNativeType.- Specified by:
updateContainerin interfaceNativeType<ComplexFloatType>- Parameters:
c- reference to an accessor which can be passed on to the container (which will know what to do with it).
-
index
Description copied from interface:NativeTypeGet the (modifiable) index into the current data array. The returned instance will always be the same for the same Type.- Specified by:
indexin interfaceNativeType<ComplexFloatType>
-
duplicateTypeOnSameNativeImg
Description copied from interface:NativeTypeCreates a newNativeTypewhich stores in the same physical array. This is only used internally.- Specified by:
duplicateTypeOnSameNativeImgin interfaceNativeType<ComplexFloatType>- Returns:
- a new
NativeTypeinstance working on the sameNativeImg
-
getNativeTypeFactory
- Specified by:
getNativeTypeFactoryin interfaceNativeType<ComplexFloatType>
-
getRealFloat
public float getRealFloat()- Specified by:
getRealFloatin interfaceComplexType<ComplexFloatType>
-
getRealDouble
public double getRealDouble()- Specified by:
getRealDoublein interfaceComplexType<ComplexFloatType>
-
getImaginaryFloat
public float getImaginaryFloat()- Specified by:
getImaginaryFloatin interfaceComplexType<ComplexFloatType>
-
getImaginaryDouble
public double getImaginaryDouble()- Specified by:
getImaginaryDoublein interfaceComplexType<ComplexFloatType>
-
setReal
public void setReal(float r) - Specified by:
setRealin interfaceComplexType<ComplexFloatType>
-
setReal
public void setReal(double r) - Specified by:
setRealin interfaceComplexType<ComplexFloatType>
-
setImaginary
public void setImaginary(float i) - Specified by:
setImaginaryin interfaceComplexType<ComplexFloatType>
-
setImaginary
public void setImaginary(double i) - Specified by:
setImaginaryin interfaceComplexType<ComplexFloatType>
-
set
public void set(float r, float i) -
add
- Specified by:
addin interfaceAdd<ComplexFloatType>- Overrides:
addin classAbstractComplexType<ComplexFloatType>
-
div
- Specified by:
divin interfaceDiv<ComplexFloatType>- Overrides:
divin classAbstractComplexType<ComplexFloatType>
-
mul
- Specified by:
mulin interfaceMul<ComplexFloatType>- Overrides:
mulin classAbstractComplexType<ComplexFloatType>
-
sub
- Specified by:
subin interfaceSub<ComplexFloatType>- Overrides:
subin classAbstractComplexType<ComplexFloatType>
-
complexConjugate
public void complexConjugate()- Specified by:
complexConjugatein interfaceComplexType<ComplexFloatType>- Overrides:
complexConjugatein classAbstractComplexType<ComplexFloatType>
-
switchRealComplex
public void switchRealComplex() -
set
Description copied from interface:TypeSets the value of anotherType.- Specified by:
setin interfaceType<ComplexFloatType>- Overrides:
setin classAbstractComplexType<ComplexFloatType>- Parameters:
c- the new value
-
createVariable
Description copied from interface:TypeCreates a newTypevariable which can only store one value.- Specified by:
createVariablein interfaceType<ComplexFloatType>- Returns:
- a new
Typevariable
-
copy
Description copied from interface:Type- Specified by:
copyin interfaceType<ComplexFloatType>- Returns:
- a new
Typevariable
-
getEntitiesPerPixel
Description copied from interface:NativeTypeGet the number of entities in the storage array required to store one pixel value. A pixel value may be spread over several or less than one entity. For example, a complex number may require 2 entries of a float[] array to store one pixel. Or a 12-bit type might need 12/64th entries of a long[] array.- Specified by:
getEntitiesPerPixelin interfaceNativeType<ComplexFloatType>- Returns:
- the number of storage type entities required to store one pixel value.
-
valueEquals
- Specified by:
valueEqualsin interfaceValueEquals<ComplexFloatType>- Overrides:
valueEqualsin classAbstractComplexType<ComplexFloatType>
-
equals
- Overrides:
equalsin classAbstractComplexType<ComplexFloatType>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractComplexType<ComplexFloatType>
-