Mercurial > hg > octave-lyh
diff scripts/linear-algebra/condest.m @ 7191:b48a21816f2e
[project @ 2007-11-26 21:24:32 by jwe]
author | jwe |
---|---|
date | Mon, 26 Nov 2007 21:24:33 +0000 |
parents | e8d953d03f6a |
children | 7d7f05863f27 |
line wrap: on
line diff
--- a/scripts/linear-algebra/condest.m +++ b/scripts/linear-algebra/condest.m @@ -17,8 +17,8 @@ ## <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {[@var{est}, @var{v}] =} condest (@var{A}, @var{t}) -## @deftypefnx {Function File} {[@var{est}, @var{v}] =} condest (@var{A}, @var{solve}, @var{solve_t}, @var{t}) +## @deftypefn {Function File} {[@var{est}, @var{v}] =} condest (@var{a}, @var{t}) +## @deftypefnx {Function File} {[@var{est}, @var{v}] =} condest (@var{a}, @var{solve}, @var{solve_t}, @var{t}) ## @deftypefnx {Function File} {[@var{est}, @var{v}] =} condest (@var{apply}, @var{apply_t}, @var{solve}, @var{solve_t}, @var{n}, @var{t}) ## ## Estimate the 1-norm condition number of a matrix matrix @var{A} @@ -26,7 +26,7 @@ ## If @var{t} exceeds 5, then only 5 test vectors are used. ## ## If the matrix is not explicit, e.g. when estimating the condition -## number of @var{A} given an LU factorization, @code{condest} uses the +## number of @var{a} given an LU factorization, @code{condest} uses the ## following functions: ## ## @table @var @@ -46,9 +46,9 @@ ## the 1-norms. ## ## @code{condest} returns the 1-norm condition estimate @var{est} and -## a vector @var{v} satisfying @code{norm (@var{A}*@var{v}, 1) == norm -## (@var{A}, 1) * norm (@var{v}, 1) / @var{est}}. When @var{est} is -## large, @var{v} is an approximate null vector. +## a vector @var{v} satisfying @code{norm (A*v, 1) == norm (A, 1) * norm +## (@var{v}, 1) / @var{est}}. When @var{est} is large, @var{v} is an +## approximate null vector. ## ## References: ## @itemize @@ -62,46 +62,51 @@ ## @end itemize ## ## @seealso{norm, cond, onenormest} -## ## @end deftypefn ## Code originally licensed under ## ## Copyright (c) 2007, Regents of the University of California ## All rights reserved. +## ## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions are met: +## modification, are permitted provided that the following conditions +## are met: ## ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. -## * Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## * Neither the name of the University of California, Berkeley nor the -## names of its contributors may be used to endorse or promote products -## derived from this software without specific prior written permission. +## +## * Redistributions in binary form must reproduce the above +## copyright notice, this list of conditions and the following +## disclaimer in the documentation and/or other materials provided +## with the distribution. +## +## * Neither the name of the University of California, Berkeley nor +## the names of its contributors may be used to endorse or promote +## products derived from this software without specific prior +## written permission. ## -## THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY -## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -## WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -## DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR -## ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' +## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +## PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ## SUCH DAMAGE. -## -## Relicensed to GPL for inclusion in Octave. ## Author: Jason Riedy <ejr@cs.berkeley.edu> ## Keywords: linear-algebra norm estimation ## Version: 0.2 function [est, v] = condest (varargin) + if size (varargin, 2) < 1 || size (varargin, 2) > 5, - usage("condest: Incorrect arguments."); + print_usage (); endif default_t = 5;