1 ## Copyright (C) 2011 David Bateman
3 ## This program is free software; you can redistribute it and/or modify it under
4 ## the terms of the GNU General Public License as published by the Free Software
5 ## Foundation; either version 3 of the License, or (at your option) any later
8 ## This program is distributed in the hope that it will be useful, but WITHOUT
9 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 ## You should have received a copy of the GNU General Public License along with
14 ## this program; if not, see <http://www.gnu.org/licenses/>.
17 ## @deftypefn {Loadable Function} {[@var{l}, @var{u}, @var{p}] =} lu (@var{a})
18 ## @cindex LU decomposition of Galois matrix
19 ## Compute the LU decomposition of @var{a} in a Galois Field. The result is
20 ## returned in a permuted form, according to the optional return value
21 ## @var{p}. For example, given the matrix
22 ## @code{a = gf([1, 2; 3, 4],3)},
33 ## GF(2^3) array. Primitive Polynomial = D^3+D+1 (decimal 11)
41 ## GF(2^3) array. Primitive Polynomial = D^3+D+1 (decimal 11)
54 ## Such that @code{@var{p} * @var{a} = @var{l} * @var{u}}. If the argument
55 ## @var{p} is not included then the permutations are applied to @var{l}
56 ## so that @code{@var{a} = @var{l} * @var{u}}. @var{l} is then a pseudo-
57 ## lower triangular matrix. The matrix @var{a} can be rectangular.
60 function varargout = lu (varargin)
61 varargout = cell (1, max(1, nargout));
62 [varargout{:}] = glu (varargin{:});