You don't need to use the this pointer when working in a class member. It is assumed. So first take this-> out of the constructor.
I'm not quite sure what the template for polynomial is, so if you could post some of that that would be great.
I have a feeling it has to do with the way you are nesting templates.
If you could post the error, it would make things a lot easier.
Would this be correct: (I don't have access to a pc with a c++ compiler in the moment) entries = vector<vector<polynomial<double, 4, 2> > > (dim, vector<polynomial<double, 4, 2> > (dim, 0));
if your polynomial<double, 4, 2> class has a non-explicit constatructor taking a value of a type that 0 is convertible to, then yes. Just to be sure you can remove do this: entries = vector<vector<polynomial<double, 4, 2> > > (dim, vector<polynomial<double, 4, 2> > (dim));
Then it would impicitly call entries = vector<vector<polynomial<double, 4, 2> > > (dim, vector<polynomial<double, 4, 2> > (dim, polaynomial<double, 4, 2>()));