org.jocl.cloth
Class ClothClusterPartitioner

java.lang.Object
  extended by org.jocl.cloth.ClothClusterPartitioner

public class ClothClusterPartitioner
extends java.lang.Object

A class for computing lists of edge lists that are mutually disjoint and created by clustering the vertices of a given set of input edges.


Method Summary
static
<T extends de.javagl.simplemesh.Edge>
java.util.List<java.util.List<java.util.List<T>>>
computeClustersEdgeLists(java.util.Collection<T> edges, int numClusters)
          Compute lists of edge lists by clustering the vertices of the given edge collection and combining clusters that are not adjacent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

computeClustersEdgeLists

public static <T extends de.javagl.simplemesh.Edge> java.util.List<java.util.List<java.util.List<T>>> computeClustersEdgeLists(java.util.Collection<T> edges,
                                                                                                                               int numClusters)
Compute lists of edge lists by clustering the vertices of the given edge collection and combining clusters that are not adjacent.

The result will be a list of lists of edge lists. Each list of edge lists will contain edge lists that are mutually disjoint. The total number of edge lists will be the given 'numClusters'.

For example, when called with numClusters=10, then the result of this call may be the following:

where it is made sure that
The number of resulting lists will depend on the adjacency of the clusters, and usually be in the range of 6-8. Thus, in order to process the resulting lists with n threads, the numClusters should be about n*8. The n threads can then process the edge lists of result.get(0) in parallel, then the lists of result.get(1) and so on.

Type Parameters:
T - The edge type
Parameters:
edges - The input edges
numClusters - The number of clusters to use.
Returns:
The edge lists