.. _lapack_examples: ============================================================= LAPACK examples ============================================================= Some examples using the LAPACK routine `dgesv `_ for solving a linear system. See the :ref:`slides` from Lecture 11 for more information. See :ref:`lapack_install` for hints on installing. Here is the first example with static array allocation as in Fortran 77: .. literalinclude:: ../codes/lapack/random/randomsys1.f90 :language: fortran :linenos: Here is the code rewritten to use dynamic memory allocation: .. literalinclude:: ../codes/lapack/random/randomsys2.f90 :language: fortran :linenos: The next version also estimates the condition number of the matrix using the LAPACK routine `dgecon `_: .. literalinclude:: ../codes/lapack/random/randomsys3.f90 :language: fortran :linenos: