The optimize_functor needs only constant references to the affected variables and variable names vectors.