org.scilab.modules.types
Class ScilabDoubleReference

java.lang.Object
  extended by org.scilab.modules.types.ScilabDouble
      extended by org.scilab.modules.types.ScilabDoubleReference
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, ScilabType

public class ScilabDoubleReference
extends ScilabDouble

This class provides a representation on the Scilab Double datatype
Note that double is the default datatype in Scilab.

This class is Serializable and any modification could impact load and store of data (Xcos files, Javasci saved data, etc...).

Example (real):
double [][]a={{21.2, 22.0, 42.0, 39.0},{23.2, 24.0, 44.0, 40.0}};
ScilabDouble aMatrix = new ScilabDouble(a);

Example (complex):
double [][]a={{21.2, 22.0, 42.0, 39.0},{23.2, 24.0, 44.0, 40.0}};
double [][]aImg={{210.2, 220.0, 420.0, 390.0},{230.2, 240.0, 440.0, 400.0}};
ScilabDouble aMatrix = new ScilabDouble(a, aImg);

See Also:
Scilab, Serialized Form

Field Summary
 
Fields inherited from class org.scilab.modules.types.ScilabDouble
byref, imaginaryPart, realPart, swaped, varName
 
Method Summary
 int getHeight()
          Return the height (number of elements) of the stored data
 java.nio.DoubleBuffer getImaginaryBuffer()
          Get the imaginary part as DoubleBuffer
 double getImaginaryElement(int i, int j)
          Get the element at position (i, j) in the imaginary part
 double[][] getImaginaryPart()
          Get the imaginary part of the data.
 java.lang.Object getRawImaginaryPart()
          Get the raw data
 java.lang.Object getRawRealPart()
          Get the raw data
 java.nio.DoubleBuffer getRealBuffer()
          Get the real part as DoubleBuffer
 double getRealElement(int i, int j)
          Get the element at position (i, j) in the real part
 double[][] getRealPart()
          Get the real part of the data.
 int getWidth()
          Return the width (number of elements) of the stored data
 boolean isEmpty()
          Check the emptiness of the associated data.
 boolean isReal()
          Check if the current data doesn't have an imaginary part.
 void setElement(int i, int j, double x, double y)
          Set the element at position (i, j)
 void setImaginaryElement(int i, int j, double x)
          Set the element at position (i, j) in the imaginary part
 void setImaginaryPart(double[][] imaginaryPart)
          Set the imaginary part of the data.
 void setRealElement(int i, int j, double x)
          Set the element at position (i, j) in the real part
 void setRealPart(double[][] realPart)
          Set the real part of the data.
 
Methods inherited from class org.scilab.modules.types.ScilabDouble
equals, getElement, getSerializedComplexMatrix, getSerializedObject, getType, getVarName, isReference, isSwaped, readExternal, toString, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

isEmpty

public boolean isEmpty()
Check the emptiness of the associated data.

Specified by:
isEmpty in interface ScilabType
Overrides:
isEmpty in class ScilabDouble
Returns:
true, if the associated data array is empty.

isReal

public boolean isReal()
Check if the current data doesn't have an imaginary part.

Overrides:
isReal in class ScilabDouble
Returns:
true, if the data are real only.

getRawRealPart

public java.lang.Object getRawRealPart()
Get the raw data

Overrides:
getRawRealPart in class ScilabDouble
Returns:
the real part

getRawImaginaryPart

public java.lang.Object getRawImaginaryPart()
Get the raw data

Overrides:
getRawImaginaryPart in class ScilabDouble
Returns:
the imaginary part

getRealBuffer

public java.nio.DoubleBuffer getRealBuffer()
Get the real part as DoubleBuffer

Returns:
the real part

getImaginaryBuffer

public java.nio.DoubleBuffer getImaginaryBuffer()
Get the imaginary part as DoubleBuffer

Returns:
the imaginary part

getRealPart

public double[][] getRealPart()
Get the real part of the data.

Overrides:
getRealPart in class ScilabDouble
Returns:
the real part.

setRealPart

public void setRealPart(double[][] realPart)
Set the real part of the data.

Overrides:
setRealPart in class ScilabDouble
Parameters:
realPart - the real part.

getImaginaryPart

public double[][] getImaginaryPart()
Get the imaginary part of the data.

Overrides:
getImaginaryPart in class ScilabDouble
Returns:
the imaginary part.

setImaginaryPart

public void setImaginaryPart(double[][] imaginaryPart)
Set the imaginary part of the data.

Overrides:
setImaginaryPart in class ScilabDouble
Parameters:
imaginaryPart - the imaginary part.

getRealElement

public double getRealElement(int i,
                             int j)
Get the element at position (i, j) in the real part

Overrides:
getRealElement in class ScilabDouble
Parameters:
i - the first coordinate
j - the second coordinate
Returns:
the corresponding double

getImaginaryElement

public double getImaginaryElement(int i,
                                  int j)
Get the element at position (i, j) in the imaginary part

Overrides:
getImaginaryElement in class ScilabDouble
Parameters:
i - the first coordinate
j - the second coordinate
Returns:
the corresponding double

setRealElement

public void setRealElement(int i,
                           int j,
                           double x)
Set the element at position (i, j) in the real part

Overrides:
setRealElement in class ScilabDouble
Parameters:
i - the first coordinate
j - the second coordinate
x - the new value

setImaginaryElement

public void setImaginaryElement(int i,
                                int j,
                                double x)
Set the element at position (i, j) in the imaginary part

Overrides:
setImaginaryElement in class ScilabDouble
Parameters:
i - the first coordinate
j - the second coordinate
x - the new value

setElement

public void setElement(int i,
                       int j,
                       double x,
                       double y)
Set the element at position (i, j)

Overrides:
setElement in class ScilabDouble
Parameters:
i - the first coordinate
j - the second coordinate
x - the new value for real part
y - the new value for imaginary part

getHeight

public int getHeight()
Description copied from interface: ScilabType
Return the height (number of elements) of the stored data

Specified by:
getHeight in interface ScilabType
Overrides:
getHeight in class ScilabDouble
Returns:
the height of the data matrix
See Also:
ScilabType.getHeight()

getWidth

public int getWidth()
Description copied from interface: ScilabType
Return the width (number of elements) of the stored data

Specified by:
getWidth in interface ScilabType
Overrides:
getWidth in class ScilabDouble
Returns:
the width of the data matrix
See Also:
ScilabType.getWidth()