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

Method transposeMultiply

JSAT/src/jsat/linear/DenseMatrix.java:117–135  ·  view source on GitHub ↗
(double c, Vec b, Vec x)

Source from the content-addressed store, hash-verified

115 }
116
117 @Override
118 public void transposeMultiply(double c, Vec b, Vec x)
119 {
120 if(this.rows() != b.length())
121 throw new ArithmeticException("Matrix dimensions do not agree, [" + cols() +"," + rows() + "] x [" + b.length() + ",1]" );
122 else if(this.cols() != x.length())
123 throw new ArithmeticException("Matrix dimensions do not agree with target vector");
124
125 for(int i = 0; i < rows(); i++)//if b was sparce, we want to skip every time b_i = 0
126 {
127 double b_i = b.get(i);
128 if(b_i == 0)//Skip, not quite as good as sparce handeling
129 continue;//TODO handle sparce input vector better
130
131 double[] A_i = this.matrix[i];
132 for(int j = 0; j < cols(); j++)
133 x.increment(j, c*b_i*A_i[j]);
134 }
135 }
136 @SuppressWarnings("unused")
137 private Matrix blockMultiply(Matrix b)
138 {

Callers 1

trainMethod · 0.95

Calls 11

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

Tested by

no test coverage detected