public double max(){
  if (isSparse() && nnz() < length()) {
    double max=0.0;
    for (    IndexValue iv : this)     max=Math.max(max,iv.getValue());
    return max;
  }
 else {
    double max=get(0);
    for (int i=1; i < length(); i++)     max=Math.max(max,get(i));
    return max;
  }
}

public double max ( ) { if ( isSparse ( ) && nnz ( ) < length ( ) ) { double max = 0.0 ; for ( IndexValue iv : this ) max = Math . max ( max , iv . getValue ( ) ) ; return max ; } else { double max = get ( 0 ) ; for ( int i = 1 ; i < length ( ) ; i ++ ) max = Math . max ( max , get ( i ) ) ; return max ; } }
returns the maximum value stored in this vector
