public double[] arrayCopy(){
  double[] array=new double[length()];
  for (  IndexValue iv : this)   array[iv.getIndex()]=iv.getValue();
  return array;
}

public double [ ] arrayCopy ( ) { double [ ] array = new double [ length ( ) ] ; for ( IndexValue iv : this ) array [ iv . getIndex ( ) ] = iv . getValue ( ) ; return array ; }
creates a new array that contains all the values of this vector in the appropriate indices
