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
0
votes
2 answers

How can I make a c++ program to find the determinate and inverse of any sized matrix?

I know how to find these in a 1x1 2x2 and 3x3 but I want to make a program that lets me enter the dimensions of my matrix and then enter the numbers that go in the matrix. After entering the numbers I want it to give the determinate (if able to get…
Matthew
  • 1
  • 1
0
votes
2 answers

Matrix Inversion Cholesky Factorization -> results not exact

I am calculating the inverse of a square matrix using different libraries via Cholesky factorization. However my results are not as I was expecting. I am not an expert in maths, but I was expecting to get a closer result. I am using MLK, magma and…
Manolete
  • 3,431
  • 7
  • 54
  • 92
0
votes
1 answer

Run-Time Check Failure #2 - Stack around the variable 'B' was corrupted

this error keeps coming up yet i dont see a problem with the code (its in c++) the program is supposed to find the inverse of a 2x2 matrix #include using namespace std; int main() { float d; float A[2][2], B[2][2]; do { …
noname
  • 1
  • 1
  • 1
0
votes
2 answers

inverse of a matrix

in matlab inverse of matlab can be written: For least squares ( more efficient) x = A\b.--------------------------------1 But for covariance matrix (Qxx) of unknown paramters(x), I usually do, Qxx==inv(A) --------------------------2 How I can…
Shahgee
  • 3,303
  • 8
  • 49
  • 81
-1
votes
1 answer

inverse of a 2D array (matrix)

I've made a function to calculate the inverse of a matrix, but I'm having an issue getting the correct result when I run my program. For example, when I insert the following matrix: A1 A2 A3 (2 1 0) (1 2 1) (0 1 2) I get this…
-1
votes
1 answer

Adjoint of Matrix in C++. (Inverse of Matrix)

I am Implementing a Inverse Matrix by using the following formula Inverse of A = (Adj of A) / (Determinant of A) I am implementing Adjoint Matrix, But When I printing the result of adjoint function , the result is printed in this way. -23 -20 34 19…
John Mike
  • 7
  • 2
-1
votes
1 answer

Pivot/inverse Pandas Dataframe using key pairs

I have this dataframe that I would like to flip M1 M2 M3 John 0.10 0.74 0.25 Alex 0.80 0.15 0.05 I would like to convert it to this format: M value John M1 0.10 John M2 …
-1
votes
1 answer

Using sparse solver like SuperLU etc. to find the matrix inverse in fortran

Ok i want to compare the result using inverse of matrix for dense rectangular matrix non symmetric. Usually using DGETRF and DGETRI Blas for get the matrix inverse. Let say [2000x2000] double precision matrix A, i want to solve to find the matrix -…
realbabilu
  • 11
  • 3
-1
votes
1 answer

Why does numpy np.linalg.inv returns two close but different result while finding inverse of a matrix?

I am trying to find inverse of an np.matrix data type (It is also same for np.array). Calling np.linalg.inverse on matrix yields two close but different results. What causes this and which one is preferable to other? Since matrix data type uses…
yokus
  • 145
  • 2
  • 10
-1
votes
1 answer

Linear Algebra : remove row/line and project with a reduced Jacobian is equivalent to project firstly with a full Jacobian and remove after row/line?

I reformulate a first question that has been badly explained. I can't delete this question since I risk the blocking of my account, so don't blame me or be too rude on this point. I try to check under which conditions on the Jacobian used to get the…
user1773603
-1
votes
1 answer

Python: creating inverse matrix without numpy

i'm using pyomo and need a function that gives me the inverse matrix of a squared matrix without using numpy. I already found a function online but can't find the issue that results in the following error message: operands could not be broadcast…
Paul Rogge
  • 17
  • 5
-1
votes
1 answer

Matrix/array operations inside a python function

I am trying to use the content of a python function to make a contour plot. For example I try: import numpy as np import matplotlib.mlab as mlab import matplotlib.pyplot as plt # Building my equation from a series of matrix operation def func_M(X,…
Mac
  • 991
  • 3
  • 11
  • 22
-1
votes
1 answer

Wrong computation of inverse Eigen::MatrixXd

I have wrong result of inverse matrix, using Eigen library. Here's my part of code: Hessian_matrix = matrix.transpose() * matrix; std::cout << "Hessian matrix:" << Hessian_matrix << std::endl; std::cout << "inverse Hessian matrix" << std::endl <<…
-1
votes
1 answer

How to matrix inversion For 1 Dimension with c code?

hello i used gauss jordan for 1d but i didnt i want to find 1d matrix inverse. I found determinant but i dont know inverse of this matrix Hello my dear friends Our matrixes: double A[] = {6, 6 ,2, 4, 9 ,7, 4, 3 ,3}; double B[] = {6, 6 ,2, 4, 9…
user13418390
-1
votes
1 answer

Working on a matrix inverter and my exponential loop is not working for some reason

I am working on a matrix inverter and I have it almost done but for some reason the function that is supposed to raise the matrix to a certain value is not working, I have isolated the function on its own and it has worked just fine. But for some…