Henrik has already written on the undocumented second argument of a LinearSolveFunction[], so let me just put out a short demo wrapper showing how to use the built-in, but undocumented LAPACK routines to solve a linear equation, given the output of LUDecomposition[]:
Options[backsub] = {Mode -> Automatic}; backsub[lu_, perm_, opts : OptionsPattern[]][rhs_] := Module[{xx = rhs, piv, switch}, piv = LinearAlgebra`LAPACK`PermutationToPivot[perm]; switch = Switch[OptionValue[Mode], Normal | Automatic, "N", Transpose, "T", ConjugateTranspose, "C", _, "N"]; LinearAlgebra`LAPACK`GETRS[switch, lu, piv, xx]; xx]
For example, after using LUDecomposition[] as usual,
mat = N[{{1, 2 - I, 3}, {1 + 4 I, 5, 6 + 3 I}, {7 - 5 I, 8 - 2 I, 9}}]; {lu, perm, cond} = LUDecomposition[mat] {{{7. - 5. I, 8. - 2. I, 9. + 0. I}, {-0.175676 + 0.445946 I, 5.51351 - 3.91892 I, 7.58108 - 1.01351 I}, {0.0945946 + 0.0675676 I, 0.249262 - 0.0679268 I, 0.32782 + 0.15948 I}}, {3, 2, 1}, 115.139}
we can do this:
new = {{14 - 2 I, 24 - 7 I, 24 + 7 I}, {29 + 13 I, 36 - 7 I, 36 + 7 I}, {50 - 9 I, 42 + 6 I, 42 - 6 I}}; bs = backsub[lu, perm]; bs[new] // Chop {{1., -3.2 + 7.4 I, -8.8 + 4.6 I}, {2., -25.4 + 3.4 I, -25. - 32.2 I}, {3., 24.8667 - 15.5333 I, 38.3333 + 13.9333 I}} bsh = backsub[lu, perm, Mode -> ConjugateTranspose]; bsh[new] // Chop {{40.1333 - 9.2 I, -21.8 + 74.4 I, 1.}, {-6.86667 + 0.466667 I, 13.2 - 17.6 I, 2.}, {-3.4 - 0.533333 I, 9. - 8. I, 3.}} bst = backsub[lu, perm, Mode -> Transpose]; bst[new] // Chop {{23.9333 - 115.4 I, 1., -21.8 - 74.4 I}, {2.93333 + 32.9333 I, 2., 13.2 + 17.6 I}, {6.6 + 14.5333 I, 3., 9. + 8. I}}
LinearSolve, which also chooses the best algorithm (Method) depending on the type of matrix you give to it. $\endgroup$Inverse. IfLinearSolvewould be the way to go, clearly this is howInversewould have been implemented. $\endgroup$LinearSolve[A, b]is the closest Mathematica equivalent toA \ b, other than in a link. But it doesn't seem worth a new answer.... $\endgroup$LeastSquares[]in your list. Use that if you don't have square matrices, but you want a minimum norm solution to your linear equation. $\endgroup$