MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / DenseMatrix

Method DenseMatrix

JSAT/src/jsat/linear/DenseMatrix.java:35–44  ·  view source on GitHub ↗

Creates a new matrix based off the given vectors. @param a the first Vector, this new Matrix will have as many rows as the length of this vector @param b the second Vector, this new Matrix will have as many columns as this length of this vector

(Vec a, Vec b)

Source from the content-addressed store, hash-verified

33 * @param b the second Vector, this new Matrix will have as many columns as this length of this vector
34 */
35 public DenseMatrix(Vec a, Vec b)
36 {
37 matrix = new double[a.length()][b.length()];
38 for(int i = 0; i < a.length(); i++)
39 {
40 Vec rowVals = b.multiply(a.get(i));
41 for(int j = 0; j < b.length(); j++)
42 matrix[i][j] = rowVals.get(j);
43 }
44 }
45
46 /**
47 * Creates a new matrix of zeros

Callers

nothing calls this directly

Calls 7

getMethod · 0.95
lengthMethod · 0.45
multiplyMethod · 0.45
getMethod · 0.45
rowsMethod · 0.45
colsMethod · 0.45
copyToMethod · 0.45

Tested by

no test coverage detected