fix bugs: getpairwiseweight