The code including the finalMatrix changes to 'long double'

Signed-off-by: ezheng <ezheng@cs.unc.edu>