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

Method transposeMultiply

JSAT/src/jsat/linear/GenericMatrix.java:364–381  ·  view source on GitHub ↗
(double c, Vec b, Vec x)

Source from the content-addressed store, hash-verified

362 }
363
364 @Override
365 public void transposeMultiply(double c, Vec b, Vec x)
366 {
367 if(this.rows() != b.length())
368 throw new ArithmeticException("Matrix dimensions do not agree, [" + cols() +"," + rows() + "] x [" + b.length() + ",1]" );
369 else if(this.cols() != x.length())
370 throw new ArithmeticException("Matrix dimensions do not agree with target vector");
371
372 for(int i = 0; i < rows(); i++)//if b was sparce, we want to skip every time b_i = 0
373 {
374 double b_i = b.get(i);
375 if(b_i == 0)//Skip, not quite as good as sparce handeling
376 continue;//TODO handle sparce input vector better
377
378 for(int j = 0; j < cols(); j++)
379 x.increment(j, c*b_i*this.get(i, j));
380 }
381 }
382
383 @Override
384 public void transposeMultiply(final Matrix b, Matrix C)

Callers

nothing calls this directly

Calls 11

submitMethod · 0.80
logMethod · 0.80
getNameMethod · 0.65
rowsMethod · 0.45
lengthMethod · 0.45
colsMethod · 0.45
getMethod · 0.45
incrementMethod · 0.45
minMethod · 0.45
maxMethod · 0.45
awaitMethod · 0.45

Tested by

no test coverage detected