/* * MatrixMatrixProduct.java * * Copyright (c) 2002-2015 Alexei Drummond, Andrew Rambaut and Marc Suchard * * This file is part of BEAST. * See the NOTICE file distributed with this work for additional * information regarding copyright ownership and licensing. * * BEAST is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * BEAST is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with BEAST; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ package dr.inference.model; /* @author Max Tolkoff */ //Designed to return a data matrix post computation if asked. Designed for latent liabilities public class MatrixMatrixProduct extends MatrixParameter implements VariableListener { MatrixParameter left; MatrixParameter right; MatrixParameter inPlace; private final int leftDim; private final int rightDim; private final int midDim; Parameter columnMask; boolean[][] oldStoredValues; double[][] storedValues; boolean[][] areValuesStored; private Bounds bounds=null; public MatrixMatrixProduct(MatrixParameter[] params, Parameter columnMask) { super(null, params); this.columnMask=columnMask; this.left=params[0]; this.right=params[1]; if(params.length==3){ inPlace=params[2]; inPlace.addVariableListener(this); } storedValues=new double[left.getRowDimension()][right.getColumnDimension()]; areValuesStored=new boolean[left.getRowDimension()][right.getColumnDimension()]; oldStoredValues=new boolean[left.getRowDimension()][right.getColumnDimension()]; for (int i = 0; i getBounds() { return bounds; } public void addDimension(int index, double value) { throw new RuntimeException("Not yet implemented."); } public double removeDimension(int index) { throw new RuntimeException("Not yet implemented."); } };