Class ComplexDoubleType
- All Implemented Interfaces:
NativeType<ComplexDoubleType>, ComplexType<ComplexDoubleType>, NumericType<ComplexDoubleType>, Add<ComplexDoubleType>, Div<ComplexDoubleType>, Mul<ComplexDoubleType>, MulFloatingPoint, Pow<ComplexDoubleType>, PowFloatingPoint, SetOne, SetZero, Sub<ComplexDoubleType>, ValueEquals<ComplexDoubleType>, Type<ComplexDoubleType>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DoubleAccessprivate final Indexprivate intprotected final NativeImg<?, ? extends DoubleAccess> private intprivate static final NativeTypeFactory<ComplexDoubleType, DoubleAccess> -
Constructor Summary
ConstructorsConstructorDescriptionComplexDoubleType(double r, double i) ComplexDoubleType(DoubleAccess access) ComplexDoubleType(NativeImg<?, ? extends DoubleAccess> complexfloatStorage) -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a newTypevariable which can only store one value.Creates a newNativeTypewhich stores in the same physical array.Get the number of entities in the storage array required to store one pixel value.doublefloatdoublefloatindex()Get the (modifiable) index into the current data array.voidset(double r, double i) voidSets the value of anotherType.voidsetImaginary(double i) voidsetImaginary(float i) voidsetReal(double r) voidsetReal(float r) voidThis method is used by an accessor (e.g., aCursor) to request an update of the current data array.Methods inherited from class AbstractComplexType
add, complexConjugate, div, equals, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, hashCode, mul, mul, mul, pow, pow, setComplexNumber, setComplexNumber, setOne, setZero, sub, toString, valueEqualsMethods inherited from interface NativeType
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndexMethods inherited from interface ValueEquals
valueEquals
-
Field Details
-
i
-
realI
private int realI -
imaginaryI
private int imaginaryI -
img
-
dataAccess
-
typeFactory
-
-
Constructor Details
-
ComplexDoubleType
-
ComplexDoubleType
public ComplexDoubleType(double r, double i) -
ComplexDoubleType
-
ComplexDoubleType
public ComplexDoubleType()
-
-
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<ComplexDoubleType>- 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<ComplexDoubleType>
-
duplicateTypeOnSameNativeImg
Description copied from interface:NativeTypeCreates a newNativeTypewhich stores in the same physical array. This is only used internally.- Specified by:
duplicateTypeOnSameNativeImgin interfaceNativeType<ComplexDoubleType>- Returns:
- a new
NativeTypeinstance working on the sameNativeImg
-
getNativeTypeFactory
- Specified by:
getNativeTypeFactoryin interfaceNativeType<ComplexDoubleType>
-
getRealFloat
public float getRealFloat()- Specified by:
getRealFloatin interfaceComplexType<ComplexDoubleType>
-
getRealDouble
public double getRealDouble()- Specified by:
getRealDoublein interfaceComplexType<ComplexDoubleType>
-
getImaginaryFloat
public float getImaginaryFloat()- Specified by:
getImaginaryFloatin interfaceComplexType<ComplexDoubleType>
-
getImaginaryDouble
public double getImaginaryDouble()- Specified by:
getImaginaryDoublein interfaceComplexType<ComplexDoubleType>
-
setReal
public void setReal(float r) - Specified by:
setRealin interfaceComplexType<ComplexDoubleType>
-
setReal
public void setReal(double r) - Specified by:
setRealin interfaceComplexType<ComplexDoubleType>
-
setImaginary
public void setImaginary(float i) - Specified by:
setImaginaryin interfaceComplexType<ComplexDoubleType>
-
setImaginary
public void setImaginary(double i) - Specified by:
setImaginaryin interfaceComplexType<ComplexDoubleType>
-
set
public void set(double r, double i) -
set
Description copied from interface:TypeSets the value of anotherType.- Specified by:
setin interfaceType<ComplexDoubleType>- Overrides:
setin classAbstractComplexType<ComplexDoubleType>- Parameters:
c- the new value
-
createVariable
Description copied from interface:TypeCreates a newTypevariable which can only store one value.- Specified by:
createVariablein interfaceType<ComplexDoubleType>- Returns:
- a new
Typevariable
-
copy
Description copied from interface:Type- Specified by:
copyin interfaceType<ComplexDoubleType>- 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<ComplexDoubleType>- Returns:
- the number of storage type entities required to store one pixel value.
-