public int indexHavingMaxValue()
{
if (size() <= 0)
{
throw new InvalidOperationException("can't perform this op on empty vector");
}
int res = 0;
for (int i = 0; i < size(); i++)
{
if (getValue(i) > getValue(res))
{
res = i;
}
}
return res;
}
}
public bool isCorrect(Vector prediction) { /* * compares the index having greatest value in target to indec having * greatest value in prediction. Ifidentical, correct */ return getTarget().indexHavingMaxValue() == prediction .indexHavingMaxValue(); }