Added template method which generically iterates over the member data of OptimizationParams.