All Packages Class Hierarchy This Package Previous Next Index
Class array.doubleArray2D
java.lang.Object
|
+----array.doubleArray
|
+----array.doubleArray2D
- public final class doubleArray2D
- extends doubleArray
doubleArray2D = 2-dimensional array of doubles
The doubleArray2D concrete class implementes 2-dimensional arrays
of doubles. 2-dimensional arrays can either be instantiated directly
through constructors, or they can be
generated by extracting two-dimensional sections from
other 2- or higher-dimensional arrays.
-
data
-
-
n0
-
-
n1
-
-
w0
-
-
w1
-
-
w2
-
-
doubleArray2D(double[], Range, Range)
- Create a 2-dimensional array as a section of another array.
-
doubleArray2D(double[][])
- Create a 2-dimensional array, with shape and values defined by
a Java double[][] array.
-
doubleArray2D(int, int)
- Create a 2-dimensional array of a certain shape.
-
assign(double)
- Assign a scalar value to all elements of the array.
-
assign(doubleArray2D)
- Assign the values from another two-dimensional array to this array.
-
divide(doubleArray2D)
- Divide elements of this array by the corresponding elements
of another array b.
-
get(Index, Index)
- Return another doubleArray2D with the values of the
specified elements.
-
get(Index, Index, doubleArray2D)
- Extract selected elements of this doubleArray2D into another
doubleArray2D.
-
get(Index, int)
- Extract selected elements of this doubleArray2D into a doubleArray1D.
-
get(Index, int, doubleArray1D)
- Extract selected elements of this doubleArray2D into a doubleArray1D.
-
get(Index, Range)
- Return another doubleArray2D with the values of the
specified elements.
-
get(Index, Range, doubleArray2D)
- Extract selected elements of this doubleArray2D into another
doubleArray2D.
-
get(int, Index)
- Extract selected elements of this doubleArray2D into a doubleArray1D.
-
get(int, Index, doubleArray1D)
- Extract selected elements of this doubleArray2D into a doubleArray1D.
-
get(int, int)
- Return the value of an element of the array.
-
get(int, Range)
- Extract selected elements of this doubleArray2D into a doubleArray1D.
-
get(int, Range, doubleArray1D)
- Extract selected elements of this doubleArray2D into a doubleArray1D.
-
get(int[])
- Return the value of an element of the array.
-
get(Range, Index)
- Return another doubleArray2D with the values of the
specified elements.
-
get(Range, Index, doubleArray2D)
- Extract selected elements of this doubleArray2D into another
doubleArray2D.
-
get(Range, int)
- Extract selected elements of this doubleArray2D into a doubleArray1D.
-
get(Range, int, doubleArray1D)
- Extract selected elements of this doubleArray2D into a doubleArray1D.
-
get(Range, Range)
- Return another doubleArray2D with the values of the
specified elements.
-
get(Range, Range, doubleArray2D)
- Extract selected elements of this doubleArray2D into another
doubleArray2D.
-
getf(int, int)
- Return the value of an element of the array, no check.
-
permuteAxes(int, int)
- Permute the axes of this array, thus creating a reference
to its transpose.
-
range(int)
- Return the range of array indices along its i-th axis.
-
rank()
- Return the rank of the 2-dimensional array, i.e.
-
reshape(int)
- Reshape this two-dimensional array into a one-dimensional array.
-
reshape(int, int)
- Reshape this two-dimensional array into another two-dimensional array.
-
reshape(int, int, int)
- Reshape this two-dimensional array into a three-dimensional array.
-
section(int, int)
- Extract a 0-dimensional section from the array.
-
section(int, Range)
- Extract a 1-dimensional section from the array.
-
section(Range, int)
- Extract a 1-dimensional section from the array.
-
section(Range, Range)
- Extract a 2-dimensional section from the array.
-
set(Index, Index, double)
- Set the value of a list of elements of the array.
-
set(Index, Index, doubleArray2D)
- Set the value of a list of elements of the array.
-
set(Index, int, double)
- Set the value of a list of elements of the array.
-
set(Index, int, doubleArray1D)
- Set the value of a list of elements of the array.
-
set(Index, Range, double)
- Set the value of a list of elements of the array.
-
set(Index, Range, doubleArray2D)
- Set the value of a list of elements of the array.
-
set(int, Index, double)
- Set the value of a list of elements of the array.
-
set(int, Index, doubleArray1D)
- Set the value of a list of elements of the array.
-
set(int, int, double)
- Set the value of an element of the array.
-
set(int, Range, double)
- Set the value of a list of elements of the array.
-
set(int, Range, doubleArray1D)
- Set the value of a list of elements of the array.
-
set(int[], double)
- Set the value of an element of the array.
-
set(Range, Index, double)
- Set the value of a list of elements of the array.
-
set(Range, Index, doubleArray2D)
- Set the value of a list of elements of the array.
-
set(Range, int, double)
- Set the value of a list of elements of the array.
-
set(Range, int, doubleArray1D)
- Set the value of a list of elements of the array.
-
set(Range, Range, double)
- Set the value of a list of elements of the array.
-
set(Range, Range, doubleArray2D)
- Set the value of a list of elements of the array.
-
setf(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 2.
-
size()
- Return the number of elements in the array.
-
size(int)
- Return the extent of the array along its i-th axis.
-
toJava()
- Transforms this doubleArray2D to a double[].
data
protected double data[]
n0
protected int n0
n1
protected int n1
w0
protected int w0
w1
protected int w1
w2
protected int w2
doubleArray2D
public doubleArray2D(int n,
int m) throws InvalidArrayShapeException
- Create a 2-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
- Throws: InvalidArrayShapeException
- all extents must be nonnegative
doubleArray2D
public doubleArray2D(double a[][]) throws InvalidArrayShapeException
- Create a 2-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
doubleArray2D
protected doubleArray2D(double a[],
Range I,
Range J) throws ArrayIndexOutOfBoundsException
- Create a 2-dimensional array as a section of another array.
Internal use within the package only.
A 2-dimensional array can be empty (have 0 elements).
rank
public int rank()
- Return the rank of the 2-dimensional array, i.e. 2.
- 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 1
- Overrides:
- size in class doubleArray
shape
public int[] shape()
- Return the shape of the array as an int[] I of length 2.
I[0] = size(0)
I[1] = size(1)
- Overrides:
- shape in class doubleArray
range
public Range range(int i) throws InvalidArrayAxisException
- Return the range of array indices along its i-th axis.
- Parameters:
- i - array axis (0 <= i < rank())
- Throws: InvalidArrayAxisException
- i must be between 0 and 1
permuteAxes
public doubleArray2D permuteAxes(int a0,
int a1) throws InvalidArrayAxisException
- Permute the axes of this array, thus creating a reference
to its transpose.
- Parameters:
- a0 - axis to appear as 0th axis (0 or 1)
- a1 - axis to appear as 1st axis (0 or 1)
- Throws: InvalidArrayAxisException
- 0 <= a0,a1 <= 1
reshape
public doubleArray1D reshape(int m) throws NonconformingArrayException
- Reshape this two-dimensional array into a one-dimensional array.
- Parameters:
- m - extent of resulting array along 0th axis
- Throws: NonconformingArrayException
- m must be equal to size of this
reshape
public doubleArray2D reshape(int m0,
int m1) throws NonconformingArrayException
- Reshape this two-dimensional array into another two-dimensional array.
- Parameters:
- m0 - extent of resulting array along 0th axis
- m1 - extent of resulting array along 1st axis
- Throws: NonconformingArrayException
- m0*m1*m2 must be equal to size of this
reshape
public doubleArray3D reshape(int m0,
int m1,
int m2) throws NonconformingArrayException
- Reshape this two-dimensional array into a three-dimensional array.
- Parameters:
- m0 - extent of resulting array along 0th axis
- m1 - extent of resulting array along 1st axis
- m2 - extent of resulting array along 2nd axis
- Throws: NonconformingArrayException
- m0*m1*m2 must be equal to size of this
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 2
- 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 2
- Overrides:
- set in class doubleArray
get
public double get(int i,
int j) 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.
getf
protected double getf(int i,
int j) throws ArrayIndexOutOfBoundsException
- Return 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.
get
public doubleArray1D get(int idx0,
Index idx1) throws ArrayIndexOutOfBoundsException
- Extract selected elements of this doubleArray2D into a doubleArray1D.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - index along the 1st axis of the array
get
public doubleArray1D get(int idx0,
Index idx1,
doubleArray1D result) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Extract selected elements of this doubleArray2D into a doubleArray1D.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - index along the 1st axis of the array
- result - resulting array
- Throws: NonconformingArrayException
- shapes must match
get
public doubleArray1D get(int idx0,
Range idx1) throws ArrayIndexOutOfBoundsException
- Extract selected elements of this doubleArray2D into a doubleArray1D.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - index along the 1st axis of the array
get
public doubleArray1D get(int idx0,
Range idx1,
doubleArray1D result) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Extract selected elements of this doubleArray2D into a doubleArray1D.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - index along the 1st axis of the array
- result - resulting array
- Throws: NonconformingArrayException
- shapes must match
get
public doubleArray1D get(Range idx0,
int idx1) throws ArrayIndexOutOfBoundsException
- Extract selected elements of this doubleArray2D into a doubleArray1D.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - index along the 1st axis of the array
get
public doubleArray1D get(Range idx0,
int idx1,
doubleArray1D result) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Extract selected elements of this doubleArray2D into a doubleArray1D.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - index along the 1st axis of the array
- result - resulting array
- Throws: NonconformingArrayException
- shapes must match
get
public doubleArray1D get(Index idx0,
int idx1) throws ArrayIndexOutOfBoundsException
- Extract selected elements of this doubleArray2D into a doubleArray1D.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - index along the 1st axis of the array
get
public doubleArray1D get(Index idx0,
int idx1,
doubleArray1D result) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Extract selected elements of this doubleArray2D into a doubleArray1D.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - index along the 1st axis of the array
- result - resulting array
- Throws: NonconformingArrayException
- shapes must match
get
public doubleArray2D get(Index idx0,
Index idx1) throws ArrayIndexOutOfBoundsException
- Return another doubleArray2D with the values of the
specified elements.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
get
public doubleArray2D get(Index idx0,
Index idx1,
doubleArray2D result) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Extract selected elements of this doubleArray2D into another
doubleArray2D.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- result - array where elements are stored
- Throws: NonconformingArrayException
- shapes must match
get
public doubleArray2D get(Range idx0,
Index idx1) throws ArrayIndexOutOfBoundsException
- Return another doubleArray2D with the values of the
specified elements.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
get
public doubleArray2D get(Range idx0,
Index idx1,
doubleArray2D result) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Extract selected elements of this doubleArray2D into another
doubleArray2D.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- result - array where elements are stored
- Throws: NonconformingArrayException
- shapes must match
get
public doubleArray2D get(Range idx0,
Range idx1) throws ArrayIndexOutOfBoundsException
- Return another doubleArray2D with the values of the
specified elements.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
get
public doubleArray2D get(Range idx0,
Range idx1,
doubleArray2D result) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Extract selected elements of this doubleArray2D into another
doubleArray2D.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- result - array where elements are stored
- Throws: NonconformingArrayException
- shapes must match
get
public doubleArray2D get(Index idx0,
Range idx1) throws ArrayIndexOutOfBoundsException
- Return another doubleArray2D with the values of the
specified elements.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
get
public doubleArray2D get(Index idx0,
Range idx1,
doubleArray2D result) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Extract selected elements of this doubleArray2D into another
doubleArray2D.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- result - array where elements are stored
- Throws: NonconformingArrayException
- shapes must match
set
public void set(int i,
int j,
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
- d - value to which element is set
setf
protected void setf(int i,
int j,
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
- d - value to which element is set
set
public void set(int idx0,
Index idx1,
doubleArray1D val) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- val - list of values for elements
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
- Throws: NonconformingArrayException
- shapes must match
set
public void set(int idx0,
Index idx1,
double val) throws ArrayIndexOutOfBoundsException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- val - list of values for elements
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
set
public void set(int idx0,
Range idx1,
doubleArray1D val) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- val - list of values for elements
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
- Throws: NonconformingArrayException
- shapes must match
set
public void set(int idx0,
Range idx1,
double val) throws ArrayIndexOutOfBoundsException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- val - list of values for elements
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
set
public void set(Index idx0,
int idx1,
doubleArray1D val) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- val - list of values for elements
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
- Throws: NonconformingArrayException
- shapes must match
set
public void set(Index idx0,
int idx1,
double val) throws ArrayIndexOutOfBoundsException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- val - list of values for elements
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
set
public void set(Range idx0,
int idx1,
doubleArray1D val) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- val - list of values for elements
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
- Throws: NonconformingArrayException
- shapes must match
set
public void set(Range idx0,
int idx1,
double val) throws ArrayIndexOutOfBoundsException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- val - list of values for elements
set
public void set(Index idx0,
Index idx1,
double val) throws ArrayIndexOutOfBoundsException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- val - value for elements
set
public void set(Index idx0,
Index idx1,
doubleArray2D val) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indices along the 0th axis of the array
- idx1 - indices along the 1st axis of the array
- val - list of values for elements
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
- Throws: NonconformingArrayException
- shapes must match
set
public void set(Range idx0,
Index idx1,
doubleArray2D val) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indices along the 0th axis of the array
- idx1 - indices along the 1st axis of the array
- val - list of values for elements
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
- Throws: NonconformingArrayException
- shapes must match
set
public void set(Range idx0,
Index idx1,
double val) throws ArrayIndexOutOfBoundsException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- val - value for elements
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
set
public void set(Range idx0,
Range idx1,
doubleArray2D val) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indices along the 0th axis of the array
- idx1 - indices along the 1st axis of the array
- val - list of values for elements
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
- Throws: NonconformingArrayException
- shapes must match
set
public void set(Range idx0,
Range idx1,
double val) throws ArrayIndexOutOfBoundsException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- val - value for elements
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
set
public void set(Index idx0,
Range idx1,
doubleArray2D val) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indices along the 0th axis of the array
- idx1 - indices along the 1st axis of the array
- val - list of values for elements
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
- Throws: NonconformingArrayException
- shapes must match
set
public void set(Index idx0,
Range idx1,
double val) throws ArrayIndexOutOfBoundsException
- Set the value of a list of elements of the array.
- Parameters:
- idx0 - indexes along the 0th axis of the array
- idx1 - indexes along the 1st axis of the array
- val - value for elements
section
public doubleArray2D section(Range I,
Range J) 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
- Throws: InvalidRangeException
- ranges of indices must be within bounds of axes
section
public doubleArray1D section(Range I,
int j) 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
- Throws: InvalidRangeException
- range of indices must be within bounds of 0th axis
section
public doubleArray1D section(int i,
Range J) 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
- Throws: InvalidRangeException
- range of indices must be within bounds of 1st axis
section
public doubleArray0D section(int i,
int j)
- 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.
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(doubleArray2D a) throws NonconformingArrayException
- Assign the values from another two-dimensional array to this array.
- Parameters:
- a - array with source values
- Throws: NonconformingArrayException
- arrays must be of same shape
divide
public doubleArray2D divide(doubleArray2D b) throws NonconformingArrayException
- Divide elements of this array by the corresponding elements
of another array b.
- Parameters:
- a - array with divisor values
- Throws: NonconformingArrayException
- b and this must have same shape
toJava
public double[][] toJava()
- Transforms this doubleArray2D to a double[].
All Packages Class Hierarchy This Package Previous Next Index