Can someone tell me how to calculate the order of a) $LU$ decomposition as well as b) Gaussian elimination of a square matrix $A$? I am at a loss ...
Given:: $A$ is a $n\times n$ matrix and ultimate aim is to find a solution set of $Ax=b$. I couldn't solve the first part but for the 2nd part, I think the number of basic operations will be (as per my calculations) $$\frac{n}{2}(n+3)(2n-1)$$
Am I right? It shall even be helpful if you could cite a link or reference to some text which contain the calculations of the order of the processes.
You are slightly off as the dominant term should be $\frac{2}{3}n^3$. Most text in numerical linear algebra only provide the dominant error term. I am aware of a single text, specifically:
Fraleigh and Beauregard: Linear Algebra 2nd Edition, Addison-Wesley, 1990.
which does the exact flop count. I imagine that the 3rd edition from 1995 is no different.
Counting flops is difficult to do correctly. Here are some tips.
Personally, I can never get the flop count right, unless I execute those steps.
To settle the matter decisively you can write an implementation and force the computer to count flops, comparing the actual count with your current conjecture. I shall demonstrate using MATLAB.
The following routine does an LU factorization without pivoting overwriting the matrix A with the LU factorization.
The following routines solves the lower unit triangular linear system $Ly=b$ where the strictly lower triangular part of $L$ is embedded in the strict lower triangular part of $A$.
The following routine solves the upper triangular linear system $Ux = y$ where $U$ is the upper triangular part of $A$.