(Matrix B, Matrix C)
| 306 | } |
| 307 | |
| 308 | @Override |
| 309 | public void transposeMultiply(Matrix B, Matrix C) |
| 310 | { |
| 311 | if(this.rows() != B.rows())//Normaly it is A_cols == B_rows, but we are doint A'*B, not A*B |
| 312 | throw new ArithmeticException("Matrix dimensions do not agree"); |
| 313 | else if(this.cols() != C.rows() || B.cols() != C.cols()) |
| 314 | throw new ArithmeticException("Destination matrix does not have matching dimensions"); |
| 315 | final SparseMatrix A = this; |
| 316 | ///Should choose step size such that 2*NB2^2 * dataTypeSize <= CacheSize |
| 317 | |
| 318 | final int kLimit = this.rows(); |
| 319 | |
| 320 | for (int k = 0; k < kLimit; k++) |
| 321 | { |
| 322 | Vec bRow_k = B.getRowView(k); |
| 323 | Vec aRow_k = A.getRowView(k); |
| 324 | |
| 325 | for (IndexValue iv : aRow_k)//iterating over "i" |
| 326 | { |
| 327 | |
| 328 | Vec cRow_i = C.getRowView(iv.getIndex()); |
| 329 | double a = iv.getValue();//A.get(k, i); |
| 330 | |
| 331 | cRow_i.mutableAdd(a, bRow_k); |
| 332 | } |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | @Override |
| 337 | public void transposeMultiply(final Matrix B, final Matrix C, ExecutorService threadPool) |
nothing calls this directly
no test coverage detected