Vector (Vector vector) { if (getColumns() != vector.getSize()) throw new IllegalArgumentException("columns mismatch length"); double[] result = new double[getRows()]; for (int i = 0; i < result.length; i++) result[i] = getRow(i).multiply(vector); return new Vector(result); }