implement getconstrmatrix. replaceInf
fix deprecated ends_with
typo