Parallel Colt 0.9.4

cern.colt.matrix.tdcomplex.impl
Class WrapperDComplexMatrix3D

java.lang.Object
  extended by cern.colt.PersistentObject
      extended by cern.colt.matrix.AbstractMatrix
          extended by cern.colt.matrix.AbstractMatrix3D
              extended by cern.colt.matrix.tdcomplex.DComplexMatrix3D
                  extended by cern.colt.matrix.tdcomplex.impl.WrapperDComplexMatrix3D
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
DenseLargeDComplexMatrix3D

public class WrapperDComplexMatrix3D
extends DComplexMatrix3D

3-d matrix holding complex elements; either a view wrapping another matrix or a matrix whose views are wrappers.

Author:
Piotr Wendykier (piotr.wendykier@gmail.com)
See Also:
Serialized Form

Constructor Summary
WrapperDComplexMatrix3D(DComplexMatrix3D newContent)
           
 
Method Summary
 Object elements()
          Returns the elements of this matrix.
 void fft2Slices()
          Computes the 2D discrete Fourier transform (DFT) of each slice of this matrix.
 void fft3()
          Computes the 3D discrete Fourier transform (DFT) of this matrix.
 DoubleMatrix3D getImaginaryPart()
          Returns the imaginary part of this matrix
 double[] getQuick(int slice, int row, int column)
          Returns the matrix cell value at coordinate [slice,row,column].
 DoubleMatrix3D getRealPart()
          Returns the real part of this matrix
 void ifft2Slices(boolean scale)
          Computes the 2D inverse of the discrete Fourier transform (IDFT) of each slice of this matrix.
 void ifft3(boolean scale)
          Computes the 3D inverse of the discrete Fourier transform (IDFT) of this matrix.
 DComplexMatrix3D like(int slices, int rows, int columns)
          Construct and returns a new empty matrix of the same dynamic type as the receiver, having the specified number of slices, rows and columns.
 DComplexMatrix2D like2D(int rows, int columns)
          Construct and returns a new 2-d matrix of the corresponding dynamic type, sharing the same cells.
 void setQuick(int slice, int row, int column, double[] value)
          Sets the matrix cell at coordinate [slice,row,column] to the specified value.
 void setQuick(int slice, int row, int column, double re, double im)
          Sets the matrix cell at coordinate [slice,row,column] to the specified value.
 DComplexMatrix1D vectorize()
          Returns a vector obtained by stacking the columns of each slice of the matrix on top of one another.
 DComplexMatrix2D viewColumn(int column)
          Constructs and returns a new 2-dimensional slice view representing the slices and rows of the given column.
 DComplexMatrix3D viewColumnFlip()
          Constructs and returns a new flip view along the column axis.
 DComplexMatrix3D viewDice(int axis0, int axis1, int axis2)
          Constructs and returns a new dice view; Swaps dimensions (axes); Example: 3 x 4 x 5 matrix --> 4 x 3 x 5 matrix.
 DComplexMatrix3D viewPart(int slice, int row, int column, int depth, int height, int width)
          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.
 DComplexMatrix2D viewRow(int row)
          Constructs and returns a new 2-dimensional slice view representing the slices and columns of the given row.
 DComplexMatrix3D viewRowFlip()
          Constructs and returns a new flip view along the row axis.
 DComplexMatrix3D viewSelection(int[] sliceIndexes, int[] rowIndexes, int[] columnIndexes)
          Constructs and returns a new selection view that is a matrix holding the indicated cells.
 DComplexMatrix2D viewSlice(int slice)
          Constructs and returns a new 2-dimensional slice view representing the rows and columns of the given slice.
 DComplexMatrix3D viewSliceFlip()
          Constructs and returns a new flip view along the slice axis.
 DComplexMatrix3D viewStrides(int _sliceStride, int _rowStride, int _columnStride)
          Constructs and returns a new stride view which is a sub matrix consisting of every i-th cell.
 
Methods inherited from class cern.colt.matrix.tdcomplex.DComplexMatrix3D
aggregate, aggregate, assign, assign, assign, assign, assign, assign, assign, assign, assign, assignImaginary, assignReal, cardinality, copy, equals, equals, get, getNonZeros, like, set, set, toArray, toString, toString, viewSelection, zSum
 
Methods inherited from class cern.colt.matrix.AbstractMatrix3D
checkShape, checkShape, columns, columnStride, index, rows, rowStride, size, slices, sliceStride, toStringShort
 
Methods inherited from class cern.colt.matrix.AbstractMatrix
ensureCapacity, isView, trimToSize
 
Methods inherited from class cern.colt.PersistentObject
clone
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrapperDComplexMatrix3D

public WrapperDComplexMatrix3D(DComplexMatrix3D newContent)
Method Detail

elements

public Object elements()
Description copied from class: DComplexMatrix3D
Returns the elements of this matrix.

Specified by:
elements in class DComplexMatrix3D
Returns:
the elements

fft2Slices

public void fft2Slices()
Computes the 2D discrete Fourier transform (DFT) of each slice of this matrix.


fft3

public void fft3()
Computes the 3D discrete Fourier transform (DFT) of this matrix.


ifft2Slices

public void ifft2Slices(boolean scale)
Computes the 2D inverse of the discrete Fourier transform (IDFT) of each slice of this matrix.

Parameters:
scale - if true then scaling is performed

ifft3

public void ifft3(boolean scale)
Computes the 3D inverse of the discrete Fourier transform (IDFT) of this matrix.

Parameters:
scale - if true then scaling is performed

getQuick

public double[] getQuick(int slice,
                         int row,
                         int column)
Description copied from class: DComplexMatrix3D
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().

Specified by:
getQuick in class DComplexMatrix3D
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

public DComplexMatrix3D like(int slices,
                             int rows,
                             int columns)
Description copied from class: DComplexMatrix3D
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 DenseComplexMatrix3D the new matrix must also be of type DenseComplexMatrix3D. In general, the new matrix should have internal parametrization as similar as possible.

Specified by:
like in class DComplexMatrix3D
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.

setQuick

public void setQuick(int slice,
                     int row,
                     int column,
                     double[] value)
Description copied from class: DComplexMatrix3D
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().

Specified by:
setQuick in class DComplexMatrix3D
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.

setQuick

public void setQuick(int slice,
                     int row,
                     int column,
                     double re,
                     double im)
Description copied from class: DComplexMatrix3D
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().

Specified by:
setQuick in class DComplexMatrix3D
Parameters:
slice - the index of the slice-coordinate.
row - the index of the row-coordinate.
column - the index of the column-coordinate.
re - the real part of the value to be filled into the specified cell.
im - the imaginary part of the value to be filled into the specified cell.

vectorize

public DComplexMatrix1D vectorize()
Description copied from class: DComplexMatrix3D
Returns a vector obtained by stacking the columns of each slice of the matrix on top of one another.

Specified by:
vectorize in class DComplexMatrix3D
Returns:
a vector obtained by stacking the columns of each slice of the matrix on top of one another.

viewColumn

public DComplexMatrix2D viewColumn(int column)
Description copied from class: DComplexMatrix3D
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.

Overrides:
viewColumn in class DComplexMatrix3D
Parameters:
column - the index of the column to fix.
Returns:
a new 2-dimensional slice view.
See Also:
DComplexMatrix3D.viewSlice(int), DComplexMatrix3D.viewRow(int)

viewColumnFlip

public DComplexMatrix3D viewColumnFlip()
Description copied from class: DComplexMatrix3D
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.

Overrides:
viewColumnFlip in class DComplexMatrix3D
Returns:
a new flip view.
See Also:
DComplexMatrix3D.viewSliceFlip(), DComplexMatrix3D.viewRowFlip()

viewSlice

public DComplexMatrix2D viewSlice(int slice)
Description copied from class: DComplexMatrix3D
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.

Overrides:
viewSlice in class DComplexMatrix3D
Parameters:
slice - the index of the slice to fix.
Returns:
a new 2-dimensional slice view.
See Also:
DComplexMatrix3D.viewRow(int), DComplexMatrix3D.viewColumn(int)

viewSliceFlip

public DComplexMatrix3D viewSliceFlip()
Description copied from class: DComplexMatrix3D
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.

Overrides:
viewSliceFlip in class DComplexMatrix3D
Returns:
a new flip view.
See Also:
DComplexMatrix3D.viewRowFlip(), DComplexMatrix3D.viewColumnFlip()

viewDice

public DComplexMatrix3D viewDice(int axis0,
                                 int axis1,
                                 int axis2)
Description copied from class: DComplexMatrix3D
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.

Overrides:
viewDice in class DComplexMatrix3D
Parameters:
axis0 - the axis that shall become axis 0 (legal values 0..2).
axis1 - the axis that shall become axis 1 (legal values 0..2).
axis2 - the axis that shall become axis 2 (legal values 0..2).
Returns:
a new dice view.

viewPart

public DComplexMatrix3D viewPart(int slice,
                                 int row,
                                 int column,
                                 int depth,
                                 int height,
                                 int width)
Description copied from class: DComplexMatrix3D
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.

Overrides:
viewPart in class DComplexMatrix3D
Parameters:
slice - The index of the slice-coordinate.
row - The index of the row-coordinate.
column - The index of the column-coordinate.
depth - The depth of the box.
height - The height of the box.
width - The width of the box.
Returns:
the new view.

viewRow

public DComplexMatrix2D viewRow(int row)
Description copied from class: DComplexMatrix3D
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.

Overrides:
viewRow in class DComplexMatrix3D
Parameters:
row - the index of the row to fix.
Returns:
a new 2-dimensional slice view.
See Also:
DComplexMatrix3D.viewSlice(int), DComplexMatrix3D.viewColumn(int)

viewRowFlip

public DComplexMatrix3D viewRowFlip()
Description copied from class: DComplexMatrix3D
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.

Overrides:
viewRowFlip in class DComplexMatrix3D
Returns:
a new flip view.
See Also:
DComplexMatrix3D.viewSliceFlip(), DComplexMatrix3D.viewColumnFlip()

viewSelection

public DComplexMatrix3D viewSelection(int[] sliceIndexes,
                                      int[] rowIndexes,
                                      int[] columnIndexes)
Description copied from class: DComplexMatrix3D
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.

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.

Overrides:
viewSelection in class DComplexMatrix3D
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.
Returns:
the new view.

viewStrides

public DComplexMatrix3D viewStrides(int _sliceStride,
                                    int _rowStride,
                                    int _columnStride)
Description copied from class: DComplexMatrix3D
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.

Overrides:
viewStrides in class DComplexMatrix3D
Parameters:
_sliceStride - the slice step factor.
_rowStride - the row step factor.
_columnStride - the column step factor.
Returns:
a new view.

like2D

public DComplexMatrix2D like2D(int rows,
                               int columns)
Description copied from class: DComplexMatrix3D
Construct and returns a new 2-d matrix of the corresponding dynamic type, sharing the same cells. For example, if the receiver is an instance of type DenseDComplexMatrix3D the new matrix must also be of type DenseDComplexMatrix2D, if the receiver is an instance of type SparseDComplexMatrix3D the new matrix must also be of type SparseDComplexMatrix2D, etc.

Specified by:
like2D in class DComplexMatrix3D
Parameters:
rows - the number of rows the matrix shall have.
columns - the number of columns the matrix shall have.
Returns:
a new matrix of the corresponding dynamic type.

getImaginaryPart

public DoubleMatrix3D getImaginaryPart()
Description copied from class: DComplexMatrix3D
Returns the imaginary part of this matrix

Specified by:
getImaginaryPart in class DComplexMatrix3D
Returns:
the imaginary part

getRealPart

public DoubleMatrix3D getRealPart()
Description copied from class: DComplexMatrix3D
Returns the real part of this matrix

Specified by:
getRealPart in class DComplexMatrix3D
Returns:
the real part

Parallel Colt 0.9.4

Jump to the Parallel Colt Homepage