All Packages Class Hierarchy This Package Previous Next Index
Class array.doubleArray1D
java.lang.Object
|
+----array.doubleArray
|
+----array.doubleArray1D
- public final class doubleArray1D
- extends doubleArray
doubleArray1D = 1-dimensional array of doubles
The doubleArray1D concrete class implements 1-dimensional arrays
of doubles. 1-dimensional arrays can either be instantiated directly
through constructors, or they can be
generated by extracting single-dimensional sections from
other 1- or higher-dimensional arrays.
-
data
-
-
n0
-
-
w0
-
-
w1
-
-
doubleArray1D(double[])
- Create a 1-dimensional array, with size and values defined
by a Java array of doubles.
-
doubleArray1D(double[], Range)
- Create a 1-dimensional array as a section of another array.
-
doubleArray1D(int)
- Create a 1-dimensional array of a certain size.
-
assign(double)
- Assign a scalar value to all elements of the array.
-
assign(doubleArray1D)
- Assign the values from another one-dimensional array to this array.
-
get(Index)
- Return another doubleArray1D with the values of the
specified elements.
-
get(Index, doubleArray1D)
- Return another doubleArray1D with the values of the
specified elements.
-
get(int)
- Return the value of an element of the array.
-
get(int[])
- Return the value of an element of the array.
-
get(Range)
- Return another doubleArray1D with the values of the
specified elements.
-
get(Range, doubleArray1D)
- Return another doubleArray1D with the values of the
specified elements.
-
getf(int)
- Return the value of an element of the array, no check.
-
permuteAxes(int)
- Permute the axis of this array.
-
range(int)
- Return the range of array indices along its i-th axis.
-
rank()
- Return the rank of the 1-dimensional array, i.e.
-
reshape(int, int)
- Reshape this one-dimensional array into a two-dimensional array.
-
reshape(int, int, int)
- Reshape this one-dimensional array into a three-dimensional array.
-
section(int)
- Extract a 0-dimensional section from the array.
-
section(Range)
- Extract a 1-dimensional section from the array.
-
set(Index, double)
- Set the value of a list of elements of the array.
-
set(Index, 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(int[], double)
- Set the value of an element of the array.
-
set(Range, double)
- Set the value of a list of elements of the array.
-
set(Range, doubleArray1D)
- Set the value of a list of elements of the array.
-
setf(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 1.
-
size()
- Return the number of elements in the array.
-
size(int)
- Return the extent of the array along its i-th axis.
-
spread(int, int, doubleArray2D)
- Replicates an array by adding a dimension.
-
toJava()
- Transforms this doubleArray1D to a double[].
data
protected double data[]
n0
protected int n0
w0
protected int w0
w1
protected int w1
doubleArray1D
public doubleArray1D(int n) throws InvalidArrayShapeException
- Create a 1-dimensional array of a certain size.
Elements are 0-valued.
- Parameters:
- n - number of elements in array.
- Throws: InvalidArrayShapeException
- extent must be nonnegative
doubleArray1D
public doubleArray1D(double a[]) throws InvalidArrayShapeException
- Create a 1-dimensional array, with size and values defined
by a Java array of doubles.
- Parameters:
- a - Java array defining size and values of the array.
- Throws: InvalidArrayShapeException
- Java array must exist
doubleArray1D
protected doubleArray1D(double a[],
Range I) throws ArrayIndexOutOfBoundsException
- Create a 1-dimensional array as a section of another array.
Internal use within the package only.
A 1-dimensional array can be empty (have 0 elements).
rank
public int rank()
- Return the rank of the 1-dimensional array, i.e. 1.
- 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 1.
I[0] = size(0)
- 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 0
permuteAxes
public doubleArray1D permuteAxes(int a0) throws InvalidArrayAxisException
- Permute the axis of this array.
For a one-dimensional array, this is the identity operator.
- Parameters:
- a0 - axis to appear as 0th axis (must be 0)
- Throws: InvalidArrayAxisException
- a0 must be 0
reshape
public doubleArray2D reshape(int m0,
int m1) throws NonconformingArrayException
- Reshape this one-dimensional array into a two-dimensional array.
- Parameters:
- m0 - extent of resulting array along 0th axis
- m1 - extent of resulting array along 1st axis
- Throws: NonconformingArrayException
- m0*m1 must be equal to size of this
reshape
public doubleArray3D reshape(int m0,
int m1,
int m2) throws NonconformingArrayException
- Reshape this one-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 1
- 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 1
- Overrides:
- set in class doubleArray
get
public double get(int i) throws ArrayIndexOutOfBoundsException
- Return the value of an element of the array.
- Parameters:
- i - index along the 0-th axis of the array.
getf
protected double getf(int i)
- Return the value of an element of the array, no check.
- Parameters:
- i - index along the 0-th axis of the array.
get
public doubleArray1D get(Index idx,
doubleArray1D result) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Return another doubleArray1D with the values of the
specified elements.
- Parameters:
- idx - indexes along the 0-th axis of the array.
- result - resulting array
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
- Throws: NonconformingArrayException
- result must have proper shape
get
public doubleArray1D get(Index idx) throws ArrayIndexOutOfBoundsException
- Return another doubleArray1D with the values of the
specified elements.
- Parameters:
- idx - indexes along the 0-th axis of the array.
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
get
public doubleArray1D get(Range idx,
doubleArray1D result) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Return another doubleArray1D with the values of the
specified elements.
- Parameters:
- idx - indexes along the 0-th axis of the array.
- result - resulting array
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
- Throws: NonconformingArrayException
- result must have proper shape
get
public doubleArray1D get(Range idx) throws ArrayIndexOutOfBoundsException
- Return another doubleArray1D with the values of the
specified elements.
- Parameters:
- idx - indexes along the 0-th axis of the array.
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
set
public void set(int i,
double val) throws ArrayIndexOutOfBoundsException
- Set the value of an element of the array.
- Parameters:
- i - index along the 0-th axis of the array
- val - value to which element is set
setf
protected void setf(int i,
double val)
- Set the value of an element of the array, no check
- Parameters:
- i - index along the 0-th axis of the array
- val - value to which element is set
set
public void set(Index idx,
doubleArray1D val) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Set the value of a list of elements of the array.
- Parameters:
- idx - indexes along the 0-th axis of the array
- val - list of values for elements
- Throws: NonconformingArrayException
- shapes must match
set
public void set(Index idx,
double val) throws ArrayIndexOutOfBoundsException
- Set the value of a list of elements of the array.
- Parameters:
- idx - indexes along the 0-th axis of the array
- val - value for elements
set
public void set(Range idx,
doubleArray1D val) throws ArrayIndexOutOfBoundsException, NonconformingArrayException
- Set the value of a list of elements of the array.
- Parameters:
- idx - indexes along the 0-th axis of the array
- val - list of values for elements
- Throws: NonconformingArrayException
- shapes must match
set
public void set(Range idx,
double val) throws ArrayIndexOutOfBoundsException
- Set the value of a list of elements of the array.
- Parameters:
- idx - indexes along the 0-th axis of the array
- val - value for elements
section
public doubleArray1D section(Range I) throws InvalidRangeException
- Extract a 1-dimensional section from the array.
- Parameters:
- I - range of indices defining the section
- Throws: InvalidRangeException
- range of indices must be within bounds
section
public doubleArray0D section(int i)
- Extract a 0-dimensional section from the array.
- Parameters:
- i - index of the element 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(doubleArray1D a) throws NonconformingArrayException
- Assign the values from another one-dimensional array to this array.
- Parameters:
- a - array with source values
- Throws: NonconformingArrayException
- arrays must be of same shape
spread
public void spread(int axis,
int copies,
doubleArray2D result) throws NonconformingArrayException, InvalidArrayAxisException
- Replicates an array by adding a dimension.
- Parameters:
- axis - axis along which replication is performed
- copies - number of copies along that axis
- result - resulting array
- Throws: NonconformingArrayException
- result array must be of right shape
- Throws: InvalidArrayAxisException
- 0 <= axis <= 1
toJava
public double[] toJava()
- Transforms this doubleArray1D to a double[].
All Packages Class Hierarchy This Package Previous Next Index