libfpoly matrix functions