polynomial and piecewise_polynomial : remove dim from template and init it from the size of the points