All Packages Class Hierarchy This Package Previous Next Index
Class array.doubleArray3D
java.lang.Object
|
+----array.doubleArray
|
+----array.doubleArray3D
- public final class doubleArray3D
- extends doubleArray
doubleArray3D = 3-dimensional array of doubles
The doubleArray3D concrete class implements 3-dimensional arrays
of doubles. 3-dimensional arrays can either be instantiated directly
through constructors, or they can be
generated by extracting three-dimensional sections from
other 3- or higher-dimensional arrays.
-
data
-
-
n0
-
-
n1
-
-
n2
-
-
w0
-
-
w1
-
-
w2
-
-
w3
-
-
doubleArray3D(double[], Range, Range, Range)
- Create a 3-dimensional array as a section of another array.
-
doubleArray3D(double[][][])
- Create a 3-dimensional array, with shape and values defined by
a Java double[][][] array.
-
doubleArray3D(int, int, int)
- Create a 3-dimensional array of a certain shape.
-
assign(double)
- Assign a scalar value to all elements of the array.
-
assign(doubleArray3D)
- Assign the values from another three-dimensional array to this array.
-
get(int, int, int)
- Return the value of an element of the array.
-
get(int[])
- Return the value of an element of the array.
-
rank()
- Return the rank of the 3-dimensional array, i.e.
-
section(int, int, int)
- Extract a 0-dimensional section from the array.
-
section(int, int, Range)
- Extract a 1-dimensional section from the array.
-
section(int, Range, int)
- Extract a 1-dimensional section from the array.
-
section(int, Range, Range)
- Extract a 2-dimensional section from the array.
-
section(Range, int, int)
- Extract a 1-dimensional section from the array.
-
section(Range, int, Range)
- Extract a 2-dimensional section from the array.
-
section(Range, Range, int)
- Extract a 2-dimensional section from the array.
-
section(Range, Range, Range)
- Extract a 3-dimensional section from the array.
-
set(int, int, int, double)
- Set the value of an element of the array.
-
set(int[], double)
- Set the value of an element of the array.
-
setf(int, int, int, double)
- Set the value of an element of the array, no check.
-
shape()
- Return the shape of the array as an int[] I of length 3.
-
size()
- Return the number of elements in the array.
-
size(int)
- Return the extent of the array along its i-th axis.
data
protected double data[]
n0
protected int n0
n1
protected int n1
n2
protected int n2
w0
protected int w0
w1
protected int w1
w2
protected int w2
w3
protected int w3
doubleArray3D
public doubleArray3D(int n,
int m,
int l) throws InvalidArrayShapeException
- Create a 3-dimensional array of a certain shape.
Elements are 0-valued
- Parameters:
- n - extent of the array along 0th axis
- m - extent of the array along 1st axis
- l - extent of the array along 2nd axis
- Throws: InvalidArrayShapeException
- all extents must be nonnegative
doubleArray3D
public doubleArray3D(double a[][][]) throws InvalidArrayShapeException
- Create a 3-dimensional array, with shape and values defined by
a Java double[][][] array.
- Parameters:
- a - Java double[][][] array defining shape and values of the array
- Throws: InvalidArrayShapeException
- The Java array must be rectangular
doubleArray3D
protected doubleArray3D(double a[],
Range I,
Range J,
Range K) throws ArrayIndexOutOfBoundsException
- Create a 3-dimensional array as a section of another array.
Internal use within the package only.
A 3-dimensional array can be empty (have 0 elements).
rank
public int rank()
- Return the rank of the 3-dimensional array, i.e. 3.
- Overrides:
- rank in class doubleArray
size
public int size()
- Return the number of elements in the array.
- Overrides:
- size in class doubleArray
size
public int size(int i) throws InvalidArrayAxisException
- Return the extent of the array along its i-th axis.
- Parameters:
- i - array axis (0 <= i < rank())
- Throws: InvalidArrayAxisException
- i must be between 0 and 2
- Overrides:
- size in class doubleArray
shape
public int[] shape()
- Return the shape of the array as an int[] I of length 3.
I[0] = size(0)
I[1] = size(1)
I[2] = size(2)
- Overrides:
- shape in class doubleArray
get
public double get(int index[]) throws InvalidArrayIndexException, ArrayIndexOutOfBoundsException
- Return the value of an element of the array.
- Parameters:
- index - index[i] = index along i-th axis, 0 <= index[i] < size(i)
- Throws: InvalidArrayIndexException
- index[] must be of length 3
- Overrides:
- get in class doubleArray
set
public void set(int index[],
double d) throws InvalidArrayIndexException, ArrayIndexOutOfBoundsException
- Set the value of an element of the array.
- Parameters:
- index - index[i] = index along i-th axis, 0 <= index[i] < size(i)
- d - value to which element is set
- Throws: InvalidArrayIndexException
- index[] must be of length 3
- Overrides:
- set in class doubleArray
get
public double get(int i,
int j,
int k) throws ArrayIndexOutOfBoundsException
- Return the value of an element of the array.
- Parameters:
- i - index along the 0th axis of the array.
- j - index along the 1st axis of the array.
- k - index along the 2nd axis of the array.
set
public void set(int i,
int j,
int k,
double val) throws ArrayIndexOutOfBoundsException
- Set the value of an element of the array.
- Parameters:
- i - index along the 0th axis of the array
- j - index along the 1st axis of the array
- k - index along the 2nd axis of the array
- d - value to which element is set
setf
public void setf(int i,
int j,
int k,
double val) throws ArrayIndexOutOfBoundsException
- Set the value of an element of the array, no check.
- Parameters:
- i - index along the 0th axis of the array
- j - index along the 1st axis of the array
- k - index along the 2nd axis of the array
- d - value to which element is set
section
public doubleArray3D section(Range I,
Range J,
Range K) throws InvalidRangeException
- Extract a 3-dimensional section from the array.
- Parameters:
- I - range of indices along 0th axis defining the section
- J - range of indices along 1st axis defining the section
- K - range of indices along 2nd axis defining the section
- Throws: InvalidRangeException
- ranges of indices must be within bounds of axes
section
public doubleArray2D section(Range I,
Range J,
int k) throws InvalidRangeException
- Extract a 2-dimensional section from the array.
- Parameters:
- I - range of indices along 0th axis defining the section
- J - range of indices along 1st axis defining the section
- k - index along 2nd axis defining the section
- Throws: InvalidRangeException
- ranges of indices must be within bounds of axes
section
public doubleArray2D section(Range I,
int j,
Range K) throws InvalidRangeException
- Extract a 2-dimensional section from the array.
- Parameters:
- I - range of indices along 0th axis defining the section
- j - index along 1st axis defining the section
- K - range of indices along 2nd axis defining the section
- Throws: InvalidRangeException
- ranges of indices must be within bounds of axes
section
public doubleArray2D section(int i,
Range J,
Range K) throws InvalidRangeException
- Extract a 2-dimensional section from the array.
- Parameters:
- i - index along 0th axis defining the section
- J - range of indices along 1st axis defining the section
- K - range of indices along 2nd axis defining the section
- Throws: InvalidRangeException
- ranges of indices must be within bounds of axes
section
public doubleArray1D section(Range I,
int j,
int k) throws InvalidRangeException
- Extract a 1-dimensional section from the array.
- Parameters:
- I - range of indices along 0th axis defining the section
- j - index along 1st axis defining the section
- k - index along 2nd axis defining the section
- Throws: InvalidRangeException
- range of indices must be within bounds of 0th axis
section
public doubleArray1D section(int i,
Range J,
int k) throws InvalidRangeException
- Extract a 1-dimensional section from the array.
- Parameters:
- i - index along 0th axis defining the section
- J - range of indices along 1st axis defining the section
- k - index along 2nd axis defining the section
- Throws: InvalidRangeException
- range of indices must be within bounds of 1st axis
section
public doubleArray1D section(int i,
int j,
Range K) throws InvalidRangeException
- Extract a 1-dimensional section from the array.
- Parameters:
- i - index along 0th axis defining the section
- j - index along 1st axis defining the section
- K - range of indices along 2nd axis defining the section
- Throws: InvalidRangeException
- range of indices must be within bounds of 2nd axis
section
public doubleArray0D section(int i,
int j,
int k)
- Extract a 0-dimensional section from the array.
- Parameters:
- i - index along 0th axis defining the section.
- j - index along 1st axis defining the section.
- k - index along 2nd axis defining the section.
assign
public void assign(double d)
- Assign a scalar value to all elements of the array.
- Parameters:
- d - value to be assigned
assign
public void assign(doubleArray3D a) throws NonconformingArrayException
- Assign the values from another three-dimensional array to this array.
- Parameters:
- a - array with source values
- Throws: NonconformingArrayException
- arrays must be of same shape
All Packages Class Hierarchy This Package Previous Next Index