class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializable {

    @Override
    public double[] preMultiply(final double[] v)
        throws DimensionMismatchException {
        final int nRows = getRowDimension();
        final int nCols = getColumnDimension();
        if (v.length != nRows) {
            throw new DimensionMismatchException(v.length, nRows);
        }

        final double[] out = new double[nCols];
        for (int col = 0; col < nCols; ++col) {
            double sum = 0;
            for (int i = 0; i < nRows; ++i) {
                sum += data[i][col] * v[i];
            }
            out[col] = sum;
        }

        return out;

    }

    public  Array2DRowRealMatrix();
    public  Array2DRowRealMatrix(final int rowDimension,
                                final int columnDimension);
    public  Array2DRowRealMatrix(final double[][] d);
    public  Array2DRowRealMatrix(final double[][] d, final boolean copyArray);
    public  Array2DRowRealMatrix(final double[] v);

}