use sparse matrix for the diag, performance improved 10x
Merge branch 'master' of https://github.com/kindlychung/bglogisr