Abstract base class for 3-d matrices holding double elements.
First see the package summary and javadoc tree view to get the broad picture.

A matrix has a number of slices, rows and columns, which are assigned upon instance construction - The matrix's size is then slices()*rows()*columns().
Elements are accessed via [slice,row,column] coordinates.
Legal coordinates range from [0,0,0] to [slices()-1,rows()-1,columns()-1].
Any attempt to access an element at a coordinate slice<0 || slice>=slices() || row<0 || row>=rows() || column<0 || column>=column() will throw an IndexOutOfBoundsException.

aggregate

Applies a function to each cell and aggregates the results.
Returns a value v such that v==a(size()) where a(i) == aggr( a(i-1), f(get(slice,row,column)) ) and terminators are a(1) == f(get(0,0,0)), a(0)==Double.NaN.

aggregate

Applies a function to each corresponding cell of two matrices and aggregates the results.
Returns a value v such that v==a(size()) where a(i) == aggr( a(i-1), f(get(slice,row,column),other.get(slice,row,column)) ) and terminators are a(1) == f(get(0,0,0),other.get(0,0,0)), a(0)==Double.NaN.

assign

Replaces all cell values of the receiver with the values of another matrix.
Both matrices must have the same number of slices, rows and columns.
If both matrices share the same cells (as is the case if they are views derived from the same matrix) and intersect in an ambiguous way, then replaces as if using an intermediate auxiliary deep copy of other.

Parameters:

other - the source matrix to copy from (may be identical to the receiver).

equals

Compares this object against the specified object.
The result is true if and only if the argument is
not null and is at least a DoubleMatrix3D object
that has the same number of slices, rows and columns as the receiver and
has exactly the same values at the same coordinates.

getNonZeros

Fills the coordinates and values of cells having non-zero values into the specified lists.
Fills into the lists, starting at index 0.
After this call returns the specified lists all have a new size, the number of non-zero values.

In general, fill order is unspecified.
This implementation fill like: for (slice = 0..slices-1) for (row = 0..rows-1) for (column = 0..colums-1) do ... .
However, subclasses are free to us any other order, even an order that may change over time as cell values are changed.
(Of course, result lists indexes are guaranteed to correspond to the same cell).
For an example, see DoubleMatrix2D.getNonZeros(IntArrayList,IntArrayList,DoubleArrayList).

Parameters:

sliceList - the list to be filled with slice indexes, can have any size.

rowList - the list to be filled with row indexes, can have any size.

columnList - the list to be filled with column indexes, can have any size.

valueList - the list to be filled with values, can have any size.

getQuick

public abstract double getQuick(int slice,
int row,
int column)

Returns the matrix cell value at coordinate [slice,row,column].

Provided with invalid parameters this method may return invalid objects without throwing any exception.
You should only use this method when you are absolutely sure that the coordinate is within bounds.
Precondition (unchecked): slice<0 || slice>=slices() || row<0 || row>=rows() || column<0 || column>=column().

Parameters:

slice - the index of the slice-coordinate.

row - the index of the row-coordinate.

column - the index of the column-coordinate.

Returns:

the value at the specified coordinate.

like

Construct and returns a new empty matrix of the same dynamic type as the receiver, having the same number of slices, rows and columns.
For example, if the receiver is an instance of type DenseDoubleMatrix3D the new matrix must also be of type DenseDoubleMatrix3D,
if the receiver is an instance of type SparseDoubleMatrix3D the new matrix must also be of type SparseDoubleMatrix3D, etc.
In general, the new matrix should have internal parametrization as similar as possible.

Returns:

a new empty matrix of the same dynamic type.

like

Construct and returns a new empty matrix of the same dynamic type as the receiver, having the specified number of slices, rows and columns.
For example, if the receiver is an instance of type DenseDoubleMatrix3D the new matrix must also be of type DenseDoubleMatrix3D,
if the receiver is an instance of type SparseDoubleMatrix3D the new matrix must also be of type SparseDoubleMatrix3D, etc.
In general, the new matrix should have internal parametrization as similar as possible.

Parameters:

slices - the number of slices the matrix shall have.

rows - the number of rows the matrix shall have.

columns - the number of columns the matrix shall have.

Returns:

a new empty matrix of the same dynamic type.

set

public void set(int slice,
int row,
int column,
double value)

Sets the matrix cell at coordinate [slice,row,column] to the specified value.

setQuick

Sets the matrix cell at coordinate [slice,row,column] to the specified value.

Provided with invalid parameters this method may access illegal indexes without throwing any exception.
You should only use this method when you are absolutely sure that the coordinate is within bounds.
Precondition (unchecked): slice<0 || slice>=slices() || row<0 || row>=rows() || column<0 || column>=column().

Parameters:

slice - the index of the slice-coordinate.

row - the index of the row-coordinate.

column - the index of the column-coordinate.

value - the value to be filled into the specified cell.

toArray

public double[][][] toArray()

Constructs and returns a 2-dimensional array containing the cell values.
The returned array values has the form values[slice][row][column]
and has the same number of slices, rows and columns as the receiver.

The values are copied. So subsequent changes in values are not reflected in the matrix, and vice-versa.

Returns:

an array filled with the values of the cells.

toString

viewColumn

Constructs and returns a new 2-dimensional slice view representing the slices and rows of the given column.
The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa.

To obtain a slice view on subranges, construct a sub-ranging view (view().part(...)), then apply this method to the sub-range view.
To obtain 1-dimensional views, apply this method, then apply another slice view (methods viewColumn, viewRow) on the intermediate 2-dimensional view.
To obtain 1-dimensional views on subranges, apply both steps.

viewColumnFlip

Constructs and returns a new flip view along the column axis.
What used to be column 0 is now column columns()-1, ..., what used to be column columns()-1 is now column 0.
The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa.

viewDice

Constructs and returns a new dice view; Swaps dimensions (axes); Example: 3 x 4 x 5 matrix --> 4 x 3 x 5 matrix.
The view has dimensions exchanged; what used to be one axis is now another, in all desired permutations.
The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa.

viewPart

Constructs and returns a new sub-range view that is a depth x height x width sub matrix starting at [slice,row,column];
Equivalent to view().part(slice,row,column,depth,height,width); Provided for convenience only.
The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa.

viewRow

Constructs and returns a new 2-dimensional slice view representing the slices and columns of the given row.
The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa.

To obtain a slice view on subranges, construct a sub-ranging view (view().part(...)), then apply this method to the sub-range view.
To obtain 1-dimensional views, apply this method, then apply another slice view (methods viewColumn, viewRow) on the intermediate 2-dimensional view.
To obtain 1-dimensional views on subranges, apply both steps.

viewRowFlip

Constructs and returns a new flip view along the row axis.
What used to be row 0 is now row rows()-1, ..., what used to be row rows()-1 is now row 0.
The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa.

viewSelection

Constructs and returns a new selection view that is a matrix holding the indicated cells.
There holds view.slices() == sliceIndexes.length, view.rows() == rowIndexes.length, view.columns() == columnIndexes.length and
view.get(k,i,j) == this.get(sliceIndexes[k],rowIndexes[i],columnIndexes[j]).
Indexes can occur multiple times and can be in arbitrary order.
For an example see DoubleMatrix2D.viewSelection(int[],int[]).

Note that modifying the index arguments after this call has returned has no effect on the view.
The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa.

Parameters:

sliceIndexes - The slices of the cells that shall be visible in the new view. To indicate that all slices shall be visible, simply set this parameter to null.

rowIndexes - The rows of the cells that shall be visible in the new view. To indicate that all rows shall be visible, simply set this parameter to null.

columnIndexes - The columns of the cells that shall be visible in the new view. To indicate that all columns shall be visible, simply set this parameter to null.

viewSelection

Constructs and returns a new selection view that is a matrix holding all slices matching the given condition.
Applies the condition to each slice and takes only those where condition.apply(viewSlice(i)) yields true.
To match rows or columns, use a dice view.

viewSlice

Constructs and returns a new 2-dimensional slice view representing the rows and columns of the given slice.
The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa.

To obtain a slice view on subranges, construct a sub-ranging view (view().part(...)), then apply this method to the sub-range view.
To obtain 1-dimensional views, apply this method, then apply another slice view (methods viewColumn, viewRow) on the intermediate 2-dimensional view.
To obtain 1-dimensional views on subranges, apply both steps.

viewSliceFlip

Constructs and returns a new flip view along the slice axis.
What used to be slice 0 is now slice slices()-1, ..., what used to be slice slices()-1 is now slice 0.
The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa.

viewSorted

Sorts the matrix slices into ascending order, according to the natural ordering of the matrix values in the given [row,column] position.
This sort is guaranteed to be stable.
For further information, see Sorting.sort(DoubleMatrix3D,int,int).
For more advanced sorting functionality, see Sorting.

viewStrides

Constructs and returns a new stride view which is a sub matrix consisting of every i-th cell.
More specifically, the view has this.slices()/sliceStride slices and this.rows()/rowStride rows and this.columns()/columnStride columns
holding cells this.get(k*sliceStride,i*rowStride,j*columnStride) for all k = 0..slices()/sliceStride - 1, i = 0..rows()/rowStride - 1, j = 0..columns()/columnStride - 1.
The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa.