/// <summary>Solve X*A = B, which is also A'*X' = B'</summary> /// <param name="B"> right hand side /// </param> /// <returns> solution if A is square, least squares solution otherwise. /// </returns> public virtual GeneralMatrix SolveTranspose(GeneralMatrix B) { return(Transpose().Solve(B.Transpose())); }
/// <summary>Solve A*X = B</summary> /// <param name="B"> right hand side /// </param> /// <returns> solution if A is square, least squares solution otherwise /// </returns> public virtual GeneralMatrix Solve(GeneralMatrix B) { return(m == n ? MagiaInversa(new LUDecomposition(Magia(this)).Solve(Magia(B)), m, n):MagiaInversa(new QRDecomposition(Magia(this)).Solve(Magia(B)), m, n)); }