com.marmoush.jann.utils
Class MatrixUtils

java.lang.Object
  extended by com.marmoush.jann.utils.MatrixUtils

public class MatrixUtils
extends Object

The Class MatrixUtils.


Field Summary
static double MACHEPS
          The difference between 1 and the smallest exactly representable number greater than one.
 
Constructor Summary
MatrixUtils()
           
 
Method Summary
static DoubleMatrix batchFeatureMapping(DoubleMatrix batchTrainingEx, int degree, int f1ColIndex, int f2ColIndex)
           
static List<DoubleMatrix> batchMtrxToColVecsList(DoubleMatrix batch)
           
static DoubleMatrix colVecsList2BatchMtrx(List<DoubleMatrix> listOfVectors)
           
static boolean equals(DoubleMatrix mtrx1, DoubleMatrix mtrx2)
           
static DoubleMatrix featureMapping(double x1, double x2, int degree)
           
static DoubleMatrix featureMapping(DoubleMatrix input, int degree, int f1Index, int f2Index)
           
static DoubleMatrix featureScalingByAvrg(DoubleMatrix input)
           
static DoubleMatrix featureScalingBySTD(DoubleMatrix input)
           
static int getNumFeaturesMapped(int degree)
           
static String getSize(DoubleMatrix mtrx)
           
static DoubleMatrix inv(DoubleMatrix mtrx)
           
static DoubleMatrix pinv(DoubleMatrix x)
          Computes the Moore–Penrose pseudoinverse using the SVD method.
static void print(boolean withSize, DoubleMatrix... mtrxList)
           
static void print(boolean withSize, List<DoubleMatrix> mtrxList)
           
static void print(String[] names, boolean withSize, DoubleMatrix... mtrxList)
           
static void printSize(DoubleMatrix... mtrxArray)
           
static void printSize(DoubleMatrix mtrx)
           
static DoubleMatrix randomMatrix(int rows, int cols, double min, double max)
          Random matrix.
static DoubleMatrix randomMatrixFloor(int rows, int cols, int min, int max)
          Random matrix floor.
static double rank(DoubleMatrix A)
           
static double rankEff(DoubleMatrix A, DoubleMatrix s)
           
static DoubleMatrix round(DoubleMatrix mtrx, int decPoints)
           
static void setFillRandom(DoubleMatrix... matrices)
          Sets the fill random.
static void setFillRandomFloor(DoubleMatrix... matrices)
          Sets the fill random floor.
static void setFillRandomMinMax(double min, double max, DoubleMatrix... matrices)
          Sets the fill random min max.
static void setFillRandomMinMaxFloor(int min, int max, DoubleMatrix... matrices)
          Sets the fill random min max floor.
static double standardDeviation(DoubleMatrix input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MACHEPS

public static final double MACHEPS
The difference between 1 and the smallest exactly representable number greater than one. Gives an upper bound on the relative error due to rounding of floating point numbers.

See Also:
Constant Field Values
Constructor Detail

MatrixUtils

public MatrixUtils()
Method Detail

batchMtrxToColVecsList

public static List<DoubleMatrix> batchMtrxToColVecsList(DoubleMatrix batch)

colVecsList2BatchMtrx

public static DoubleMatrix colVecsList2BatchMtrx(List<DoubleMatrix> listOfVectors)

equals

public static boolean equals(DoubleMatrix mtrx1,
                             DoubleMatrix mtrx2)

featureMapping

public static DoubleMatrix featureMapping(double x1,
                                          double x2,
                                          int degree)

featureMapping

public static DoubleMatrix featureMapping(DoubleMatrix input,
                                          int degree,
                                          int f1Index,
                                          int f2Index)

batchFeatureMapping

public static DoubleMatrix batchFeatureMapping(DoubleMatrix batchTrainingEx,
                                               int degree,
                                               int f1ColIndex,
                                               int f2ColIndex)

featureScalingByAvrg

public static DoubleMatrix featureScalingByAvrg(DoubleMatrix input)

featureScalingBySTD

public static DoubleMatrix featureScalingBySTD(DoubleMatrix input)

getNumFeaturesMapped

public static int getNumFeaturesMapped(int degree)

getSize

public static String getSize(DoubleMatrix mtrx)

inv

public static DoubleMatrix inv(DoubleMatrix mtrx)

pinv

public static DoubleMatrix pinv(DoubleMatrix x)
Computes the Moore–Penrose pseudoinverse using the SVD method. Modified version of the original implementation by Kim van der Linde.


print

public static void print(boolean withSize,
                         DoubleMatrix... mtrxList)

print

public static void print(boolean withSize,
                         List<DoubleMatrix> mtrxList)

print

public static void print(String[] names,
                         boolean withSize,
                         DoubleMatrix... mtrxList)

printSize

public static void printSize(DoubleMatrix mtrx)

printSize

public static void printSize(DoubleMatrix... mtrxArray)

randomMatrix

public static DoubleMatrix randomMatrix(int rows,
                                        int cols,
                                        double min,
                                        double max)
Random matrix.

Parameters:
rows - the rows
cols - the cols
min - the min
max - the max
Returns:
the double matrix

randomMatrixFloor

public static DoubleMatrix randomMatrixFloor(int rows,
                                             int cols,
                                             int min,
                                             int max)
Random matrix floor.

Parameters:
rows - the rows
cols - the cols
min - the min
max - the max
Returns:
the double matrix

rank

public static double rank(DoubleMatrix A)

rankEff

public static double rankEff(DoubleMatrix A,
                             DoubleMatrix s)

round

public static DoubleMatrix round(DoubleMatrix mtrx,
                                 int decPoints)

setFillRandom

public static void setFillRandom(DoubleMatrix... matrices)
Sets the fill random.

Parameters:
matrices - the new fill random

setFillRandomFloor

public static void setFillRandomFloor(DoubleMatrix... matrices)
Sets the fill random floor.

Parameters:
matrices - the new fill random floor

setFillRandomMinMax

public static void setFillRandomMinMax(double min,
                                       double max,
                                       DoubleMatrix... matrices)
Sets the fill random min max.

Parameters:
min - the min
max - the max
matrices - the matrices

setFillRandomMinMaxFloor

public static void setFillRandomMinMaxFloor(int min,
                                            int max,
                                            DoubleMatrix... matrices)
Sets the fill random min max floor.

Parameters:
min - the min
max - the max
matrices - the matrices

standardDeviation

public static double standardDeviation(DoubleMatrix input)


Copyright © 2011-2012 Marmoush.com. All Rights Reserved.