Improve performance of hotnet2.induce_infmat method