General transfer-matrix method for optical multilayer systems with coherent, partially coherent, and incoherent interference | Synapse