class AbstractVector implements Vector {

    @Override public double dot(Vector vec) {
        checkCardinality(vec);

        double sum = 0.0;
        int len = size();

        for (int i = 0; i < len; i++)
            sum += storageGet(i) * vec.getX(i);

        return sum;
    }

    public  AbstractVector(VectorStorage sto);
    public  AbstractVector(boolean readOnly, VectorStorage sto);
    public  AbstractVector();

}