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

Method multiply

JSAT/src/jsat/linear/SparseVector.java:537–552  ·  view source on GitHub ↗
(double c, Matrix A, Vec b)

Source from the content-addressed store, hash-verified

535 }
536
537 @Override
538 public void multiply(double c, Matrix A, Vec b)
539 {
540 if(this.length() != A.rows())
541 throw new ArithmeticException("Vector x Matrix dimensions do not agree");
542 else if(b.length() != A.cols())
543 throw new ArithmeticException("Destination vector is not the right size");
544
545 for(int i = 0; i < used; i++)
546 {
547 double val = c*this.values[i];
548 int index = this.indexes[i];
549 for(int j = 0; j < A.cols(); j++)
550 b.increment(j, val*A.get(index, j));
551 }
552 }
553
554 @Override
555 public void mutableAdd(double c)

Callers

nothing calls this directly

Calls 5

lengthMethod · 0.95
rowsMethod · 0.45
colsMethod · 0.45
incrementMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected