Non-homogeneous stochastic LQ control with regime switching and random coefficients (Mathematical control and related fields, 2024)