# Total Flop count for LAPACK DPOSV

I am looking at the LAPACK DPOSV routine that computes the solution to the real system of linear equations A * X = B. The routine description can be found here:

http://www.math.utah.edu/software/lapack/lapack-d/dposv.html

How many floating point operations (flops) would a call to this routine take? What is the algorithmic complexity of this subroutine call?

• For general matrices (i.e., no special structure), if $A$ is $n \times n$ and $B$ is $n \times m$, then you're looking at ${\cal O}(n^3) + {\cal O}(n^2 \times m)$. If you want more accurate flop counts, sum up the cost of the individual steps of the algorithms (factorization of $A$ + triangular solves). – GoHokies Nov 24 '15 at 8:37

As you can see by following the function calls in the code, it computes the Cholesky factorization of $A$ with dpotrf, followed by dpotrs, which solves $AX=B$ by solving two triangular systems (dtrsm).