Parallel Colt 0.9.4

cern.colt.matrix.tdouble.impl
Class DenseLargeDoubleMatrix3D

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.tdouble.DoubleMatrix3D
                  extended by cern.colt.matrix.tdouble.impl.WrapperDoubleMatrix3D
                      extended by cern.colt.matrix.tdouble.impl.DenseLargeDoubleMatrix3D
All Implemented Interfaces:
Serializable, Cloneable

public class DenseLargeDoubleMatrix3D
extends WrapperDoubleMatrix3D

Dense 3-d matrix holding double elements. First see the package summary and javadoc tree view to get the broad picture.

Implementation:

This data structure allows to store more than 2^31 elements. Internally holds one three-dimensional array, elements[slices][rows][columns]. Note that this implementation is not synchronized.

Time complexity:

O(1) (i.e. constant time) for the basic operations get, getQuick, set, setQuick and size.

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

Constructor Summary
DenseLargeDoubleMatrix3D(int slices, int rows, int columns)
           
 
Method Summary
 void dct2Slices(boolean scale)
          Computes the 2D discrete cosine transform (DCT-II) of each slice of this matrix.
 void dct3(boolean scale)
          Computes the 3D discrete cosine transform (DCT-II) of this matrix.
 void dht2Slices()
          Computes the 2D discrete Hartley transform (DHT) of each slice of this matrix.
 void dht3()
          Computes the 3D discrete Hartley transform (DHT) of this matrix.
 void dst2Slices(boolean scale)
          Computes the 2D discrete sine transform (DST-II) of each slice of this matrix.
 void dst3(boolean scale)
          Computes the 3D discrete sine transform (DST-II) of this matrix.
 double[][][] elements()
          Returns the elements of this matrix.
 void fft3()
          Computes the 3D discrete Fourier transform (DFT) of this matrix.
 DenseLargeDComplexMatrix3D getFft2Slices()
          Returns new complex matrix which is the 2D discrete Fourier transform (DFT) of each slice of this matrix.
 DenseLargeDComplexMatrix3D getFft3()
          Returns new complex matrix which is the 3D discrete Fourier transform (DFT) of this matrix.
 DenseLargeDComplexMatrix3D getIfft2Slices(boolean scale)
          Returns new complex matrix which is the 2D inverse of the discrete Fourier transform (IDFT) of each slice of this matrix.
 DenseLargeDComplexMatrix3D getIfft3(boolean scale)
          Returns new complex matrix which is the 3D inverse of the discrete Fourier transform (IDFT) of this matrix.
 double getQuick(int slice, int row, int column)
          Returns the matrix cell value at coordinate [slice,row,column].
 void idct2Slices(boolean scale)
          Computes the 2D inverse of the discrete cosine transform (DCT-III) of each slice of this matrix.
 void idct3(boolean scale)
          Computes the 3D inverse of the discrete cosine transform (DCT-III) of this matrix.
 void idht2Slices(boolean scale)
          Computes the 2D inverse of the discrete Hartley transform (IDHT) of each slice of this matrix.
 void idht3(boolean scale)
          Computes the 3D inverse of the discrete Hartley transform (IDHT) of this matrix.
 void idst2Slices(boolean scale)
          Computes the 2D inverse of the discrete sine transform (DST-III) of each slice of this matrix.
 void idst3(boolean scale)
          Computes the 3D inverse of the discrete sine transform (DST-III) of this matrix.
 void ifft3(boolean scale)
          Computes the 3D inverse of the discrete Fourier transform (IDFT) of this matrix.
 DoubleMatrix3D 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.
 void setQuick(int slice, int row, int column, double value)
          Sets the matrix cell at coordinate [slice,row,column] to the specified value.
 
Methods inherited from class cern.colt.matrix.tdouble.impl.WrapperDoubleMatrix3D
like2D, vectorize, viewColumn, viewColumnFlip, viewDice, viewPart, viewRow, viewRowFlip, viewSelection, viewSlice, viewSliceFlip, viewStrides
 
Methods inherited from class cern.colt.matrix.tdouble.DoubleMatrix3D
aggregate, aggregate, aggregate, aggregate, assign, assign, assign, assign, assign, assign, assign, assign, assign, cardinality, copy, equals, equals, get, getMaxLocation, getMinLocation, getNegativeValues, getNonZeros, getPositiveValues, like, normalize, set, toArray, toString, viewSelection, viewSorted, zAssign27Neighbors, 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

DenseLargeDoubleMatrix3D

public DenseLargeDoubleMatrix3D(int slices,
                                int rows,
                                int columns)
Method Detail

dct3

public void dct3(boolean scale)
Computes the 3D discrete cosine transform (DCT-II) of this matrix.

Overrides:
dct3 in class WrapperDoubleMatrix3D
Parameters:
scale - if true then scaling is performed

dct2Slices

public void dct2Slices(boolean scale)
Computes the 2D discrete cosine transform (DCT-II) of each slice of this matrix.

Overrides:
dct2Slices in class WrapperDoubleMatrix3D
Parameters:
scale - if true then scaling is performed

dht3

public void dht3()
Computes the 3D discrete Hartley transform (DHT) of this matrix.

Overrides:
dht3 in class WrapperDoubleMatrix3D

dht2Slices

public void dht2Slices()
Computes the 2D discrete Hartley transform (DHT) of each slice of this matrix.

Overrides:
dht2Slices in class WrapperDoubleMatrix3D

dst3

public void dst3(boolean scale)
Computes the 3D discrete sine transform (DST-II) of this matrix.

Overrides:
dst3 in class WrapperDoubleMatrix3D
Parameters:
scale - if true then scaling is performed

dst2Slices

public void dst2Slices(boolean scale)
Computes the 2D discrete sine transform (DST-II) of each slice of this matrix.

Overrides:
dst2Slices in class WrapperDoubleMatrix3D
Parameters:
scale - if true then scaling is performed

fft3

public void fft3()
Computes the 3D discrete Fourier transform (DFT) of this matrix. The physical layout of the output data is as follows:
 this[k1][k2][2*k3] = Re[k1][k2][k3]
                 = Re[(n1-k1)%n1][(n2-k2)%n2][n3-k3], 
 this[k1][k2][2*k3+1] = Im[k1][k2][k3]
                   = -Im[(n1-k1)%n1][(n2-k2)%n2][n3-k3], 
     0<=k1<n1, 0<=k2<n2, 0<k3<n3/2, 
 this[k1][k2][0] = Re[k1][k2][0]
              = Re[(n1-k1)%n1][n2-k2][0], 
 this[k1][k2][1] = Im[k1][k2][0]
              = -Im[(n1-k1)%n1][n2-k2][0], 
 this[k1][n2-k2][1] = Re[(n1-k1)%n1][k2][n3/2]
                 = Re[k1][n2-k2][n3/2], 
 this[k1][n2-k2][0] = -Im[(n1-k1)%n1][k2][n3/2]
                 = Im[k1][n2-k2][n3/2], 
     0<=k1<n1, 0<k2<n2/2, 
 this[k1][0][0] = Re[k1][0][0]
             = Re[n1-k1][0][0], 
 this[k1][0][1] = Im[k1][0][0]
             = -Im[n1-k1][0][0], 
 this[k1][n2/2][0] = Re[k1][n2/2][0]
                = Re[n1-k1][n2/2][0], 
 this[k1][n2/2][1] = Im[k1][n2/2][0]
                = -Im[n1-k1][n2/2][0], 
 this[n1-k1][0][1] = Re[k1][0][n3/2]
                = Re[n1-k1][0][n3/2], 
 this[n1-k1][0][0] = -Im[k1][0][n3/2]
                = Im[n1-k1][0][n3/2], 
 this[n1-k1][n2/2][1] = Re[k1][n2/2][n3/2]
                   = Re[n1-k1][n2/2][n3/2], 
 this[n1-k1][n2/2][0] = -Im[k1][n2/2][n3/2]
                   = Im[n1-k1][n2/2][n3/2], 
     0<k1<n1/2, 
 this[0][0][0] = Re[0][0][0], 
 this[0][0][1] = Re[0][0][n3/2], 
 this[0][n2/2][0] = Re[0][n2/2][0], 
 this[0][n2/2][1] = Re[0][n2/2][n3/2], 
 this[n1/2][0][0] = Re[n1/2][0][0], 
 this[n1/2][0][1] = Re[n1/2][0][n3/2], 
 this[n1/2][n2/2][0] = Re[n1/2][n2/2][0], 
 this[n1/2][n2/2][1] = Re[n1/2][n2/2][n3/2]
 
This method computes only half of the elements of the real transform. The other half satisfies the symmetry condition. If you want the full real forward transform, use getFft3. To get back the original data, use ifft3.

Overrides:
fft3 in class WrapperDoubleMatrix3D
Throws:
IllegalArgumentException - if the slice size or the row size or the column size of this matrix is not a power of 2 number.

getFft2Slices

public DenseLargeDComplexMatrix3D getFft2Slices()
Returns new complex matrix which is the 2D discrete Fourier transform (DFT) of each slice of this matrix.

Overrides:
getFft2Slices in class WrapperDoubleMatrix3D
Returns:
the 2D discrete Fourier transform (DFT) of each slice of this matrix.

getFft3

public DenseLargeDComplexMatrix3D getFft3()
Returns new complex matrix which is the 3D discrete Fourier transform (DFT) of this matrix.

Overrides:
getFft3 in class WrapperDoubleMatrix3D
Returns:
the 3D discrete Fourier transform (DFT) of this matrix.

getIfft2Slices

public DenseLargeDComplexMatrix3D getIfft2Slices(boolean scale)
Returns new complex matrix which is the 2D inverse of the discrete Fourier transform (IDFT) of each slice of this matrix.

Overrides:
getIfft2Slices in class WrapperDoubleMatrix3D
Parameters:
scale - if true then scaling is performed
Returns:
the 2D inverse of the discrete Fourier transform (IDFT) of each slice of this matrix.

getIfft3

public DenseLargeDComplexMatrix3D getIfft3(boolean scale)
Returns new complex matrix which is the 3D inverse of the discrete Fourier transform (IDFT) of this matrix.

Overrides:
getIfft3 in class WrapperDoubleMatrix3D
Parameters:
scale - if true then scaling is performed
Returns:
the 3D inverse of the discrete Fourier transform (IDFT) of this matrix.

getQuick

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

Overrides:
getQuick in class WrapperDoubleMatrix3D
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.

idct2Slices

public void idct2Slices(boolean scale)
Computes the 2D inverse of the discrete cosine transform (DCT-III) of each slice of this matrix.

Overrides:
idct2Slices in class WrapperDoubleMatrix3D
Parameters:
scale - if true then scaling is performed

idht3

public void idht3(boolean scale)
Computes the 3D inverse of the discrete Hartley transform (IDHT) of this matrix.

Overrides:
idht3 in class WrapperDoubleMatrix3D
Parameters:
scale - if true then scaling is performed
Throws:
IllegalArgumentException - if the slice size or the row size or the column size of this matrix is not a power of 2 number.

idht2Slices

public void idht2Slices(boolean scale)
Computes the 2D inverse of the discrete Hartley transform (IDHT) of each slice of this matrix.

Overrides:
idht2Slices in class WrapperDoubleMatrix3D
Parameters:
scale - if true then scaling is performed
Throws:
IllegalArgumentException - if the slice size or the row size or the column size of this matrix is not a power of 2 number.

idct3

public void idct3(boolean scale)
Computes the 3D inverse of the discrete cosine transform (DCT-III) of this matrix.

Overrides:
idct3 in class WrapperDoubleMatrix3D
Parameters:
scale - if true then scaling is performed

idst2Slices

public void idst2Slices(boolean scale)
Computes the 2D inverse of the discrete sine transform (DST-III) of each slice of this matrix.

Overrides:
idst2Slices in class WrapperDoubleMatrix3D
Parameters:
scale - if true then scaling is performed

idst3

public void idst3(boolean scale)
Computes the 3D inverse of the discrete sine transform (DST-III) of this matrix.

Overrides:
idst3 in class WrapperDoubleMatrix3D
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. The physical layout of the input data has to be as follows:
 this[k1][k2][2*k3] = Re[k1][k2][k3]
                 = Re[(n1-k1)%n1][(n2-k2)%n2][n3-k3], 
 this[k1][k2][2*k3+1] = Im[k1][k2][k3]
                   = -Im[(n1-k1)%n1][(n2-k2)%n2][n3-k3], 
     0<=k1<n1, 0<=k2<n2, 0<k3<n3/2, 
 this[k1][k2][0] = Re[k1][k2][0]
              = Re[(n1-k1)%n1][n2-k2][0], 
 this[k1][k2][1] = Im[k1][k2][0]
              = -Im[(n1-k1)%n1][n2-k2][0], 
 this[k1][n2-k2][1] = Re[(n1-k1)%n1][k2][n3/2]
                 = Re[k1][n2-k2][n3/2], 
 this[k1][n2-k2][0] = -Im[(n1-k1)%n1][k2][n3/2]
                 = Im[k1][n2-k2][n3/2], 
     0<=k1<n1, 0<k2<n2/2, 
 this[k1][0][0] = Re[k1][0][0]
             = Re[n1-k1][0][0], 
 this[k1][0][1] = Im[k1][0][0]
             = -Im[n1-k1][0][0], 
 this[k1][n2/2][0] = Re[k1][n2/2][0]
                = Re[n1-k1][n2/2][0], 
 this[k1][n2/2][1] = Im[k1][n2/2][0]
                = -Im[n1-k1][n2/2][0], 
 this[n1-k1][0][1] = Re[k1][0][n3/2]
                = Re[n1-k1][0][n3/2], 
 this[n1-k1][0][0] = -Im[k1][0][n3/2]
                = Im[n1-k1][0][n3/2], 
 this[n1-k1][n2/2][1] = Re[k1][n2/2][n3/2]
                   = Re[n1-k1][n2/2][n3/2], 
 this[n1-k1][n2/2][0] = -Im[k1][n2/2][n3/2]
                   = Im[n1-k1][n2/2][n3/2], 
     0<k1<n1/2, 
 this[0][0][0] = Re[0][0][0], 
 this[0][0][1] = Re[0][0][n3/2], 
 this[0][n2/2][0] = Re[0][n2/2][0], 
 this[0][n2/2][1] = Re[0][n2/2][n3/2], 
 this[n1/2][0][0] = Re[n1/2][0][0], 
 this[n1/2][0][1] = Re[n1/2][0][n3/2], 
 this[n1/2][n2/2][0] = Re[n1/2][n2/2][0], 
 this[n1/2][n2/2][1] = Re[n1/2][n2/2][n3/2]
 
This method computes only half of the elements of the real transform. The other half satisfies the symmetry condition. If you want the full real inverse transform, use getIfft3.

Overrides:
ifft3 in class WrapperDoubleMatrix3D
Parameters:
scale - if true then scaling is performed
Throws:
IllegalArgumentException - if the slice size or the row size or the column size of this matrix is not a power of 2 number.

setQuick

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

Overrides:
setQuick in class WrapperDoubleMatrix3D
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.

elements

public double[][][] elements()
Description copied from class: DoubleMatrix3D
Returns the elements of this matrix.

Overrides:
elements in class WrapperDoubleMatrix3D
Returns:
the elements

like

public DoubleMatrix3D like(int slices,
                           int rows,
                           int columns)
Description copied from class: DoubleMatrix3D
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.

Overrides:
like in class WrapperDoubleMatrix3D
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.

Parallel Colt 0.9.4

Jump to the Parallel Colt Homepage