public static Tensor edgeScoresToTensor ( EdgeScores es , Algebra s ) { int n = es . child . length ; Tensor m = new Tensor ( s , n , n ) ; for ( int p = - 1 ; p < n ; p ++ ) { for ( int c = 0 ; c < n ; c ++ ) { if ( p == c ) { continue ; } int pp = getTensorParent ( p , c ) ; m . set ( es . getScore ( p , c ) , pp , c ) ; } } return m ; }
Convert an EdgeScores object to a Tensor where the wall node is indexed as position n + 1 in the Tensor .