Matrix Factorization for Solutions of the Yang–Baxter Equation