|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.types.MatrixOps
public final class MatrixOps
A class of static utility functions for manipulating arrays of double.
Constructor Summary | |
---|---|
MatrixOps()
|
Method Summary | |
---|---|
static double |
absNorm(double[] m)
|
static double |
absNormalize(double[] m)
|
static double[] |
append(double[] original,
double newValue)
|
static double |
dot(double[] m1,
double[] m2)
Deprecated. Use dotProduct() |
static double |
dotProduct(double[] m1,
double[] m2)
|
static void |
expNormalize(double[] scores)
|
static double |
infinityNorm(double[] m)
|
static boolean |
isInfinite(double[] m)
|
static boolean |
isNaN(double[] m)
|
static boolean |
isNaNOrInfinite(double[] m)
|
static boolean |
isNonZero(double[] m)
|
static boolean |
isZero(double[] m)
|
static void |
log(double[] m)
|
static double |
max(double[] elems)
|
static double |
max(double[][] ds)
|
static int |
max(int[] elems)
|
static int |
max(int[][] m)
|
static double |
maxAbsdiff(double[] v1,
double[] v2)
Returns the maximum elementwise absolute difference between two vectors. |
static int |
maxIndex(double[] elems)
|
static int[] |
maxIndex(double[][] ds)
|
static double |
mean(double[] m)
|
static double |
min(double[] elems)
|
static int |
minIndex(double[] elems)
|
static double |
normalize(double[] m)
|
static double |
oneNorm(double[] m)
|
static double |
oneNormalize(double[] m)
|
static void |
plusEquals(double[][] m1,
double[][] m2,
double factor)
|
static void |
plusEquals(double[] m,
double toadd)
Adds a scalar to every element in an array. |
static void |
plusEquals(double[] m1,
double[] m2)
|
static void |
plusEquals(double[] m1,
double[] m2,
double factor)
|
static void |
print(double[] m)
Prints a double array to standard output |
static void |
print(double[][] arr)
|
static void |
print(int[] m)
|
static void |
print(int[][] arr)
|
static void |
print(java.io.PrintWriter out,
double[] m)
Prints a double array to the given PrintWriter. |
static void |
printInRows(double[] arr)
|
static double[] |
randomVector(int n,
java.util.Random r)
|
static double |
rowDotProduct(double[] m,
int nc,
int ri,
Vector v,
double factor,
int maxCi,
FeatureSelection selection)
|
static double |
rowDotProduct(double[] m,
int nc,
int ri,
Vector v,
int maxCi,
FeatureSelection selection)
|
static void |
rowPlusEquals(double[] m,
int nc,
int ri,
Vector v,
double factor)
|
static void |
rowSetAll(double[] m,
int nc,
int ri,
double v,
FeatureSelection fselection,
boolean ifSelected)
If "ifSelected" is false, it reverses the selection. |
static void |
set(double[] dest,
double[] source)
|
static void |
setAll(double[][][] m,
double v)
|
static void |
setAll(double[][] m,
double v)
|
static void |
setAll(double[] m,
double v)
Sets every element of a double array to a given value. |
static double |
stddev(double[] m)
Return the standard deviation |
static double |
stderr(double[] m)
|
static void |
substitute(double[] m,
double oldValue,
double newValue)
|
static double |
sum(double[] m)
|
static double |
sum(double[][] m)
|
static int |
sum(int[] m)
|
static double |
sum(Vector v)
|
static void |
timesEquals(double[][] m,
double factor)
|
static void |
timesEquals(double[] m,
double factor)
Multiplies every element in an array by a scalar. |
static void |
timesEquals(double[] m1,
double[] m2)
|
static java.lang.String |
toString(java.lang.Object m)
Print a space-separated array of elements |
static double |
twoNorm(double[] m)
|
static double |
twoNormalize(double[] m)
|
static double |
twoNormSquared(double[] m)
|
static double |
variance(double[] m)
Return the variance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MatrixOps()
Method Detail |
---|
public static void setAll(double[] m, double v)
m
- The array to modifyv
- The valuepublic static void set(double[] dest, double[] source)
public static void timesEquals(double[] m, double factor)
m
- The arrayfactor
- The scalarpublic static void timesEquals(double[] m1, double[] m2)
public static void plusEquals(double[] m, double toadd)
m
- The arraytoadd
- The scalarpublic static void plusEquals(double[] m1, double[] m2)
public static void plusEquals(double[] m1, double[] m2, double factor)
public static void plusEquals(double[][] m1, double[][] m2, double factor)
public static void log(double[] m)
public static double dot(double[] m1, double[] m2)
public static double dotProduct(double[] m1, double[] m2)
public static double absNorm(double[] m)
public static double twoNorm(double[] m)
public static double twoNormSquared(double[] m)
public static double oneNorm(double[] m)
public static double oneNormalize(double[] m)
public static double normalize(double[] m)
public static double infinityNorm(double[] m)
public static double absNormalize(double[] m)
public static double twoNormalize(double[] m)
public static void substitute(double[] m, double oldValue, double newValue)
public static final void rowSetAll(double[] m, int nc, int ri, double v, FeatureSelection fselection, boolean ifSelected)
public static double rowDotProduct(double[] m, int nc, int ri, Vector v, int maxCi, FeatureSelection selection)
public static double rowDotProduct(double[] m, int nc, int ri, Vector v, double factor, int maxCi, FeatureSelection selection)
public static final void rowPlusEquals(double[] m, int nc, int ri, Vector v, double factor)
public static boolean isNaN(double[] m)
public static boolean isInfinite(double[] m)
public static boolean isNaNOrInfinite(double[] m)
public static boolean isNonZero(double[] m)
public static boolean isZero(double[] m)
public static double sum(double[] m)
public static double sum(double[][] m)
public static int sum(int[] m)
public static double sum(Vector v)
public static double mean(double[] m)
public static double stddev(double[] m)
public static double stderr(double[] m)
public static double variance(double[] m)
public static final void print(double[] m)
m
- Array to print.public static final void print(java.io.PrintWriter out, double[] m)
out
- Writer to print ouput tom
- Array to print.public static final void print(double[][] arr)
public static final java.lang.String toString(java.lang.Object m)
m
- An array of any typepublic static final void printInRows(double[] arr)
public static void setAll(double[][][] m, double v)
public static void setAll(double[][] m, double v)
public static void print(int[][] arr)
public static void print(int[] m)
public static double[] randomVector(int n, java.util.Random r)
public static void timesEquals(double[][] m, double factor)
public static double maxAbsdiff(double[] v1, double[] v2)
v1
- Input vector, as double[]v2
- Input vector, as double[]
public static int max(int[][] m)
public static int max(int[] elems)
public static double max(double[] elems)
public static double min(double[] elems)
public static int maxIndex(double[] elems)
public static int minIndex(double[] elems)
public static double[] append(double[] original, double newValue)
public static double max(double[][] ds)
public static int[] maxIndex(double[][] ds)
public static void expNormalize(double[] scores)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |