public double [ ] [ ] buildBondMatrix ( ) { int i , j , k , m ; for ( i = 0 ; i < nodeNumber ; i ++ ) { for ( j = 1 ; j <= layerNumber ; j ++ ) { bondMatrix [ i ] [ j - 1 ] = 0.0 ; for ( k = 0 ; k < nodeNumber ; k ++ ) { if ( j == 1 ) { if ( apspMatrix [ i ] [ k ] == j ) { bondMatrix [ i ] [ j - 1 ] += adjaMatrix [ i ] [ k ] ; } } else { if ( apspMatrix [ i ] [ k ] == j ) { for ( m = 0 ; m < nodeNumber ; m ++ ) { if ( apspMatrix [ i ] [ m ] == ( j - 1 ) ) { bondMatrix [ i ] [ j - 1 ] += adjaMatrix [ k ] [ m ] ; } } } } } } } return bondMatrix ; }
Build bond matrix .