Dear Community,

Can anyone tell me if there is a function or library I can use for matrix inversion. I need to calculate the inverse of a large matrix which I read in from an Excel file. It is possible to invert the matrix in Excel first but I need Xpress to perform this operation.

Any suggestions would be much appreciated.

Kind regards,

Alistair

Hi Alistair,

which programming/modeling language are you using? Mosel/Python/Java/C++?

If you are just interested in solving Ax=b for a single b, then you can simply solve

max 0 s.t. Ax = bwhere A is your invertible n-times-n matrix. If you need the inverse of A, you could in theory also use Xpress to invert a the matrix, by solving

max 0 s.t. Ax_i = e_ifor alli ∈ {1, ..., n}where A is your invertible n-times-n matrix,

x_i ∈ R^n, ande_1 = (1, 0, ..., 0)', ...,e_n = (0, ..., 0, 1)'.If you are using Mosel, you can use

R from Moselto invert your matrix.If you are using Python, you can use

NumPy.An alternative solution would be to use XPRSftran or XPRSbtran (not available from Mosel). Let me know if you are interested in that solution.

Regards,

Johannes