7016
|
1 ## Copyright (C) 2007 John W. Eaton |
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by |
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
|
8 ## your option) any later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
|
16 ## along with Octave; see the file COPYING. If not, see |
|
17 ## <http://www.gnu.org/licenses/>. |
|
18 |
5590
|
19 %% Automatically generated from DejaGNU files |
|
20 |
|
21 %% test/octave.test/poly/compan-1.m |
|
22 %!assert(all (all (compan ([1, 2, 3]) == [-2, -3; 1, 0]))); |
|
23 |
|
24 %% test/octave.test/poly/compan-2.m |
|
25 %!assert(all (all (compan ([1; 2; 3]) == [-2, -3; 1, 0]))); |
|
26 |
|
27 %% test/octave.test/poly/compan-3.m |
|
28 %!assert(isempty (compan (4))); |
|
29 |
|
30 %% test/octave.test/poly/compan-4.m |
|
31 %!assert(all (all (compan ([3, 2, 1]) == [-2/3, -1/3; 1, 0]))); |
|
32 |
|
33 %% test/octave.test/poly/compan-5.m |
|
34 %!error compan ([1,2;3,4]); |
|
35 |
|
36 %% test/octave.test/poly/compan-6.m |
|
37 %!error compan ([]); |
|
38 |
|
39 %% test/octave.test/poly/conv-1.m |
|
40 %!assert(all (all (conv (ones (3, 1), ones (3, 1)) == [1, 2, 3, 2, 1]))); |
|
41 |
|
42 %% test/octave.test/poly/conv-2.m |
|
43 %!assert(all (all (conv (ones (1, 3), ones (3, 1)) == [1, 2, 3, 2, 1]))); |
|
44 |
|
45 %% test/octave.test/poly/conv-3.m |
|
46 %!assert(all (all (conv (3, [1, 2, 3]) == [3, 6, 9]))); |
|
47 |
|
48 %% test/octave.test/poly/conv-4.m |
|
49 %!error conv ([1, 2; 3, 4], 3); |
|
50 |
|
51 %% test/octave.test/poly/conv-5.m |
|
52 %!assert(conv (2, 3),6); |
|
53 |
|
54 %% test/octave.test/poly/conv-6.m |
|
55 %!error conv (2, []); |
|
56 |
|
57 %% test/octave.test/poly/deconv-1.m |
|
58 %!test |
|
59 %! [b, r] = deconv ([3, 6, 9, 9], [1, 2, 3]); |
|
60 %! assert(all (all (b == [3, 0])) && all (all (r == [0, 0, 0, 9]))); |
|
61 |
|
62 %% test/octave.test/poly/deconv-2.m |
|
63 %!test |
|
64 %! [b, r] = deconv ([3, 6], [1, 2, 3]); |
|
65 %! assert(b == 0 && all (all (r == [0, 3, 6]))); |
|
66 |
|
67 %% test/octave.test/poly/deconv-3.m |
|
68 %!test |
|
69 %! [b, r] = deconv ([3, 6], [1; 2; 3]); |
|
70 %! assert(b == 0 && all (all (r == [0, 3, 6]))); |
|
71 |
|
72 %% test/octave.test/poly/deconv-4.m |
|
73 %!error [b, r] = deconv ([3, 6], [1, 2; 3, 4]);; |
|
74 |
|
75 %% test/octave.test/poly/deconv-5.m |
|
76 %!error <number of rows must match> [b, r] = deconv ([3; 6], [1, 2, 3]); |
|
77 |
|
78 %% test/octave.test/poly/poly-1.m |
|
79 %!assert(all (all (poly ([1, 2, 3]) == [1, -6, 11, -6]))); |
|
80 |
|
81 %% test/octave.test/poly/poly-2.m |
|
82 %!assert(all (all (abs (poly ([1, 2; 3, 4]) - [1, -5, -2]) < sqrt (eps)))); |
|
83 |
|
84 %% test/octave.test/poly/poly-3.m |
|
85 %!error poly ([1, 2, 3; 4, 5, 6]); |
|
86 |
|
87 %% test/octave.test/poly/poly-4.m |
|
88 %!assert(poly ([]),1); |
|
89 |
|
90 %% test/octave.test/poly/polyderiv-1.m |
|
91 %!assert(all (all (polyderiv ([1, 2, 3]) == [2, 2]))); |
|
92 |
|
93 %% test/octave.test/poly/polyderiv-2.m |
|
94 %!assert(polyderiv (13) == 0); |
|
95 |
|
96 %% test/octave.test/poly/polyderiv-3.m |
|
97 %!error polyderiv ([]); |
|
98 |
|
99 %% test/octave.test/poly/polyderiv-4.m |
|
100 %!error polyderiv ([1, 2; 3, 4]); |
|
101 |
|
102 %% test/octave.test/poly/polyfit-1.m |
|
103 %!test |
|
104 %! x = [-2, -1, 0, 1, 2]; |
|
105 %! assert(all (all (abs (polyfit (x, x.^2+x+1, 2) - [1, 1, 1]) < sqrt (eps)))); |
|
106 |
|
107 %% test/octave.test/poly/polyfit-2.m |
|
108 %!test |
|
109 %! x = [-2, -1, 0, 1, 2]; |
|
110 %! assert(all (all (abs (polyfit (x, x.^2+x+1, 3) - [0, 1, 1, 1]) < sqrt (eps)))); |
|
111 |
|
112 %% test/octave.test/poly/polyfit-3.m |
|
113 %!error polyfit ([1, 2; 3, 4], [1, 2; 3, 4], 4); |
|
114 |
|
115 %% test/octave.test/poly/polyfit-4.m |
|
116 %!test |
|
117 %! x = [-2, -1, 0, 1, 2]; |
|
118 %! fail("polyfit (x, x.^2+x+1)"); |
|
119 |
|
120 %% test/octave.test/poly/polyfit-5.m |
|
121 %!test |
|
122 %! x = [-2, -1, 0, 1, 2]; |
|
123 %! fail("polyfit (x, x.^2+x+1, [])"); |
|
124 |
|
125 %% test/octave.test/poly/polyinteg-1.m |
|
126 %!assert(all (all (polyinteg ([2, 2]) == [1, 2, 0]))); |
|
127 |
|
128 %% test/octave.test/poly/polyinteg-2.m |
|
129 %!assert(isempty (polyinteg ([]))); |
|
130 |
|
131 %% test/octave.test/poly/polyinteg-3.m |
|
132 %!assert(all (all (polyinteg (3) == [3, 0]))); |
|
133 |
|
134 %% test/octave.test/poly/polyinteg-4.m |
|
135 %!error polyinteg ([1, 2; 3, 4]); |
|
136 |
|
137 %% test/octave.test/poly/polyreduce-1.m |
|
138 %!assert(all (all (polyreduce ([0, 0, 1, 2, 3]) == [1, 2, 3]))); |
|
139 |
|
140 %% test/octave.test/poly/polyreduce-2.m |
|
141 %!assert(all (all (polyreduce ([1, 2, 3, 0, 0]) == [1, 2, 3, 0, 0]))); |
|
142 |
|
143 %% test/octave.test/poly/polyreduce-3.m |
|
144 %!assert(all (all (polyreduce ([1, 0, 3]) == [1, 0, 3]))); |
|
145 |
|
146 %% test/octave.test/poly/polyreduce-4.m |
|
147 %!assert(isempty (polyreduce ([]))); |
|
148 |
|
149 %% test/octave.test/poly/polyreduce-5.m |
|
150 %!error polyreduce ([1, 2; 3, 4]); |
|
151 |
|
152 %% test/octave.test/poly/polyval-1.m |
|
153 %!assert(polyval ([1, 1, 1], 2) == 7); |
|
154 |
|
155 %% test/octave.test/poly/polyval-2.m |
|
156 %!assert(all (all (polyval ([1, 1, 1], [0; 1; 2]) == [1; 3; 7]))); |
|
157 |
|
158 %% test/octave.test/poly/polyval-3.m |
|
159 %!assert(isempty (polyval ([1, 1, 1], []))); |
|
160 |
|
161 %% test/octave.test/poly/polyval-4.m |
|
162 %!assert(all (all (polyval ([1, 1, 1], [-1, 0; 1, 2]) == [1, 1; 3, 7]))); |
|
163 |
|
164 %% test/octave.test/poly/polyval-5.m |
|
165 %!error polyval ([1, 2; 3, 4], [-1, 0; 1, 2]); |
|
166 |
|
167 %% test/octave.test/poly/polyval-6.m |
|
168 %!assert(isempty (polyval ([], [-1, 0; 1, 2]))); |
|
169 |
|
170 %% test/octave.test/poly/polyvalm-1.m |
|
171 %!assert(isempty (polyvalm ([], [1, 2; 3, 4]))); |
|
172 |
|
173 %% test/octave.test/poly/polyvalm-2.m |
|
174 %!error polyvalm ([1, 1, 1], [1, 2; 3, 4; 5, 6]); |
|
175 |
|
176 %% test/octave.test/poly/roots-1.m |
|
177 %!assert(all (all (abs (roots ([1, -6, 11, -6]) - [3; 2; 1]) < sqrt (eps)))); |
|
178 |
|
179 %% test/octave.test/poly/roots-2.m |
|
180 %!assert(isempty (roots ([]))); |
|
181 |
|
182 %% test/octave.test/poly/roots-3.m |
|
183 %!error roots ([1, 2; 3, 4]); |
|
184 |