fix: fix a memory leak in MinpolyMatrix::getFactors()
chg: add comments for minpoly_generic