Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D4DC497DB for ; Wed, 7 Mar 2012 23:08:35 +0000 (UTC) Received: (qmail 16734 invoked by uid 500); 7 Mar 2012 23:08:35 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 16674 invoked by uid 500); 7 Mar 2012 23:08:35 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 16667 invoked by uid 99); 7 Mar 2012 23:08:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Mar 2012 23:08:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Mar 2012 23:08:34 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id EEBD02388847 for ; Wed, 7 Mar 2012 23:08:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1298196 - in /commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph: model/ spanning/ Date: Wed, 07 Mar 2012 23:08:13 -0000 To: commits@commons.apache.org From: simonetripodi@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120307230813.EEBD02388847@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: simonetripodi Date: Wed Mar 7 23:08:13 2012 New Revision: 1298196 URL: http://svn.apache.org/viewvc?rev=1298196&view=rev Log: plugged the edge mapper inside the weighted spanning tree Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/model/MutableSpanningTree.java commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeAlgorithmSelector.java commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeSourceSelector.java commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/ShortestEdges.java Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/model/MutableSpanningTree.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/model/MutableSpanningTree.java?rev=1298196&r1=1298195&r2=1298196&view=diff ============================================================================== --- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/model/MutableSpanningTree.java (original) +++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/model/MutableSpanningTree.java Wed Mar 7 23:08:13 2012 @@ -19,6 +19,7 @@ package org.apache.commons.graph.model; * under the License. */ +import org.apache.commons.graph.Mapper; import org.apache.commons.graph.SpanningTree; import org.apache.commons.graph.weight.Monoid; @@ -38,12 +39,17 @@ public final class MutableSpanningTree weightOperations; + private final Monoid weightOperations; + + private final Mapper weightedEdges; private W weight; - public MutableSpanningTree(Monoid weightOperations) { + public MutableSpanningTree( Monoid weightOperations, Mapper weightedEdges ) + { this.weightOperations = weightOperations; + this.weightedEdges = weightedEdges; + this.weight = weightOperations.zero(); } @@ -62,7 +68,7 @@ public final class MutableSpanningTree spanningTree = new MutableSpanningTree( weightOperations ); + final MutableSpanningTree spanningTree = new MutableSpanningTree( weightOperations, weightedEdges ); final Set> components = new HashSet>( graph.getOrder() ); @@ -182,7 +182,7 @@ final class DefaultSpanningTreeAlgorithm final DisjointSet disjointSet = new DisjointSet(); - final MutableSpanningTree spanningTree = new MutableSpanningTree( weightOperations ); + final MutableSpanningTree spanningTree = new MutableSpanningTree( weightOperations, weightedEdges ); // fill the spanning tree with vertices. for ( V v : graph.getVertices() ) Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeSourceSelector.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeSourceSelector.java?rev=1298196&r1=1298195&r2=1298196&view=diff ============================================================================== --- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeSourceSelector.java (original) +++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeSourceSelector.java Wed Mar 7 23:08:13 2012 @@ -121,7 +121,7 @@ final class DefaultSpanningTreeSourceSel } } - final MutableSpanningTree res = new MutableSpanningTree( weightOperations ); + final MutableSpanningTree res = new MutableSpanningTree( weightOperations, weightedEdges ); for ( V v : graph.getVertices() ) { res.addVertex( v ); Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/ShortestEdges.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/ShortestEdges.java?rev=1298196&r1=1298195&r2=1298196&view=diff ============================================================================== --- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/ShortestEdges.java (original) +++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/spanning/ShortestEdges.java Wed Mar 7 23:08:13 2012 @@ -79,7 +79,7 @@ final class ShortestEdges */ public SpanningTree createSpanningTree() { - MutableSpanningTree spanningTree = new MutableSpanningTree( weightOperations ); + MutableSpanningTree spanningTree = new MutableSpanningTree( weightOperations, weightedEdges ); for ( WE edge : this.predecessors.values() ) {