comparison scripts/linear-algebra/housh.m @ 3439:3234a698073a

[project @ 2000-01-14 09:51:14 by jwe]
author jwe
date Fri, 14 Jan 2000 09:52:35 +0000
parents e098ebb77023
children 22bd65326ec1
comparison
equal deleted inserted replaced
3438:2e06c3941943 3439:3234a698073a
14 ## 14 ##
15 ## You should have received a copy of the GNU General Public License 15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, write to the Free 16 ## along with Octave; see the file COPYING. If not, write to the Free
17 ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. 17 ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
18 18
19 ## function [housv,beta,zer] = housh(x,j,z) 19 ## -*- texinfo -*-
20 ## computes householder reflection vector housv to reflect x to be 20 ## @deftypefn {Function File} {[@var{housv}, @var{beta}, @var{zer}] =} housh (@var{x}, @var{j}, @var{z})
21 ## Computes householder reflection vector housv to reflect x to be
21 ## jth column of identity, i.e., (I - beta*housv*housv')x =e(j) 22 ## jth column of identity, i.e., (I - beta*housv*housv')x =e(j)
22 ## inputs 23 ## inputs
23 ## x: vector 24 ## x: vector
24 ## j: index into vector 25 ## j: index into vector
25 ## z: threshold for zero (usually should be the number 0) 26 ## z: threshold for zero (usually should be the number 0)
26 ## outputs: (see Golub and Van Loan) 27 ## outputs: (see Golub and Van Loan)
27 ## beta: If beta = 0, then no reflection need be applied (zer set to 0) 28 ## beta: If beta = 0, then no reflection need be applied (zer set to 0)
28 ## housv: householder vector 29 ## housv: householder vector
29 ## mar 6,1987 : rev dec 17,1988 30 ## @end deftypefn
30 ## rev sep 19,1991 (blas)
31 ## translated from FORTRAN Aug 1995
32 31
33 ## Author: A. S. Hodel 32 ## Author: A. S. Hodel
33 ## Created: August 1995
34 34
35 function [housv, beta, zer] = housh (x, j, z) 35 function [housv, beta, zer] = housh (x, j, z)
36 36
37 ## check for valid inputs 37 ## check for valid inputs
38 if (!is_vector (x) && ! is_scalar (x)) 38 if (!is_vector (x) && ! is_scalar (x))