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 OctaveDouble
imag
private OctaveDouble
real
-
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 double
getImag(int... pos)
double
getReal(int... pos)
int
getSize(int i)
int
pos2ind(int... pos)
void
setImag(double value, int... pos)
void
setReal(double value, int... pos)
OctaveComplex
shallowCopy()
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:OctaveObject
Make a shallow copy of this object. In general when anOctaveObject
is returned from a getter, e.g. onOctaveStruct
orOctaveStruct
, a shallow copy is returned in order to follow the way octave behaves. This method is used to make that copy.- Specified by:
shallowCopy
in interfaceOctaveObject
- Returns:
- a shallow copy of this
-
-