By making use of the quotient singular value decomposition (QSVD) of a matrix pair,this paper establishes the necessary and sufficient conditions for the existence of and the expressions for the general solutions of the linear matrix equation AXAT + BYBT = C with the unknown X and Y, which may be both symmetric, skew-symmetric, nonnegative definite , positive definite or some cross combinations respectively. Also, the solutions of some optimal problems are derived.