update matrixgen to support compressed input