Questions tagged [matrix-inverse]

The matrix inverse, A^{-1}, is a mathematical relationship such that given a square n x n matrix A, A*A^{-1} = A^{-1}*A = I, where I is the identity matrix. Use this tag with regards to any numerical methods or computations that require the use or calculation of the matrix inverse.

Computation of the inverse of a square matrix, provided it is invertible (i.e., full-rank), is often via LU factorization. When the matrix is positive-definite, Cholesky factorization is often used. In standard numerical linear algebra library , dgesv and dpotrf respectively performs LU and Cholesky factorization.

In reality it is rare that a matrix inverse needs be explicitly formed, and matrix multiplications involving a matrix inverse is done by one of the factorizations above, and a triangular system solving.

509 questions
-2
votes
1 answer

Solve function in R doesn't match inverse calculation

There seem to be a ton of questions about inverse functions, but they're not what I'm after (neither are many of the results in the matrix-inverse tag). I'm trying to use a function that gets the inverse of a matrix. As an example, this is the…
Shawn Hemelstrand
  • 2,676
  • 4
  • 17
  • 30
-2
votes
2 answers

Python - Inversing complex arrays

I have some square matrix with complex values and want to inverse it. If I try: (my_matrix)**(-1) I get: ZeroDivisionError: 0.0 to a negative or complex power If I try: import numpy as np np.linalg.inv(my_matrix) I get: TypeError: No loop…
Wiktor Kujawa
  • 595
  • 4
  • 21
-2
votes
2 answers

Gaussian Elimination leading to a last diagonal element going to zero

I am using gaussian elimination to invert a matrix. Basically trying to use it to find the descent direction because somehow I feel taking the inverse is very slow. Gaussian elimination does speed up finding the descent direction. However during the…
-2
votes
1 answer

How to perform PyCUDA 4x4 matrix inversion with same accuracy than numpy linalg "inv" or "pinv" function

I am facing an issue of accuracy about my code which performs a number (128, 256, 512) of 4x4 matrix inversions. When I use the original version, i.e the numpy function np.linalg.inv or np.linalg.pinv, everything works fine. Unfortunately, with the…
user1773603
-2
votes
1 answer

Can I stably invert a Vandermonde matrix with many small values in R?

updated on this question: I have closed this question and I will post a new question focus on R package Rmpfr. To conclude this question and to help others, I will post my codes of the inverse of a Vandermonde Matrix from its explicit inverse…
J.Z.
  • 415
  • 2
  • 11
-2
votes
1 answer

How to calculate the inverse of a non-square complex matrix in Java?

We've already found the algorithm to calculate the inverse of a square matrix containing complex numbers. Now, the problem is that we don't know how to calculate the inverse of a complex matrix while it is non-square?
zahra.bsh
  • 21
  • 2
-2
votes
1 answer

Inverse of matrix different when using Excel and Python

I have this matrix array([[ 4.58437363e-04, 6.87656045e-03, 6.87656045e-02, 1.10652674e-01, 1.65979011e+00, 1.65979011e+01, 3.66749891e-03, 5.50124836e-02, 5.50124836e-01, 8.85221390e-01, 1.32783208e+01, …
Matt Cremeens
  • 4,951
  • 7
  • 38
  • 67
-2
votes
1 answer

Fortran TDMA algorithm on wiki

I recently visited the wiki site: https://en.wikibooks.org/wiki/Algorithm_Implementation/Linear_Algebra/Tridiagonal_matrix_algorithm#Fortran_90 It says that a,b,c are the sub-diagonal, diagonal, and super-diagonal. If 'n' is the size of b, then…
Charles
  • 947
  • 1
  • 15
  • 39
-3
votes
1 answer

How to parallelize inversion of a sparse matrix?

I'm using eigen3 package in c++ to invert some large sparse matrices (e.g. 12000*12000) which I need for later operations; however, it's really time-consuming and I can't extend it to larger matrices. Is it possible to do this in parallel for…
So R Kh
  • 3
  • 3
-3
votes
2 answers

invert matrix in matlab/sorting a matrix in matlab

I have this problem that I need to sort a matrix in MATLAB. Input:(2x5 matrix) 1 2 3 4 5 6 7 8 9 10 And I'd like the output to be.(2x5) 9 10 7 8 5 6 3 4 1 2 I would like to invert first matrix, help is needed.
-3
votes
1 answer

Gaussian Elimination Inverse Matrix

What does you block of code shown below do? I'm confused if (temp != j) for (k = 0; k < 2 * dimension; k++) { temporary = augmentedmatrix[j][k]; augmentedmatrix[j][k] = augmentedmatrix[temp][k]; …
user3000403
  • 7
  • 1
  • 6
-4
votes
1 answer

Why the intermediate values in matrix inverse calculations are slightly different between C# and CUDA C++?

I wrote two programs to calculate the inverse of a matrix using Gaussian elimination, the first program was in C# and the second in CUDA C++. The two programs follow exactly the same procedure and gives the same final results. However, when I…
AbdelAziz AbdelLatef
  • 3,650
  • 6
  • 24
  • 52
1 2 3
33
34