Add a dictionary dcolors such that dcolors[c] is an array of the components of vals that will be computed by the directional derivative associated with color c.
We don't need anymore for each color to iterate over all variables to recover which column should be updated.
dcolors
such thatdcolors[c]
is an array of the components ofvals
that will be computed by the directional derivative associated with colorc
.We don't need anymore for each color to iterate over all variables to recover which column should be updated.