public class VEC extends Object
| Constructor and Description |
|---|
VEC() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getMatrix(int n1,
int n2,
double[][] m,
int d,
int w)
Method for filling string with a matrix
Based on ER Harold, "Java I/O", O'Reilly, around p. |
static String |
getSpaces(int n) |
static double[][] |
GetSummaryData(int nrow,
int ncol,
double[][] A) |
static void |
inSort(double[] invect)
Method to sort a double vector, by inefficient straight insertion See
section 8.1, p.
|
static void |
printMatrix(int n1,
int n2,
double[][] m,
int d,
int w)
Method for printing a matrix
Based on ER Harold, "Java I/O", O'Reilly, around p. |
static void |
printMatrix(int n1,
int n2,
int[][] m,
int d,
int w)
Method for printing an integer matrix
Based on ER Harold, "Java I/O", O'Reilly, around p. |
static void |
printVect(double[] m,
int d,
int w)
Method printVect for printing a vector
Based on ER Harold, "Java I/O", O'Reilly, around p. |
static void |
printVect(int[] m,
int d,
int w)
Method printVect for printing a vector
Based on ER Harold, "Java I/O", O'Reilly, around p. |
static double[][] |
Standardize(int nrow,
int ncol,
double[][] A)
Method for standardizing the input data
|
public static String getSpaces(int n)
public static void printMatrix(int n1,
int n2,
double[][] m,
int d,
int w)
n1 - row dimension of matrixn2 - column dimension of matrixm - input matrix valuesd - display precision, number of decimal placesw - display precision, total width of floating valuepublic static String getMatrix(int n1, int n2, double[][] m, int d, int w)
n1 - row dimension of matrixn2 - column dimension of matrixm - input matrix valuesd - display precision, number of decimal placesw - display precision, total width of floating valuepublic static void printMatrix(int n1,
int n2,
int[][] m,
int d,
int w)
n1 - row dimension of matrixn2 - column dimension of matrixm - input matrix valuesd - display precision, number of decimal placesw - display precision, total width of floating valuepublic static void printVect(double[] m,
int d,
int w)
m - input vector of length m.lengthd - display precision, number of decimal placesw - display precision, total width of floating valuepublic static void printVect(int[] m,
int d,
int w)
m - input vector of length m.lengthd - display precision, number of decimal placesw - display precision, total width of floating valuepublic static double[][] Standardize(int nrow,
int ncol,
double[][] A)
Note the formalas used (since these vary between implementations):
reduction: (vect - meanvect)/sqrt(nrow)*colstdev
colstdev: sum_cols ((vect - meanvect)^2/nrow)
if colstdev is close to 0, then set it to 1.
nrow - number of rows in input matrixncol - number of columns in input matrixA - input matrix valuespublic static double[][] GetSummaryData(int nrow,
int ncol,
double[][] A)
public static void inSort(double[] invect)
invect - input data to be sorted, sorted in placeJas4pp 1.5 © Java Analysis Studio for Particle Physics