Functional Optimization by Variable-Basis Approximation Schemes