public void setEdgeWeight( Vertex<T> v1, double newWeight,
                             Vertex<T> v2 ) {
    if ( newWeight < 0.0 ) {
      throw new IllegalArgumentException( "Edge weight "
                                          + "must be >= 0.0" );
    }
    int v1Pos = super.getVerticesIndexFor( v1 );
    int v2Pos = super.getVerticesIndexFor( v2 );
    // if we get here, method in superclass didn't throw an
    // exception and method preconditions are met
    weights[v1Pos][v2Pos] = newWeight;
    weights[v2Pos][v1Pos] = newWeight;
  }