コード例 #1
0
ファイル: GraphUnion.java プロジェクト: CaoAo/BeehiveZ
 public double getEdgeWeight(E e) {
   if (g1.containsEdge(e) && g2.containsEdge(e)) {
     return operator.combine(g1.getEdgeWeight(e), g2.getEdgeWeight(e));
   }
   if (g1.containsEdge(e)) {
     return g1.getEdgeWeight(e);
   }
   if (g2.containsEdge(e)) {
     return g2.getEdgeWeight(e);
   }
   throw new IllegalArgumentException("no such edge in the union");
 }