MCPcopy Index your code
hub / github.com/EdwardRaff/JSAT / OuterProductUpdate

Method OuterProductUpdate

JSAT/src/jsat/linear/Matrix.java:882–895  ·  view source on GitHub ↗

Alters the matrix A such that, A = A + c x y ' @param A the matrix to update @param x the first vector @param y the second vector @param c the scalar constant to multiply the outer product by @throws ArithmeticException if the vector dimensions are not compatible with the

(Matrix A, Vec x, Vec y, double c)

Source from the content-addressed store, hash-verified

880 * with the matrix <i>A</i>
881 */
882 public static void OuterProductUpdate(Matrix A, Vec x, Vec y, double c)
883 {
884 if (x.length() != A.rows() || y.length() != A.cols())
885 throw new ArithmeticException("Matrix dimensions do not agree with outer product");
886 if (x.isSparse())
887 for (IndexValue iv : x)
888 A.updateRow(iv.getIndex(), iv.getValue() * c, y);
889 else
890 for (int i = 0; i < x.length(); i++)
891 {
892 double rowCosnt = c * x.get(i);
893 A.updateRow(i, rowCosnt, y);
894 }
895 }
896
897 /**
898 * Alters the matrix <i>A</i> such that,

Callers 15

covarianceMatrixMethod · 0.95
classifyMethod · 0.95
updateMethod · 0.95
updateMethod · 0.95
updateMethod · 0.95
updateMethod · 0.95
trainNNMethod · 0.95
mutableAddMethod · 0.95
updateMethod · 0.95
clusterMethod · 0.95

Calls 15

countUpMethod · 0.95
countDownMethod · 0.95
awaitMethod · 0.95
submitMethod · 0.80
logMethod · 0.80
getNameMethod · 0.65
lengthMethod · 0.45
rowsMethod · 0.45
colsMethod · 0.45
isSparseMethod · 0.45
updateRowMethod · 0.45
getIndexMethod · 0.45

Tested by 2