private Matrix calculateEdgeSimMatrix ( final List < Edge > edgeList , final SparseMatrix sm ) { final int numEdges = edgeList . size ( ) ; final Matrix edgeSimMatrix = new SparseSymmetricMatrix ( new SparseHashMatrix ( numEdges , numEdges ) ) ; Object key = workQueue . registerTaskGroup ( numEdges ) ; for ( int i = 0 ; i < numEdges ; ++ i ) { final int row = i ; workQueue . add ( key , new Runnable ( ) { public void run ( ) { for ( int j = row ; j < numEdges ; ++ j ) { Edge e1 = edgeList . get ( row ) ; Edge e2 = edgeList . get ( j ) ; double sim = getEdgeSimilarity ( sm , e1 , e2 ) ; if ( sim > 0 ) { // The symmetric matrix handles the (j,i) case edgeSimMatrix . set ( row , j , sim ) ; } } } } ) ; } workQueue . await ( key ) ; return edgeSimMatrix ; }
Calculates the similarity matrix for the edges . The similarity matrix is symmetric .