METHOD FOR CONFIGURING AND OPTIMISING PROGRAMMABLE PHOTONIC DEVICES BASED ON MESH STRUCTURES OF INTEGRATED OPTICAL WAVE GUIDES