sidl
Class Double.Array

java.lang.Object
  extended bygov.llnl.sidl.BaseArray
      extended bysidl.Double.Array
Direct Known Subclasses:
Double.Array1, Double.Array2, Double.Array3, Double.Array4, Double.Array5, Double.Array6, Double.Array7
Enclosing class:
Double

public static class Double.Array
extends BaseArray

Define a one dimensional array of type double for the sidl Java run-time. Many of these methods will throw array index exceptions if the specified indices are out of bounds.


Nested Class Summary
static class Double.Array.Holder
           
 
Field Summary
 
Fields inherited from class gov.llnl.sidl.BaseArray
d_array, d_owner
 
Constructor Summary
  Double.Array()
          Construct an empty array object.
  Double.Array(int dim, int[] lower, int[] upper, boolean isRow)
          Create an array with the specified lower and upper bounds.
protected Double.Array(long array, boolean owner)
          Create an array using an IOR array pointer.
 
Method Summary
 void _addRef()
          Native function to add a reference count to the IOR of this array Not for users, for internal Babel use only.
 void _copy(Double.Array dest)
          Method Copy copies the elements of 'this' to an already existing array of the same size.
 Double.Array _dcast()
          Casts this array to an array of a defined dimension and returns the resulting array.
 void _deallocate()
          Deallocate deletes java's reference to the array (calls deleteRef) But does not (nessecarily) case the array to be GCed.
 void _destroy()
          Native routine to destroy (deallocate) the current array data.
 int _dim()
          Native routine to get the dimension of the current array.
 double _get(int i, int j, int k, int l, int m, int n, int o)
          Native routine to fetch the specified value from the array.
 boolean _isColumnOrder()
          Abstract method returns true if array is ColumnOrder.
 boolean _isRowOrder()
          Abstract method returns true if array if RowOrder.
 int _length(int dim)
          Routine gets the length of the array in the specified dimension.
 int _lower(int dim)
          Native routine to fetch the specified lower bound of the array.
 void _reallocate(int dim, int[] lower, int[] upper, boolean isRow)
          Native routine to reallocate data in the array.
 void _set(int i, int j, int k, int l, int m, int n, int o, double value)
          Native routine to set the specified value in the array.
 Double.Array _slice(int dimen, int[] numElem, int[] srcStart, int[] srcStride, int[] newStart)
          Slice returns an array that is <= the orignial array.
 Double.Array _smartCopy()
          Method smartCopy returns a a copy of a borrowed array, or increments the reference count of an array that manages it's own data.
 int _stride(int dim)
          Abstract method to fetch the stride of the specified dimen of the array.
 int _upper(int dim)
          Native routine to fetch the specified upper bound of the array.
 
Methods inherited from class gov.llnl.sidl.BaseArray
checkBounds, checkBounds, checkBounds, checkBounds, checkBounds, checkBounds, checkBounds, checkDimension, checkIndexBounds, checkNullArray, destroy, dim, finalize, get_ior_pointer, get_owner, isNull, lower, reallocate, reset, set_ior_pointer, set_owner, stride, upper
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Double.Array

public Double.Array()
Construct an empty array object. This array object must be allocated with realllocate before any actions are performed on the array data.


Double.Array

protected Double.Array(long array,
                       boolean owner)
Create an array using an IOR array pointer. The pointer value may be zero (representing null).


Double.Array

public Double.Array(int dim,
                    int[] lower,
                    int[] upper,
                    boolean isRow)
Create an array with the specified lower and upper bounds. The upper bounds are inclusive. An array out of bounds exception is thrown if the array bounds or dimension are invalid. If isRow is true, the array will be in Row order

Method Detail

_dim

public int _dim()
Native routine to get the dimension of the current array. This routine assumes that the array has already been initialized. If the array has not been initialized, then horrible things may happen.

Specified by:
_dim in class BaseArray

_lower

public int _lower(int dim)
Native routine to fetch the specified lower bound of the array. The specified array dimension must be between zero and the array dimension minus one. Invalid values will have unpredictable (but almost certainly bad) results.

Specified by:
_lower in class BaseArray

_upper

public int _upper(int dim)
Native routine to fetch the specified upper bound of the array. The specified array dimension must be between zero and the array dimension minus one. Invalid values will have unpredictable (but almost certainly bad) results.

Specified by:
_upper in class BaseArray

_stride

public int _stride(int dim)
Abstract method to fetch the stride of the specified dimen of the array. This method will be implemented in subclasses as a native method. The specified array dimension must be between zero and the array dimension minus one. Invalid values will have unpredictable (but almost certainly bad) results.

Specified by:
_stride in class BaseArray

_length

public int _length(int dim)
Routine gets the length of the array in the specified dimension.


_isColumnOrder

public boolean _isColumnOrder()
Abstract method returns true if array is ColumnOrder. This method will be implemented in subclasses as a native method.

Specified by:
_isColumnOrder in class BaseArray

_isRowOrder

public boolean _isRowOrder()
Abstract method returns true if array if RowOrder. This method will be implemented in subclasses as a native method.

Specified by:
_isRowOrder in class BaseArray

_get

public double _get(int i,
                   int j,
                   int k,
                   int l,
                   int m,
                   int n,
                   int o)
Native routine to fetch the specified value from the array. The specified array index/indices must be lie between the array lower upper bounds (inclusive). Invalid indices will have unpredictable (but almost certainly bad) results.


_set

public void _set(int i,
                 int j,
                 int k,
                 int l,
                 int m,
                 int n,
                 int o,
                 double value)
Native routine to set the specified value in the array. The specified array index/indices must be lie between the array lower upper bounds (inclusive). Invalid indices will have unpredictable (but almost certainly bad) results.


_addRef

public void _addRef()
Native function to add a reference count to the IOR of this array Not for users, for internal Babel use only. (Pretty useless for users)

Specified by:
_addRef in class BaseArray

_deallocate

public void _deallocate()
Deallocate deletes java's reference to the array (calls deleteRef) But does not (nessecarily) case the array to be GCed.

Specified by:
_deallocate in class BaseArray

_destroy

public void _destroy()
Native routine to destroy (deallocate) the current array data.

Specified by:
_destroy in class BaseArray

_reallocate

public void _reallocate(int dim,
                        int[] lower,
                        int[] upper,
                        boolean isRow)
Native routine to reallocate data in the array. The specified array dimension and indices must match and be within valid ranges (e.g., the upper bounds must be greater than or equal to lower bounds.) Invalid indices will have unpredictable (but almost certainly bad) results. This routine will deallocate the existing array data if it is not null.

Specified by:
_reallocate in class BaseArray

_slice

public Double.Array _slice(int dimen,
                           int[] numElem,
                           int[] srcStart,
                           int[] srcStride,
                           int[] newStart)
Slice returns an array that is <= the orignial array. It shares data with the orginal array. dimen gives the number of dimensions in the result array numElem array gives the number of elements in each dimension srcStart gives the array index to start the result array at srcStride gives the stride of the result array's elements over the original array's elements. See the Babel user's manual for more information.


_smartCopy

public Double.Array _smartCopy()
Method smartCopy returns a a copy of a borrowed array, or increments the reference count of an array that manages it's own data. Useful if you wish to keep a copy of an incoming array


_copy

public void _copy(Double.Array dest)
Method Copy copies the elements of 'this' to an already existing array of the same size. NOT LIKE clone()!!


_dcast

public Double.Array _dcast()
Casts this array to an array of a defined dimension and returns the resulting array. (You might want to deallocate the original array. Argument dimen determines what dimension array to cast this array to.