use of dr.inference.model.MatrixMatrixProduct in project beast-mcmc by beast-dev.
the class MatrixMatrixProductParser method parseXMLObject.
@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
MatrixParameter[] temp = new MatrixParameter[3];
temp[0] = (MatrixParameter) xo.getChild(LEFT).getChild(MatrixParameter.class);
temp[1] = MatrixParameter.recast(((CompoundParameter) xo.getChild(RIGHT).getChild(CompoundParameter.class)).getVariableName(), (CompoundParameter) xo.getChild(RIGHT).getChild(CompoundParameter.class));
if (xo.getChild(IN_PLACE) != null) {
temp[2] = (MatrixParameter) xo.getChild(IN_PLACE).getChild(MatrixParameter.class);
} else {
int rowDim = temp[0].getRowDimension();
int colDim = temp[1].getColumnDimension();
Parameter[] params = new Parameter[colDim];
for (int i = 0; i < colDim; i++) {
params[i] = new Parameter.Default(rowDim);
}
temp[2] = new MatrixParameter(null, params);
}
Parameter ColumnMask;
if (xo.getChild(COLUMN_MASK) != null)
ColumnMask = (Parameter) xo.getChild(COLUMN_MASK).getChild(MatrixParameter.class);
else
ColumnMask = new Parameter.Default(null, temp[1].getColumnDimension(), 1);
return new MatrixMatrixProduct(temp, ColumnMask);
}
Aggregations