@Override
    public int indexOfMax() {
        int index = 0;
        double value = Double.NEGATIVE_INFINITY;
        for (int i = 0; i < elements.length; i++) {
            double tmp = get(i);
            if (tmp > value) {
                index = i;
                value = tmp;
            }
        }
        return index;
    }
@Test
    public void maxIndex() {
        DenseVector s = generateVectorB();
        assertEquals(5,s.indexOfMax());
    }