DF-4918 fix matrix decomposition, add unit test