Navigation

Operators and Keywords

Function List:

C++ API

lu.cc File Reference

#include "CmplxLU.h"
#include "dbleLU.h"
#include "fCmplxLU.h"
#include "floatLU.h"
#include "SparseCmplxLU.h"
#include "SparsedbleLU.h"
#include "defun-dld.h"
#include "error.h"
#include "gripes.h"
#include "oct-obj.h"
#include "utils.h"
#include "ov-re-sparse.h"
#include "ov-cx-sparse.h"

Include dependency graph for lu.cc:


Functions

 DEFUN_DLD (lu, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{l}, @var{u}, @var{p}] =} lu (@var{a})\n\ @deftypefnx {Loadable Function} {[@var{l}, @var{u}, @var{p}, @var{q}] =} lu (@var{s})\n\ @deftypefnx {Loadable Function} {[@var{l}, @var{u}, @var{p}, @var{q}, @var{r}] =} lu (@var{s})\n\ @deftypefnx {Loadable Function} {[@dots{}] =} lu (@var{s}, @var{thres})\n\ @deftypefnx {Loadable Function} {@var{y} =} lu (@dots{})\n\ @deftypefnx {Loadable Function} {[@dots{}] =} lu (@dots{}, 'vector')\n\ @cindex LU decomposition\n\ Compute the LU decomposition of @var{a}. If @var{a} is full subroutines from\n\ @sc{lapack} are used and if @var{a} is sparse then UMFPACK is used. The\n\ result is returned in a permuted form, according to the optional return\n\ value @var{p}. For example, given the matrix @code{a = [1, 2; 3, 4]},\n\ \n\ @example\n\ [l, u, p] = lu (a)\n\ @end example\n\ \n\ @noindent\n\ returns\n\ \n\ @example\n\ @group\n\ l =\n\ \n\ 1.00000 0.00000\n\ 0.33333 1.00000\n\ \n\ u =\n\ \n\ 3.00000 4.00000\n\ 0.00000 0.66667\n\ \n\ p =\n\ \n\ 0 1\n\ 1 0\n\ @end group\n\ @end example\n\ \n\ The matrix is not required to be square.\n\ \n\ Called with two or three output arguments and a spare input matrix,\n\ then @dfn{lu} does not attempt to perform sparsity preserving column\n\ permutations. Called with a fourth output argument, the sparsity\n\ preserving column transformation @var{Q} is returned, such that\n\ @code{@var{p} * @var{a} * @var{q} = @var{l} * @var{u}}.\n\ \n\ Called with a fifth output argument and a sparse input matrix, then\n\ @dfn{lu} attempts to use a scaling factor @var{r} on the input matrix\n\ such that @code{@var{p} * (@var{r} \\ @var{a}) * @var{q} = @var{l} * @var{u}}.\n\ This typically leads to a sparser and more stable factorization.\n\ \n\ An additional input argument @var{thres}, that defines the pivoting\n\ threshold can be given. @var{thres} can be a scalar, in which case\n\ it defines UMFPACK pivoting tolerance for both symmetric and unsymmetric\n\ cases. If @var{thres} is a two element vector, then the first element\n\ defines the pivoting tolerance for the unsymmetric UMFPACK pivoting\n\ strategy and the second the symmetric strategy. By default, the values\n\ defined by @code{spparms} are used and are by default @code{[0.1, 0.001]}.\n\ \n\ Given the string argument 'vector', @dfn{lu} returns the values of @var{p}\n\ @var{q} as vector values, such that for full matrix, @code{@var{a}\n\ (@var{p},:) = @var{l} * @var{u}}, and @code{@var{r}(@var{p},:) * @var{a}\n\ (:, @var{q}) = @var{l} * @var{u}}.\n\ \n\ With two output arguments, returns the permuted forms of the upper and\n\ lower triangular matrices, such that @code{@var{a} = @var{l} * @var{u}}.\n\ With one output argument @var{y}, then the matrix returned by the @sc{lapack}\n\ routines is returned. If the input matrix is sparse then the matrix @var{l}\n\ is embedded into @var{u} to give a return value similar to the full case.\n\ For both full and sparse matrices, @dfn{lu} looses the permutation\n\ information.\n\ @end deftypefn")
 DEFUN_DLD (luupdate, args,,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{L}, @var{U}] =} luupdate (@var{l}, @var{u}, @var{x}, @var{y})\n\ @deftypefnx {Loadable Function} {[@var{L}, @var{U}, @var{P}] =} luupdate (@var{L}, @var{U}, @var{P}, @var{x}, @var{y})\n\ Given an LU@tie{}factorization of a real or complex matrix\n\ @w{@var{A} = @var{L}*@var{U}}, @var{L}@tie{}lower unit trapezoidal and\n\ @var{U}@tie{}upper trapezoidal, return the LU@tie{}factorization\n\ of @w{@var{A} + @var{x}*@var{y}.'}, where @var{x} and @var{y} are\n\ column vectors (rank-1 update) or matrices with equal number of columns\n\ (rank-k update).\n\ Optionally, row-pivoted updating can be used by supplying\n\ a row permutation (pivoting) matrix @var{P};\n\ in that case, an updated permutation matrix is returned.\n\ Note that if @var{L}, @var{U}, @var{P} is a pivoted LU@tie{}factorization\n\ as obtained by @code{lu}:\n\ \n\ @example\n\ [@var{L}, @var{U}, @var{P}] = lu (@var{A});\n\ @end example\n\ \n\ then a factorization of @code{@var{a}+@var{x}*@var{y}.'} can be obtained either as\n\ \n\ @example\n\ [@var{L1}, @var{U1}] = lu (@var{L}, @var{U}, @var{P}*@var{x}, @var{y})\n\ @end example\n\ \n\ or\n\ \n\ @example\n\ [@var{L1}, @var{U1}, @var{P1}] = lu (@var{L}, @var{U}, @var{P}, @var{x}, @var{y})\n\ @end example\n\ \n\ The first form uses the unpivoted algorithm, which is faster, but less stable.\n\ The second form uses a slower pivoted algorithm, which is more stable.\n\ \n\ Note that the matrix case is done as a sequence of rank-1 updates;\n\ thus, for k large enough, it will be both faster and more accurate to recompute\n\ the factorization from scratch.\n\ @seealso{lu,qrupdate,cholupdate}\n\ @end deftypefn")

Function Documentation

DEFUN_DLD ( luupdate  ,
args   
)

DEFUN_DLD ( lu  ,
args  ,
nargout   
)