  We demonstrate a simple method for controlling nonlinear switching of
discrete solitons in arrays of weakly coupled optical waveguides, for both
cubic and uadratic nonlinearities. Based on the effective discrete nonlinear
equations describing the waveguide arrays in the tight-binding approximation,
we develop the concept of the array engineering by means of a step-like
variation of the waveguide coupling. We demonstrate the digitized switching of
a narrow input beam for up to eleven neighboring waveguides, in the case of the
cubic nonlinearity, and up to ten waveguides, in the case of quadratic
nonlinearity. We discuss our predictions in terms of the physics of the
engineered Peierls-Nabarro (PN) potential experienced by strongly localized
nonlinear modes moving in a lattice and calculate, for the first time, the PN
potential for the quadratic nonlinear array. We also confirm our concept and
major findings for a full-scaled continuous model and realistic parameters, by
means of the beam propagation method.
