Matrix
Date: 2011-06-15

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.pawjaw.linalg
Class Matrix

    java.lang.Object
      com.pawjaw.linalg.Matrix

    public class Matrix

extends java.lang.Object

Field Summary
`int` | `cols`
`int[]` | `pointr`
`int[]` | `rowind`
`int` | `rows`
`int` | `vals`
`double[]` | `value`

Constructor Summary
`Matrix()`
`Matrix(java.io.BufferedReader br)`
`Matrix(java.io.DataInputStream dis)`
`Matrix(double[][] m)`
`Matrix(double[][] m, boolean transpose)`

Method Summary
`Matrix` | `allocate()`
`Matrix` | `applyTfIdf()`
`static double[]` | `asDoubles(int[] is)`
`double` | `columnInnerProduct(int columna, int columnb, double norm)`
`double` | `columnInnerProductSum(int[] columns, double norm)`
`double[][]` | `columnOuterProduct(double norm)`
`static Matrix` | `combineColumns(java.util.List<Matrix> matrices)`
`Matrix` | `getColumns(int[] columns)`
`static double[][]` | `getLowerTriangular(double[][] m)`
`static double[]` | `getLowerTriangularColumnMajor(double[][] a)`
`Matrix` | `getNonZeroColumns()`
`Matrix[]` | `holdOutFromEachColumn(double hold_out_percent)`
`int[]` | `identifyNonZeroColumns()`
`double` | `jensenShannonDivergence(int columna, int columnb)`
`static void` | `main(java.lang.String[] args)`
`Matrix` | `multiply(Matrix m)`
`Matrix` | `normalizeColumns(double norm)`
`static int[]` | `range(int first, int increment, int steps)`
`static double[][]` | `read(java.io.BufferedReader br)`
`Matrix` | `selectRowsByNIdf(double min_nidf, double max_nidf)`
`double[][]` | `toArray()`
`static double[]` | `toArray(java.util.Collection<java.lang.Double> ds)`
`static int[]` | `toArray(java.util.Collection<java.lang.Integer> is)`
`double[]` | `toColumnMajor()`
`static double[]` | `toColumnMajor(double[][] a)`
`Matrix` | `toCopy()`
`static java.util.List<java.lang.Double>` | `toList(double[] ds)`
`static java.util.List<java.lang.Integer>` | `toList(int[] is)`
`java.lang.String` | `toString()`
`java.lang.String` | `toSummary()`
`Matrix` | `toTranspose()`
`void` | `write(java.io.DataOutputStream dos)`
`static void` | `write(double[][] matrix_mn, java.io.PrintWriter pw)`
`void` | `write(java.io.PrintWriter pw)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### rows

    public int rows

### cols

    public int cols

### vals

    public int vals

### pointr

    public int[] pointr

### rowind

    public int[] rowind

### value

    public double[] value

Constructor Detail

### Matrix

    public Matrix()

### Matrix

    public Matrix(double[][] m)

### Matrix

    public Matrix(java.io.DataInputStream dis)
           throws java.io.IOException

Throws:
  `java.io.IOException`

### Matrix

    public Matrix(java.io.BufferedReader br)
           throws java.io.IOException

Throws:
  `java.io.IOException`

### Matrix

    public Matrix(double[][] m,
                  boolean transpose)

Method Detail

### toTranspose

    public Matrix toTranspose()

### toArray

    public double[][] toArray()

### write

    public void write(java.io.DataOutputStream dos)
               throws java.io.IOException

  Throws:
    `java.io.IOException`

### write

    public void write(java.io.PrintWriter pw)
               throws java.io.IOException

  Throws:
    `java.io.IOException`

### write

    public static void write(double[][] matrix_mn,
                             java.io.PrintWriter pw)
                      throws java.io.IOException

  Throws:
    `java.io.IOException`

### read

    public static double[][] read(java.io.BufferedReader br)
                           throws java.io.IOException

  Throws:
    `java.io.IOException`

### toSummary

    public java.lang.String toSummary()

### multiply

    public Matrix multiply(Matrix m)

### identifyNonZeroColumns

    public int[] identifyNonZeroColumns()

### getNonZeroColumns

    public Matrix getNonZeroColumns()

### allocate

    public Matrix allocate()

### holdOutFromEachColumn

    public Matrix[] holdOutFromEachColumn(double hold_out_percent)

### columnOuterProduct

    public double[][] columnOuterProduct(double norm)

### columnInnerProduct

    public double columnInnerProduct(int columna,
                                     int columnb,
                                     double norm)

### columnInnerProductSum

    public double columnInnerProductSum(int[] columns,
                                        double norm)

### jensenShannonDivergence

    public double jensenShannonDivergence(int columna,
                                          int columnb)

### applyTfIdf

    public Matrix applyTfIdf()

### range

    public static int[] range(int first,
                              int increment,
                              int steps)

### getColumns

    public Matrix getColumns(int[] columns)

### toCopy

    public Matrix toCopy()

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### normalizeColumns

    public Matrix normalizeColumns(double norm)

### getLowerTriangular

    public static double[][] getLowerTriangular(double[][] m)

### combineColumns

    public static Matrix combineColumns(java.util.List<Matrix> matrices)

### selectRowsByNIdf

    public Matrix selectRowsByNIdf(double min_nidf,
                                   double max_nidf)

### toArray

    public static int[] toArray(java.util.Collection<java.lang.Integer> is)

### toArray

    public static double[] toArray(java.util.Collection<java.lang.Double> ds)

### asDoubles

    public static double[] asDoubles(int[] is)

### toList

    public static java.util.List<java.lang.Integer> toList(int[] is)

### toList

    public static java.util.List<java.lang.Double> toList(double[] ds)

### toColumnMajor

    public double[] toColumnMajor()

### toColumnMajor

    public static double[] toColumnMajor(double[][] a)

### getLowerTriangularColumnMajor

    public static double[] getLowerTriangularColumnMajor(double[][] a)

### main

    public static void main(java.lang.String[] args)
                     throws java.lang.Exception

  Throws:
    `java.lang.Exception`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD