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

Method updateRow

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

Alters row i of this matrix, such that A[i,:] = A[i,:] + c b @param i the index of the row to update @param c the scalar constant to multiply the vector by @param b the vector to add to the specified row

(int i, double c, Vec b)

Source from the content-addressed store, hash-verified

857 * @param b the vector to add to the specified row
858 */
859 public void updateRow(int i, double c, Vec b)
860 {
861 if(b.length() != this.cols())
862 throw new ArithmeticException("vector is not of the same column length");
863 if (b.isSparse())
864 for (IndexValue iv : b)
865 this.increment(i, iv.getIndex(), c * iv.getValue());
866 else
867 for (int j = 0; j < b.length(); j++)
868 this.increment(i, j, c * b.get(j));
869 }
870
871 /**
872 * Alters the matrix <i>A</i> such that,

Callers 2

OuterProductUpdateMethod · 0.45
runMethod · 0.45

Calls 7

colsMethod · 0.95
incrementMethod · 0.95
lengthMethod · 0.45
isSparseMethod · 0.45
getIndexMethod · 0.45
getValueMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected