473,434 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

calculate the inverse of a matrix

22
how to you write program that calculate the inverse of a matrix
May 17 '07 #1
1 2913
JosAH
11,448 Expert 8TB
how to you write program that calculate the inverse of a matrix
Take it from me: nobody wants to calculate an explicit form of the invers of a
matrix for two reasons:

1) numerical instability
2) performance.

Instead use a 'LUP' decomposition of a matrix A (google for it). A sketch of
the procedure runs like this:

PA = LU where P is a row permutation matrix (and identity matrix with its rows
permuted) and L and U are lower and upper triangular matrices with the additional
property that the diagonal of L are all 1s (one). Matrix P can be stored very efficiently.

Finding L and U is easy: it's just a partial Gaussian ellimination procedure,
the same thing you had to use for an explicit form of the inverse of a matrix.
Matrix P is found on the fly when you select a suitable pivot for a row.

Solving a linear system Ax= b is equivalent to PAx= Pb (permute the rows of b)
== LU= Pb which is nothing but a so called 'forward' and 'backward' substitution
thanks to the triangularity of matrices L and U.

Google for 'LUP decomposition' for the details.

kind regards,

Jos
May 17 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: vishnu mahendra | last post by:
hello to all, can any one please give me an algorithm to find inverse of a matrix of order n rows and m columns. thank you in advance, vishnu.
1
by: praneeth | last post by:
hi i want a c program to find the inverse of 3X3 matrix urgent i need it fast anyoone reply thanks
1
by: ravleen bindra | last post by:
please tell me how to find inverse of a nxm matrix in C programming language
7
by: ajeetbaraskar | last post by:
can any one send me the codining for finding out inverse of a 6x6 matrix
0
by: YUSUF ISIAKA | last post by:
Him please help me with the codes for the following questions: 1. Write a program in c/c++ to compute the inverse of a square matrix. 2. Write a program in c/c++ to compute the determinant of a...
2
by: leelaramtenneti | last post by:
How to find inverse of a complex matrix ????
3
by: aaram81 | last post by:
I need a help in C++ for the following question: write a p[rogram to read 4 by 4 matrix, store it and find the inverse of this matrix. then multiply the inverse with the original matrix , store it ....
2
by: hemasundar | last post by:
plz forward me a simple programme in c++ for finding out the inverse a matrix of m rows and n columns to follwing
1
by: dazzler | last post by:
Hi! I have problem with numpy, multiplying with an inversed matrix will crash python :( this works fine: from numpy import matrix A = matrix(,]) B = matrix(,]) print A.I #inverse matrix
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.