Package eu.simuline.octave.type
Class OctaveComplex
- java.lang.Object
-
- eu.simuline.octave.type.OctaveComplex
-
- All Implemented Interfaces:
OctaveObject
public final class OctaveComplex extends Object implements OctaveObject
Represents a complex matrix.
-
-
Field Summary
Fields Modifier and Type Field Description private OctaveDoubleimagprivate OctaveDoublereal
-
Constructor Summary
Constructors Constructor Description OctaveComplex(int... size)OctaveComplex(OctaveComplex o)Copy constructor.OctaveComplex(OctaveDouble r)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetImag(int... pos)doublegetReal(int... pos)intgetSize(int i)intpos2ind(int... pos)voidsetImag(double value, int... pos)voidsetReal(double value, int... pos)OctaveComplexshallowCopy()Make a shallow copy of this object.
-
-
-
Field Detail
-
real
private final OctaveDouble real
-
imag
private final OctaveDouble imag
-
-
Constructor Detail
-
OctaveComplex
public OctaveComplex(int... size)
- Parameters:
size-
-
OctaveComplex
public OctaveComplex(OctaveComplex o)
Copy constructor.- Parameters:
o-
-
OctaveComplex
public OctaveComplex(OctaveDouble r)
-
-
Method Detail
-
getSize
public int getSize(int i)
- Parameters:
i- dimension number in 1 based numbering, 1=row, 2=column- Returns:
- the size in dimension i
-
pos2ind
public int pos2ind(int... pos)
- Parameters:
pos-- Returns:
- the index into getReal() and getImag() for the position
- See Also:
AbstractGenericMatrix.pos2ind(int[])
-
setReal
public void setReal(double value, int... pos)- Parameters:
value-pos-
-
getReal
public double getReal(int... pos)
- Parameters:
pos-- Returns:
- the real value stored at pos
-
setImag
public void setImag(double value, int... pos)- Parameters:
value-pos-
-
getImag
public double getImag(int... pos)
- Parameters:
pos-- Returns:
- the imaginary value stored at pos
-
shallowCopy
public OctaveComplex shallowCopy()
Description copied from interface:OctaveObjectMake a shallow copy of this object. In general when anOctaveObjectis returned from a getter, e.g. onOctaveStructorOctaveStruct, a shallow copy is returned in order to follow the way octave behaves. This method is used to make that copy.- Specified by:
shallowCopyin interfaceOctaveObject- Returns:
- a shallow copy of this
-
-