Optimization-techniques for efficient measurement of the transmission-matrix of scattering media