class DenseVector extends Vector {

    @Override
    public DenseVector slice(int[] indices) {
        double[] values = new double[indices.length];
        for (int i = 0; i < indices.length; ++i) {
            if (indices[i] >= data.length) {
                throw new IllegalArgumentException("Index is larger than vector size.");
            }
            values[i] = data[indices[i]];
        }
        return new DenseVector(values);
    }

    public  DenseVector();
    public  DenseVector(int n);
    public  DenseVector(double[] data);

}