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.


Variable Index

 o data
 o n0
 o n1
 o n2
 o w0
 o w1
 o w2
 o w3

Constructor Index

 o doubleArray3D(double[], Range, Range, Range)
Create a 3-dimensional array as a section of another array.
 o doubleArray3D(double[][][])
Create a 3-dimensional array, with shape and values defined by a Java double[][][] array.
 o doubleArray3D(int, int, int)
Create a 3-dimensional array of a certain shape.

Method Index

 o assign(double)
Assign a scalar value to all elements of the array.
 o assign(doubleArray3D)
Assign the values from another three-dimensional array to this array.
 o get(int, int, int)
Return the value of an element of the array.
 o get(int[])
Return the value of an element of the array.
 o rank()
Return the rank of the 3-dimensional array, i.e.
 o section(int, int, int)
Extract a 0-dimensional section from the array.
 o section(int, int, Range)
Extract a 1-dimensional section from the array.
 o section(int, Range, int)
Extract a 1-dimensional section from the array.
 o section(int, Range, Range)
Extract a 2-dimensional section from the array.
 o section(Range, int, int)
Extract a 1-dimensional section from the array.
 o section(Range, int, Range)
Extract a 2-dimensional section from the array.
 o section(Range, Range, int)
Extract a 2-dimensional section from the array.
 o section(Range, Range, Range)
Extract a 3-dimensional section from the array.
 o set(int, int, int, double)
Set the value of an element of the array.
 o set(int[], double)
Set the value of an element of the array.
 o setf(int, int, int, double)
Set the value of an element of the array, no check.
 o shape()
Return the shape of the array as an int[] I of length 3.
 o size()
Return the number of elements in the array.
 o size(int)
Return the extent of the array along its i-th axis.

Variables

 o data
 protected double data[]
 o n0
 protected int n0
 o n1
 protected int n1
 o n2
 protected int n2
 o w0
 protected int w0
 o w1
 protected int w1
 o w2
 protected int w2
 o w3
 protected int w3

Constructors

 o 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
 o 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
 o 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).

Methods

 o rank
 public int rank()
Return the rank of the 3-dimensional array, i.e. 3.

Overrides:
rank in class doubleArray
 o size
 public int size()
Return the number of elements in the array.

Overrides:
size in class doubleArray
 o 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
 o 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
 o 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
 o 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
 o 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.
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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.
 o assign
 public void assign(double d)
Assign a scalar value to all elements of the array.

Parameters:
d - value to be assigned
 o 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