class Matrix {

  public ColumnVector multiply(final ColumnVector vector) {
    if (this.numCols != vector.size()) {
      throw new IllegalArgumentException("vector size and matrix column count must be equal");
    }

    final double[] rawResult = new double[this.numRows];
    final double[] rawVector = vector.getRaw();

    this.forEach((r, c, v) -> rawResult[r] += v * rawVector[c]);
    return new ColumnVector(rawResult);
  }

  protected  Matrix(final int numRows, final int numCols);

}