shared.array
Class RealArray

java.lang.Object
  extended by shared.array.ProtoArray<T,double[],E>
      extended by shared.array.AbstractArray<R,C,R,Double>
          extended by shared.array.AbstractRealArray<RealArray,ComplexArray>
              extended by shared.array.RealArray
All Implemented Interfaces:
Cloneable, Array<RealArray,Double>, Matrix<RealArray,Double>
Direct Known Subclasses:
DerivativeOfGaussian, IntegralHistogram, IntegralImage, LaplacianOfGaussian, Mean

public class RealArray
extends AbstractRealArray<RealArray,ComplexArray>
implements Matrix<RealArray,Double>

A multidimensional real array class.


Nested Class Summary
 
Nested classes/interfaces inherited from class shared.array.AbstractRealArray
AbstractRealArray.RealMap, AbstractRealArray.RealReduce
 
Nested classes/interfaces inherited from interface shared.array.Array
Array.IndexingOrder
 
Field Summary
 
Fields inherited from class shared.array.AbstractArray
INVALID_PARITY, parity
 
Fields inherited from class shared.array.ProtoArray
dims, order, strides, values
 
Constructor Summary
  RealArray(Array.IndexingOrder order, int... dims)
          Alternate constructor.
protected RealArray(Array.IndexingOrder order, int[] dims, int[] strides)
          Internal constructor for package use only.
  RealArray(double[] values, Array.IndexingOrder order, int... dims)
          Alternate constructor.
  RealArray(double[] values, int... dims)
          Alternate constructor.
  RealArray(int... dims)
          Default constructor.
protected RealArray(int unused, Array.IndexingOrder order, int[] dims)
          Internal constructor with a distinctive signature.
protected RealArray(int unused, double[] values, Array.IndexingOrder order, int[] dims)
          Internal constructor with a distinctive signature.
  RealArray(RealArray array)
          Alternate constructor.
 
Method Summary
static RealArray eye(int size, int ndims)
          Creates an array of the given size and number of dimensions, with ones for diagonals.
 byte[] getBytes()
          Converts this array into bytes.
 RealArray mDiag()
          Gets the diagonal of this matrix as a column vector.
 RealArray[] mEigs()
          Gets the eigenvectors and eigenvalues of this matrix.
 RealArray mInvert()
          Inverts this matrix.
 RealArray mMul(RealArray b)
          Multiplies two matrices.
 RealArray[] mSVD()
          Gets the singular value decomposition of this matrix.
 RealArray mTranspose()
          Transposes this matrix.
static RealArray parse(byte[] data)
          Parses an array from bytes.
protected  RealArray wrap(int parity, Array.IndexingOrder order, int[] dims, int[] strides)
          Creates an instance of the base type.
protected  ComplexArray wrapUp(int parity, Array.IndexingOrder order, int[] dims, int[] strides)
          Creates an instance of the "up" type after a forwards FFT.
 
Methods inherited from class shared.array.AbstractRealArray
aEnt, aMax, aMean, aMin, applyKernelElementwiseOperation, applyKernelLeftElementwiseOperation, applyKernelRealAccumulatorOperation, applyKernelRealDimensionOperation, applyKernelRealIndexOperation, applyKernelRealReduceOperation, applyKernelRealToComplexOperation, applyKernelRealUnaryOperation, aProd, aSum, aVar, dimensions, dProd, dSum, eAdd, eDiv, eMax, eMin, eMul, eSub, getComponentType, iGZero, iGZero, iLZero, iLZero, iMax, iMax, iMin, iMin, iSort, iSort, iZero, iZero, lAdd, lDiv, lMax, lMin, lMul, lSub, map, reduce, rfft, rfftDimensions, rMax, rMean, rMin, rProd, rSum, rVar, tocIm, tocRe, uAbs, uAdd, uAtan, uCos, uExp, uFill, uInv, uLog, uMul, uPow, uRnd, uShuffle, uSin, uSqr, uSqrt, wrap, wrapDown
 
Methods inherited from class shared.array.AbstractArray
checkInvalidParity, checkMatrixOrder, checkShape, fft, get, ifft, inferDimensions, rifft, rifftDimensions, set, toString, transform, values, wrap
 
Methods inherited from class shared.array.ProtoArray
clone, map, ndims, order, physical, reshape, reverse, reverseOrder, shift, size, slice, slice, slice, slice, splice, stride, strides, subarray, tile, transpose
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface shared.array.Array
clone, dimensions, getComponentType, map, ndims, order, reshape, reverse, reverseOrder, shift, size, slice, slice, slice, slice, splice, stride, strides, subarray, tile, toString, transpose
 

Constructor Detail

RealArray

public RealArray(int... dims)
Default constructor.


RealArray

public RealArray(Array.IndexingOrder order,
                 int... dims)
Alternate constructor.


RealArray

protected RealArray(int unused,
                    Array.IndexingOrder order,
                    int[] dims)
Internal constructor with a distinctive signature.


RealArray

public RealArray(double[] values,
                 int... dims)
Alternate constructor.


RealArray

public RealArray(double[] values,
                 Array.IndexingOrder order,
                 int... dims)
Alternate constructor.


RealArray

public RealArray(RealArray array)
Alternate constructor.


RealArray

protected RealArray(int unused,
                    double[] values,
                    Array.IndexingOrder order,
                    int[] dims)
Internal constructor with a distinctive signature.


RealArray

protected RealArray(Array.IndexingOrder order,
                    int[] dims,
                    int[] strides)
Internal constructor for package use only.

Method Detail

wrap

protected RealArray wrap(int parity,
                         Array.IndexingOrder order,
                         int[] dims,
                         int[] strides)
Description copied from class: AbstractArray
Creates an instance of the base type.

Specified by:
wrap in class AbstractArray<RealArray,ComplexArray,RealArray,Double>

wrapUp

protected ComplexArray wrapUp(int parity,
                              Array.IndexingOrder order,
                              int[] dims,
                              int[] strides)
Description copied from class: AbstractArray
Creates an instance of the "up" type after a forwards FFT.

Specified by:
wrapUp in class AbstractArray<RealArray,ComplexArray,RealArray,Double>

mMul

public RealArray mMul(RealArray b)
Description copied from interface: Matrix
Multiplies two matrices.

Specified by:
mMul in interface Matrix<RealArray,Double>
Parameters:
b - the right hand side.
Returns:
the multiplication result.

mDiag

public RealArray mDiag()
Description copied from interface: Matrix
Gets the diagonal of this matrix as a column vector.

Specified by:
mDiag in interface Matrix<RealArray,Double>
Returns:
the diagonal.

mTranspose

public RealArray mTranspose()
Description copied from interface: Matrix
Transposes this matrix.

Specified by:
mTranspose in interface Matrix<RealArray,Double>
Returns:
the transposed matrix.

mSVD

public RealArray[] mSVD()
Description copied from interface: Matrix
Gets the singular value decomposition of this matrix.

Specified by:
mSVD in interface Matrix<RealArray,Double>
Returns:
the matrices "U", "S", and "V".

mEigs

public RealArray[] mEigs()
Description copied from interface: Matrix
Gets the eigenvectors and eigenvalues of this matrix.

Specified by:
mEigs in interface Matrix<RealArray,Double>
Returns:
the eigenvectors and eigenvalues.

mInvert

public RealArray mInvert()
Description copied from interface: Matrix
Inverts this matrix.

Specified by:
mInvert in interface Matrix<RealArray,Double>
Returns:
the inverted matrix.

getBytes

public byte[] getBytes()
Description copied from class: ProtoArray
Converts this array into bytes.

Overrides:
getBytes in class ProtoArray<RealArray,double[],Double>
Returns:
the bytes.

parse

public static final RealArray parse(byte[] data)
Parses an array from bytes.


eye

public static final RealArray eye(int size,
                                  int ndims)
Creates an array of the given size and number of dimensions, with ones for diagonals.