samer@0: /* samer@0: * Copyright (c) 2000, Samer Abdallah, King's College London. samer@0: * All rights reserved. samer@0: * samer@0: * This software is provided AS iS and WITHOUT ANY WARRANTY; samer@0: * without even the implied warranty of MERCHANTABILITY or samer@0: * FITNESS FOR A PARTICULAR PURPOSE. samer@0: */ samer@0: samer@0: package samer.maths; samer@0: import samer.tools.*; samer@0: samer@0: public class MatrixTransposeTimesVector extends VectorFunctionOfVector samer@0: implements SafeTask samer@0: { samer@0: int m, n; samer@0: double [][] a; samer@0: double [] x, y, arow; samer@0: samer@0: public MatrixTransposeTimesVector( Vec out, Matrix matrix, Vec in) { samer@0: this(out.array(),matrix,in.array()); samer@0: } samer@0: public MatrixTransposeTimesVector(Matrix matrix) { samer@0: m = matrix.getRowDimension(); samer@0: n = matrix.getColumnDimension(); samer@0: a = matrix.getArray(); samer@0: } samer@0: samer@0: public MatrixTransposeTimesVector( double[] out, Matrix matrix, double[] in) { samer@0: this(matrix); x = in; y = out; samer@0: } samer@0: samer@0: public void dispose() {} samer@0: public void starting() {} samer@0: public void stopping() {} samer@0: public void run() { samer@0: java.util.Arrays.fill(y,0); samer@0: for (int j=0; j