|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnetflix.algorithms.modelbased.svd.MatrixHelper
public class MatrixHelper
Provides utility functions for use with the Colt matrix package.
| Constructor Summary | |
|---|---|
MatrixHelper()
|
|
| Method Summary | |
|---|---|
static cern.colt.matrix.DoubleMatrix2D |
addMatrices(cern.colt.matrix.DoubleMatrix2D A,
cern.colt.matrix.DoubleMatrix2D B)
Adds two matrices. |
static cern.colt.matrix.DoubleMatrix1D |
addVectors(cern.colt.matrix.DoubleMatrix1D a,
cern.colt.matrix.DoubleMatrix1D b)
Adds two vectors. |
static cern.colt.matrix.DoubleMatrix2D |
appendColToMatrix(cern.colt.matrix.DoubleMatrix2D A)
Appends an additional column of zeros to the specified matrix. |
static cern.colt.matrix.DoubleMatrix2D |
appendToMatrix(cern.colt.matrix.DoubleMatrix2D A,
cern.colt.matrix.DoubleMatrix1D B)
Appends a new column to the matrix A. |
static cern.colt.matrix.DoubleMatrix1D |
appendToVector(cern.colt.matrix.DoubleMatrix1D a,
double b)
Appends the scalar b to the end of vector a. |
static cern.colt.matrix.DoubleMatrix1D |
divideVector(cern.colt.matrix.DoubleMatrix1D a,
double b)
Divides a vector by a scalar. |
static cern.colt.matrix.DoubleMatrix2D |
growMatrix(cern.colt.matrix.DoubleMatrix2D A)
Appends an additional row and column of zeros to the specified matrix. |
static void |
printMatrix(cern.colt.matrix.DoubleMatrix1D vector)
Prints a one dimensional matrix (i.e. |
static void |
printMatrix(cern.colt.matrix.DoubleMatrix2D matrix)
Prints a two dimensional matrix. |
static cern.colt.matrix.DoubleMatrix1D |
subVectors(cern.colt.matrix.DoubleMatrix1D a,
cern.colt.matrix.DoubleMatrix1D b)
Subtracts two vectors. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MatrixHelper()
| Method Detail |
|---|
public static void printMatrix(cern.colt.matrix.DoubleMatrix2D matrix)
matrix - The DoubbleMatrix2D object to printpublic static void printMatrix(cern.colt.matrix.DoubleMatrix1D vector)
vector - The DoubleMatrix1D to print
public static cern.colt.matrix.DoubleMatrix1D addVectors(cern.colt.matrix.DoubleMatrix1D a,
cern.colt.matrix.DoubleMatrix1D b)
throws java.lang.IllegalArgumentException
a - First vector to addb - Second vector to add
java.lang.IllegalArgumentException - if a.size() != b.size()
public static cern.colt.matrix.DoubleMatrix1D subVectors(cern.colt.matrix.DoubleMatrix1D a,
cern.colt.matrix.DoubleMatrix1D b)
throws java.lang.IllegalArgumentException
a - b -
java.lang.IllegalArgumentException - if a.size() != b.size()
public static cern.colt.matrix.DoubleMatrix1D divideVector(cern.colt.matrix.DoubleMatrix1D a,
double b)
a - Vectorb - Scalar to divide a by.
public static cern.colt.matrix.DoubleMatrix1D appendToVector(cern.colt.matrix.DoubleMatrix1D a,
double b)
a - The vector to append to.b - The scalar to append.
public static cern.colt.matrix.DoubleMatrix2D appendToMatrix(cern.colt.matrix.DoubleMatrix2D A,
cern.colt.matrix.DoubleMatrix1D B)
throws java.lang.IllegalArgumentException
A - The matrix.B - The vector to append to A.
java.lang.IllegalArgumentException - if A.rows() != B.size()
public static cern.colt.matrix.DoubleMatrix2D addMatrices(cern.colt.matrix.DoubleMatrix2D A,
cern.colt.matrix.DoubleMatrix2D B)
throws java.lang.IllegalArgumentException
A - First matrix to add.B - Second matrix to add.
java.lang.IllegalArgumentException - if A and B are not the same size.public static cern.colt.matrix.DoubleMatrix2D growMatrix(cern.colt.matrix.DoubleMatrix2D A)
A - The matrix to grow.
public static cern.colt.matrix.DoubleMatrix2D appendColToMatrix(cern.colt.matrix.DoubleMatrix2D A)
A - The matrix to grow.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||