<?xml version="1.0" encoding="UTF-8"?>
<refentry version="5.0-subset Scilab" xml:id="gf_linsolve" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:xi="http://www.w3.org/2001/XInclude"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:html="http://www.w3.org/1999/xhtml"
          xmlns:db="http://docbook.org/ns/docbook">
  <refnamediv>
    <refname>gf_linsolve</refname>
    <refpurpose>  Various linear system solvers.
</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <title>Calling Sequence</title>

    <synopsis>X = gf_linsolve('gmres', spmat M, vec b[, int restart][, precond P][,'noisy'][,'res', r][,'maxiter', n])</synopsis>
    <synopsis>X = gf_linsolve('cg', spmat M, vec b [, precond P][,'noisy'][,'res', r][,'maxiter', n])</synopsis>
    <synopsis>X = gf_linsolve('bicgstab', spmat M, vec b [, precond P][,'noisy'][,'res', r][,'maxiter', n])</synopsis>
    <synopsis>{U, cond} = gf_linsolve('lu', spmat M, vec b)</synopsis>
    <synopsis>{U, cond} = gf_linsolve('superlu', spmat M, vec b)</synopsis>
  </refsynopsisdiv>

  <refsection>
    <title>Description</title>
    <para>  Various linear system solvers.
</para>
  </refsection>

  <refsection>
    <title>Command list</title>

    <itemizedlist>
    <listitem>
    <para><literal>X = gf_linsolve('gmres', spmat M, vec b[, int restart][, precond P][,'noisy'][,'res', r][,'maxiter', n])</literal></para>

    <para>       Solve <literal>M.X = b</literal> with the generalized minimum residuals method.

    Optionally using <literal>P</literal> as preconditioner. The default value of the
    restart parameter is 50.
    </para>
    </listitem>

    <listitem>
    <para><literal>X = gf_linsolve('cg', spmat M, vec b [, precond P][,'noisy'][,'res', r][,'maxiter', n])</literal></para>

    <para>       Solve <literal>M.X = b</literal> with the conjugated gradient method.

    Optionally using <literal>P</literal> as preconditioner.
    </para>
    </listitem>

    <listitem>
    <para><literal>X = gf_linsolve('bicgstab', spmat M, vec b [, precond P][,'noisy'][,'res', r][,'maxiter', n])</literal></para>

    <para>       Solve <literal>M.X = b</literal> with the bi-conjugated gradient stabilized method.

    Optionally using <literal>P</literal> as a preconditioner.
    </para>
    </listitem>

    <listitem>
    <para><literal>{U, cond} = gf_linsolve('lu', spmat M, vec b)</literal></para>

    <para>         Alias for gf_linsolve('superlu',...)
    </para>
    </listitem>

    <listitem>
    <para><literal>{U, cond} = gf_linsolve('superlu', spmat M, vec b)</literal></para>

    <para>       Solve <literal>M.U = b</literal> apply the SuperLU solver (sparse LU factorization).

    The condition number estimate <literal>cond</literal> is returned with the solution <literal>U</literal>.
    </para>
    </listitem>

    </itemizedlist>
  </refsection>

  <refsection>
    <title>See Also</title>
    <simplelist type="inline">
      <member><link linkend="getfem_types">getfem types</link></member>
    </simplelist>
  </refsection>

  <refsection>
    <title>Authors</title>
    <para>Y. Collette</para>
  </refsection>

</refentry>
