Mercurial > octave
comparison src/hess.cc @ 2086:bfb775fb6fe8
[project @ 1996-04-25 05:55:19 by jwe]
author | jwe |
---|---|
date | Thu, 25 Apr 1996 05:55:19 +0000 |
parents | 003570e69c7b |
children | 6abec42e52f6 |
comparison
equal
deleted
inserted
replaced
2085:7603b37325db | 2086:bfb775fb6fe8 |
---|---|
36 #include "utils.h" | 36 #include "utils.h" |
37 | 37 |
38 DEFUN_DLD_BUILTIN (hess, args, nargout, | 38 DEFUN_DLD_BUILTIN (hess, args, nargout, |
39 "[P, H] = hess (A) or H = hess (A): Hessenberg decomposition") | 39 "[P, H] = hess (A) or H = hess (A): Hessenberg decomposition") |
40 { | 40 { |
41 Octave_object retval; | 41 octave_value_list retval; |
42 | 42 |
43 int nargin = args.length (); | 43 int nargin = args.length (); |
44 | 44 |
45 if (nargin != 1 || nargout > 2) | 45 if (nargin != 1 || nargout > 2) |
46 { | 46 { |
47 print_usage ("hess"); | 47 print_usage ("hess"); |
48 return retval; | 48 return retval; |
49 } | 49 } |
50 | 50 |
51 tree_constant arg = args(0); | 51 octave_value arg = args(0); |
52 | 52 |
53 int nr = arg.rows (); | 53 int nr = arg.rows (); |
54 int nc = arg.columns (); | 54 int nc = arg.columns (); |
55 | 55 |
56 int arg_is_empty = empty_arg ("hess", nr, nc); | 56 int arg_is_empty = empty_arg ("hess", nr, nc); |
57 | 57 |
58 if (arg_is_empty < 0) | 58 if (arg_is_empty < 0) |
59 return retval; | 59 return retval; |
60 else if (arg_is_empty > 0) | 60 else if (arg_is_empty > 0) |
61 return Octave_object (2, Matrix ()); | 61 return octave_value_list (2, Matrix ()); |
62 | 62 |
63 if (nr != nc) | 63 if (nr != nc) |
64 { | 64 { |
65 gripe_square_matrix_required ("hess"); | 65 gripe_square_matrix_required ("hess"); |
66 return retval; | 66 return retval; |