funcApprox has input 'permuted' to permute dimensions of outcome
Smolyak interpolation: Now it is done by SmolyakGrid function.

Previous implementation computed full tensor product and then selected the valid combinations (too expensive, out of memory error for n = 9, d = 8).
New procedure combines the dimensions sequentially, eliminating those that are not valid in each step.