Mercurial > octave
annotate libinterp/corefcn/givens.cc @ 20555:f90c8372b7ba
eliminate many more simple uses of error_state
* Cell.cc, __ichol__.cc, __ilu__.cc, balance.cc, bsxfun.cc, colloc.cc,
det.cc, dlmread.cc, dynamic-ld.cc, eig.cc, fft.cc, fft2.cc, fftn.cc,
gcd.cc, getgrent.cc, getpwent.cc, givens.cc, hess.cc, input.cc,
levenshtein.cc, load-path.cc, lookup.cc, ls-mat-ascii.cc, ls-mat4.cc,
lsode.cc, lu.cc, max.cc, md5sum.cc, mex.cc, pager.cc, pinv.cc,
pr-output.cc, qz.cc, schur.cc, sparse.cc, sqrtm.cc, str2double.cc,
strfns.cc, sub2ind.cc, sysdep.cc, time.cc, toplev.cc, tril.cc,
tsearch.cc, typecast.cc, __init_gnuplot__.cc, __magick_read__.cc,
__osmesa_print__.cc, amd.cc, audiodevinfo.cc, dmperm.cc, fftw.cc,
symrcm.cc, ov-base-diag.cc, ov-base-sparse.cc, ov-base.cc,
ov-bool-sparse.cc, ov-builtin.cc, ov-complex.cc, ov-cx-diag.cc,
ov-cx-mat.cc, ov-cx-sparse.cc, ov-fcn-handle.cc, ov-fcn-inline.cc,
ov-float.cc, ov-flt-complex.cc, ov-flt-cx-diag.cc, ov-flt-cx-mat.cc,
ov-flt-re-diag.cc, ov-flt-re-mat.cc, ov-lazy-idx.cc, ov-mex-fcn.cc,
ov-perm.cc, ov-range.cc, ov-re-diag.cc, ov-re-mat.cc, ov-re-sparse.cc,
ov-scalar.cc, ov-str-mat.cc, op-bm-b.cc, op-bm-bm.cc, op-sbm-b.cc,
op-sbm-bm.cc, op-str-m.cc, op-str-s.cc, oct-parse.in.yy, pt-cbinop.cc,
pt-colon.cc, pt-decl.cc, pt-exp.cc, pt-id.cc, pt-misc.cc,
pt-select.cc, pt-unop.cc: Eliminate simple uses of error_state.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 05 Oct 2015 19:29:36 -0400 |
parents | 4197fc428c7d |
children | 8bb38ba1bad6 |
rev | line source |
---|---|
2928 | 1 /* |
2 | |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19169
diff
changeset
|
3 Copyright (C) 1996-2015 John W. Eaton |
2928 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
2928 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
2928 | 20 |
21 */ | |
22 | |
23 // Originally written by A. S. Hodel <scotte@eng.auburn.edu> | |
24 | |
25 #ifdef HAVE_CONFIG_H | |
26 #include <config.h> | |
27 #endif | |
28 | |
15039
e753177cde93
maint: Move non-dynamically linked functions from DLD-FUNCTIONS/ to corefcn/ directory
Rik <rik@octave.org>
parents:
14501
diff
changeset
|
29 #include "defun.h" |
2928 | 30 #include "error.h" |
31 #include "oct-obj.h" | |
32 | |
15039
e753177cde93
maint: Move non-dynamically linked functions from DLD-FUNCTIONS/ to corefcn/ directory
Rik <rik@octave.org>
parents:
14501
diff
changeset
|
33 DEFUN (givens, args, nargout, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
34 "-*- texinfo -*-\n\ |
19169
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
35 @deftypefn {Built-in Function} {@var{G} =} givens (@var{x}, @var{y})\n\ |
15039
e753177cde93
maint: Move non-dynamically linked functions from DLD-FUNCTIONS/ to corefcn/ directory
Rik <rik@octave.org>
parents:
14501
diff
changeset
|
36 @deftypefnx {Built-in Function} {[@var{c}, @var{s}] =} givens (@var{x}, @var{y})\n\ |
19169
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
37 Compute the Givens rotation matrix @var{G}.\n\ |
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
38 \n\ |
3372 | 39 @tex\n\ |
19169
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
40 The Givens matrix is a $2\\times 2$ orthogonal matrix\n\ |
3372 | 41 $$\n\ |
42 G = \\left[\\matrix{c & s\\cr -s'& c\\cr}\\right]\n\ | |
43 $$\n\ | |
44 such that\n\ | |
45 $$\n\ | |
46 G \\left[\\matrix{x\\cr y}\\right] = \\left[\\matrix{\\ast\\cr 0}\\right]\n\ | |
47 $$\n\ | |
48 with $x$ and $y$ scalars.\n\ | |
49 @end tex\n\ | |
8517
81d6ab3ac93c
Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents:
7789
diff
changeset
|
50 @ifnottex\n\ |
19169
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
51 The Givens matrix is a 2 by 2 orthogonal matrix\n\ |
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
52 \n\ |
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
53 @code{@var{g} = [@var{c} @var{s}; -@var{s}' @var{c}]}\n\ |
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
54 \n\ |
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
55 such that\n\ |
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
56 \n\ |
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
57 @code{@var{g} [@var{x}; @var{y}] = [*; 0]}\n\ |
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
58 \n\ |
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
59 with @var{x} and @var{y} scalars.\n\ |
8517
81d6ab3ac93c
Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents:
7789
diff
changeset
|
60 @end ifnottex\n\ |
2928 | 61 \n\ |
19169
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
62 If two output arguments are requested, return the factors @var{c} and\n\ |
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
63 @var{s} rather than the Givens rotation matrix.\n\ |
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
64 \n\ |
10840 | 65 For example:\n\ |
2928 | 66 \n\ |
3372 | 67 @example\n\ |
68 @group\n\ | |
69 givens (1, 1)\n\ | |
14360
97883071e8e4
doc: Correct off-by-1 spacings in all .cc docstrings
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
70 @result{} 0.70711 0.70711\n\ |
97883071e8e4
doc: Correct off-by-1 spacings in all .cc docstrings
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
71 -0.70711 0.70711\n\ |
3372 | 72 @end group\n\ |
73 @end example\n\ | |
19169
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
74 @seealso{planerot}\n\ |
3372 | 75 @end deftypefn") |
2928 | 76 { |
77 octave_value_list retval; | |
78 | |
79 int nargin = args.length (); | |
80 | |
81 if (nargin != 2 || nargout > 2) | |
82 { | |
5823 | 83 print_usage (); |
2928 | 84 return retval; |
85 } | |
86 else | |
87 { | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
88 if (args(0).is_single_type () || args(1).is_single_type ()) |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
89 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
90 if (args(0).is_complex_type () || args(1).is_complex_type ()) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
91 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
92 FloatComplex cx = args(0).float_complex_value (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
93 FloatComplex cy = args(1).float_complex_value (); |
2928 | 94 |
20555
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
95 FloatComplexMatrix result = Givens (cx, cy); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
96 |
20555
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
97 switch (nargout) |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
98 { |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
99 case 0: |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
100 case 1: |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
101 retval(0) = result; |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
102 break; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
103 |
20555
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
104 case 2: |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
105 retval(1) = result (0, 1); |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
106 retval(0) = result (0, 0); |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
107 break; |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
108 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
109 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
110 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
111 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
112 float x = args(0).float_value (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
113 float y = args(1).float_value (); |
2928 | 114 |
20555
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
115 FloatMatrix result = Givens (x, y); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
116 |
20555
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
117 switch (nargout) |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
118 { |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
119 case 0: |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
120 case 1: |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
121 retval(0) = result; |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
122 break; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
123 |
20555
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
124 case 2: |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
125 retval(1) = result (0, 1); |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
126 retval(0) = result (0, 0); |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
127 break; |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
128 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
129 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
130 } |
2928 | 131 else |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
132 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
133 if (args(0).is_complex_type () || args(1).is_complex_type ()) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
134 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
135 Complex cx = args(0).complex_value (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
136 Complex cy = args(1).complex_value (); |
2928 | 137 |
20555
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
138 ComplexMatrix result = Givens (cx, cy); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
139 |
20555
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
140 switch (nargout) |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
141 { |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
142 case 0: |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
143 case 1: |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
144 retval(0) = result; |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
145 break; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
146 |
20555
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
147 case 2: |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
148 retval(1) = result (0, 1); |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
149 retval(0) = result (0, 0); |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
150 break; |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
151 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
152 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
153 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
154 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
155 double x = args(0).double_value (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
156 double y = args(1).double_value (); |
2928 | 157 |
20555
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
158 Matrix result = Givens (x, y); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
159 |
20555
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
160 switch (nargout) |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
161 { |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
162 case 0: |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
163 case 1: |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
164 retval(0) = result; |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
165 break; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
166 |
20555
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
167 case 2: |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
168 retval(1) = result (0, 1); |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
169 retval(0) = result (0, 0); |
f90c8372b7ba
eliminate many more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
170 break; |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
171 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
172 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
173 } |
2928 | 174 } |
175 | |
176 return retval; | |
177 } | |
12840
ecafefd638c9
codesprint: Wrote 5 tests for givens.cc
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
11586
diff
changeset
|
178 |
ecafefd638c9
codesprint: Wrote 5 tests for givens.cc
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
11586
diff
changeset
|
179 /* |
14501
60e5cf354d80
Update %!tests in DLD-FUNCTIONS/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14360
diff
changeset
|
180 %!assert (givens (1,1), [1, 1; -1, 1] / sqrt (2), 2*eps) |
60e5cf354d80
Update %!tests in DLD-FUNCTIONS/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14360
diff
changeset
|
181 %!assert (givens (1,0), eye (2)) |
60e5cf354d80
Update %!tests in DLD-FUNCTIONS/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14360
diff
changeset
|
182 %!assert (givens (0,1), [0, 1; -1 0]) |
12840
ecafefd638c9
codesprint: Wrote 5 tests for givens.cc
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
11586
diff
changeset
|
183 |
14501
60e5cf354d80
Update %!tests in DLD-FUNCTIONS/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14360
diff
changeset
|
184 %!error givens () |
60e5cf354d80
Update %!tests in DLD-FUNCTIONS/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14360
diff
changeset
|
185 %!error givens (1) |
19169
1faae07afbd8
Overhaul givens and planerot functions.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
186 %!error [a,b,c] = givens (1, 1) |
12840
ecafefd638c9
codesprint: Wrote 5 tests for givens.cc
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
11586
diff
changeset
|
187 */ |