Mercurial > octave-nkf
annotate src/DLD-FUNCTIONS/filter.cc @ 10840:89f4d7e294cc
Grammarcheck .cc files
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 31 Jul 2010 11:18:11 -0700 |
parents | 12884915a8e4 |
children | a4f482e66b65 |
rev | line source |
---|---|
2928 | 1 /* |
2 | |
8920 | 3 Copyright (C) 1996, 1997, 1999, 2000, 2002, 2004, 2005, 2006, 2007, |
4 2008, 2009 John W. Eaton | |
2928 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
2928 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
2928 | 21 |
22 */ | |
23 | |
24 // Based on Tony Richardson's filter.m. | |
25 // | |
5428 | 26 // Originally translated to C++ by KH (Kurt.Hornik@wu-wien.ac.at) |
2928 | 27 // with help from Fritz Leisch and Andreas Weingessel on Oct 20, 1994. |
28 // | |
29 // Rewritten to use templates to handle both real and complex cases by | |
30 // jwe, Wed Nov 1 19:15:29 1995. | |
31 | |
32 #ifdef HAVE_CONFIG_H | |
33 #include <config.h> | |
34 #endif | |
35 | |
4153 | 36 #include "quit.h" |
37 | |
2928 | 38 #include "defun-dld.h" |
39 #include "error.h" | |
40 #include "oct-obj.h" | |
41 | |
3109 | 42 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL) |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
43 extern MArray<double> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
44 filter (MArray<double>&, MArray<double>&, MArray<double>&, int dim); |
2928 | 45 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
46 extern MArray<Complex> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
47 filter (MArray<Complex>&, MArray<Complex>&, MArray<Complex>&, int dim); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
48 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
49 extern MArray<float> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
50 filter (MArray<float>&, MArray<float>&, MArray<float>&, int dim); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
51 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
52 extern MArray<FloatComplex> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
53 filter (MArray<FloatComplex>&, MArray<FloatComplex>&, MArray<FloatComplex>&, int dim); |
3107 | 54 #endif |
2928 | 55 |
56 template <class T> | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
57 MArray<T> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
58 filter (MArray<T>& b, MArray<T>& a, MArray<T>& x, MArray<T>& si, |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
59 int dim = 0) |
2928 | 60 { |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
61 MArray<T> y; |
2928 | 62 |
5275 | 63 octave_idx_type a_len = a.length (); |
64 octave_idx_type b_len = b.length (); | |
2928 | 65 |
5275 | 66 octave_idx_type ab_len = a_len > b_len ? a_len : b_len; |
2928 | 67 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
68 b.resize (ab_len, 1, 0.0); |
4844 | 69 if (a_len > 1) |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
70 a.resize (ab_len, 1, 0.0); |
2928 | 71 |
72 T norm = a (0); | |
73 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
74 if (norm == static_cast<T>(0.0)) |
2928 | 75 { |
76 error ("filter: the first element of a must be non-zero"); | |
77 return y; | |
78 } | |
79 | |
4844 | 80 dim_vector x_dims = x.dims (); |
5056 | 81 if (dim < 0 || dim > x_dims.length ()) |
4844 | 82 { |
83 error ("filter: filtering over invalid dimension"); | |
84 return y; | |
85 } | |
86 | |
5275 | 87 octave_idx_type x_len = x_dims(dim); |
4844 | 88 |
89 dim_vector si_dims = si.dims (); | |
5275 | 90 octave_idx_type si_len = si_dims(0); |
4844 | 91 |
92 if (si_len != ab_len - 1) | |
93 { | |
94 error ("filter: first dimension of si must be of length max (length (a), length (b)) - 1"); | |
95 return y; | |
96 } | |
97 | |
5059 | 98 if (si_dims.length () != x_dims.length ()) |
4844 | 99 { |
100 error ("filter: dimensionality of si and x must agree"); | |
101 return y; | |
102 } | |
103 | |
5275 | 104 octave_idx_type si_dim = 0; |
105 for (octave_idx_type i = 0; i < x_dims.length (); i++) | |
4844 | 106 { |
107 if (i == dim) | |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
108 continue; |
5055 | 109 |
110 if (x_dims(i) == 1) | |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
111 continue; |
5055 | 112 |
5059 | 113 if (si_dims(++si_dim) != x_dims(i)) |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
114 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
115 error ("filter: dimensionality of si and x must agree"); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
116 return y; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
117 } |
4844 | 118 } |
2928 | 119 |
10241
a277ba5da4dc
filter.cc: return early if X is empty
John W. Eaton <jwe@octave.org>
parents:
10155
diff
changeset
|
120 if (x_len == 0) |
a277ba5da4dc
filter.cc: return early if X is empty
John W. Eaton <jwe@octave.org>
parents:
10155
diff
changeset
|
121 return x; |
a277ba5da4dc
filter.cc: return early if X is empty
John W. Eaton <jwe@octave.org>
parents:
10155
diff
changeset
|
122 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
123 if (norm != static_cast<T>(1.0)) |
4844 | 124 { |
125 a = a / norm; | |
126 b = b / norm; | |
127 } | |
2928 | 128 |
5056 | 129 if (a_len <= 1 && si_len <= 0) |
4844 | 130 return b(0) * x; |
131 | |
132 y.resize (x_dims, 0.0); | |
133 | |
134 int x_stride = 1; | |
135 for (int i = 0; i < dim; i++) | |
136 x_stride *= x_dims(i); | |
2928 | 137 |
5275 | 138 octave_idx_type x_num = x_dims.numel () / x_len; |
139 for (octave_idx_type num = 0; num < x_num; num++) | |
4844 | 140 { |
5275 | 141 octave_idx_type x_offset; |
4844 | 142 if (x_stride == 1) |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
143 x_offset = num * x_len; |
4844 | 144 else |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
145 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
146 octave_idx_type x_offset2 = 0; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
147 x_offset = num; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
148 while (x_offset >= x_stride) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
149 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
150 x_offset -= x_stride; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
151 x_offset2++; |
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 x_offset += x_offset2 * x_stride * x_len; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
154 } |
5275 | 155 octave_idx_type si_offset = num * si_len; |
2928 | 156 |
4844 | 157 if (a_len > 1) |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
158 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
159 T *py = y.fortran_vec (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
160 T *psi = si.fortran_vec (); |
5114 | 161 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
162 const T *pa = a.data (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
163 const T *pb = b.data (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
164 const T *px = x.data (); |
5114 | 165 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
166 psi += si_offset; |
5114 | 167 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
168 for (octave_idx_type i = 0, idx = x_offset; i < x_len; i++, idx += x_stride) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
169 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
170 py[idx] = psi[0] + pb[0] * px[idx]; |
5114 | 171 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
172 if (si_len > 0) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
173 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
174 for (octave_idx_type j = 0; j < si_len - 1; j++) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
175 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
176 OCTAVE_QUIT; |
5114 | 177 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
178 psi[j] = psi[j+1] - pa[j+1] * py[idx] + pb[j+1] * px[idx]; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
179 } |
5114 | 180 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
181 psi[si_len-1] = pb[si_len] * px[idx] - pa[si_len] * py[idx]; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
182 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
183 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
184 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
185 OCTAVE_QUIT; |
5114 | 186 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
187 psi[0] = pb[si_len] * px[idx] - pa[si_len] * py[idx]; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
188 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
189 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
190 } |
5114 | 191 else if (si_len > 0) |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
192 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
193 T *py = y.fortran_vec (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
194 T *psi = si.fortran_vec (); |
5114 | 195 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
196 const T *pb = b.data (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
197 const T *px = x.data (); |
5114 | 198 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
199 psi += si_offset; |
5114 | 200 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
201 for (octave_idx_type i = 0, idx = x_offset; i < x_len; i++, idx += x_stride) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
202 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
203 py[idx] = psi[0] + pb[0] * px[idx]; |
4844 | 204 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
205 if (si_len > 1) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
206 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
207 for (octave_idx_type j = 0; j < si_len - 1; j++) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
208 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
209 OCTAVE_QUIT; |
4153 | 210 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
211 psi[j] = psi[j+1] + pb[j+1] * px[idx]; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
212 } |
4844 | 213 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
214 psi[si_len-1] = pb[si_len] * px[idx]; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
215 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
216 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
217 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
218 OCTAVE_QUIT; |
4844 | 219 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
220 psi[0] = pb[1] * px[idx]; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
221 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
222 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
223 } |
2928 | 224 } |
4844 | 225 |
2928 | 226 return y; |
227 } | |
228 | |
3109 | 229 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL) |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
230 extern MArray<double> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
231 filter (MArray<double>&, MArray<double>&, MArray<double>&, |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
232 MArray<double>&, int dim); |
2928 | 233 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
234 extern MArray<Complex> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
235 filter (MArray<Complex>&, MArray<Complex>&, MArray<Complex>&, |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
236 MArray<Complex>&, int dim); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
237 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
238 extern MArray<float> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
239 filter (MArray<float>&, MArray<float>&, MArray<float>&, |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
240 MArray<float>&, int dim); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
241 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
242 extern MArray<FloatComplex> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
243 filter (MArray<FloatComplex>&, MArray<FloatComplex>&, MArray<FloatComplex>&, |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
244 MArray<FloatComplex>&, int dim); |
3107 | 245 #endif |
2928 | 246 |
247 template <class T> | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
248 MArray<T> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
249 filter (MArray<T>& b, MArray<T>& a, MArray<T>& x, int dim = -1) |
2928 | 250 { |
5059 | 251 dim_vector x_dims = x.dims(); |
4844 | 252 |
253 if (dim < 0) | |
254 { | |
255 // Find first non-singleton dimension | |
5059 | 256 while (dim < x_dims.length () && x_dims(dim) <= 1) |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
257 dim++; |
4844 | 258 |
259 // All dimensions singleton, pick first dimension | |
260 if (dim == x_dims.length ()) | |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
261 dim = 0; |
4844 | 262 } |
263 else | |
264 if (dim < 0 || dim > x_dims.length ()) | |
265 { | |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
266 error ("filter: filtering over invalid dimension"); |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
267 return MArray<T> (); |
4844 | 268 } |
269 | |
5275 | 270 octave_idx_type a_len = a.length (); |
271 octave_idx_type b_len = b.length (); | |
2928 | 272 |
5275 | 273 octave_idx_type si_len = (a_len > b_len ? a_len : b_len) - 1; |
4844 | 274 dim_vector si_dims = x.dims (); |
275 for (int i = dim; i > 0; i--) | |
5059 | 276 si_dims(i) = si_dims(i-1); |
277 si_dims(0) = si_len; | |
4844 | 278 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
279 MArray<T> si (si_dims, T (0.0)); |
2928 | 280 |
4844 | 281 return filter (b, a, x, si, dim); |
2928 | 282 } |
283 | |
3097 | 284 DEFUN_DLD (filter, args, nargout, |
3367 | 285 "-*- texinfo -*-\n\ |
10840 | 286 @deftypefn {Loadable Function} {y =} filter (@var{b}, @var{a}, @var{x})\n\ |
3367 | 287 @deftypefnx {Loadable Function} {[@var{y}, @var{sf}] =} filter (@var{b}, @var{a}, @var{x}, @var{si})\n\ |
4844 | 288 @deftypefnx {Loadable Function} {[@var{y}, @var{sf}] =} filter (@var{b}, @var{a}, @var{x}, [], @var{dim})\n\ |
289 @deftypefnx {Loadable Function} {[@var{y}, @var{sf}] =} filter (@var{b}, @var{a}, @var{x}, @var{si}, @var{dim})\n\ | |
3367 | 290 Return the solution to the following linear, time-invariant difference\n\ |
291 equation:\n\ | |
292 @tex\n\ | |
293 $$\n\ | |
294 \\sum_{k=0}^N a_{k+1} y_{n-k} = \\sum_{k=0}^M b_{k+1} x_{n-k}, \\qquad\n\ | |
295 1 \\le n \\le P\n\ | |
296 $$\n\ | |
297 @end tex\n\ | |
8517
81d6ab3ac93c
Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents:
7789
diff
changeset
|
298 @ifnottex\n\ |
2928 | 299 \n\ |
9153
5247e89688e1
Eliminate most overfull errors when running texi2pdf for generating pdf documentation
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
300 @c Set example in small font to prevent overfull line\n\ |
3367 | 301 @smallexample\n\ |
10840 | 302 @group\n\ |
3367 | 303 N M\n\ |
304 SUM a(k+1) y(n-k) = SUM b(k+1) x(n-k) for 1<=n<=length(x)\n\ | |
305 k=0 k=0\n\ | |
10840 | 306 @end group\n\ |
3367 | 307 @end smallexample\n\ |
10840 | 308 \n\ |
8517
81d6ab3ac93c
Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents:
7789
diff
changeset
|
309 @end ifnottex\n\ |
2928 | 310 \n\ |
3367 | 311 @noindent\n\ |
312 where\n\ | |
8517
81d6ab3ac93c
Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents:
7789
diff
changeset
|
313 @ifnottex\n\ |
3367 | 314 N=length(a)-1 and M=length(b)-1.\n\ |
8517
81d6ab3ac93c
Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents:
7789
diff
changeset
|
315 @end ifnottex\n\ |
3367 | 316 @tex\n\ |
317 $a \\in \\Re^{N-1}$, $b \\in \\Re^{M-1}$, and $x \\in \\Re^P$.\n\ | |
318 @end tex\n\ | |
4844 | 319 over the first non-singleton dimension of @var{x} or over @var{dim} if\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
320 supplied. An equivalent form of this equation is:\n\ |
3367 | 321 @tex\n\ |
322 $$\n\ | |
323 y_n = -\\sum_{k=1}^N c_{k+1} y_{n-k} + \\sum_{k=0}^M d_{k+1} x_{n-k}, \\qquad\n\ | |
324 1 \\le n \\le P\n\ | |
325 $$\n\ | |
326 @end tex\n\ | |
8517
81d6ab3ac93c
Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents:
7789
diff
changeset
|
327 @ifnottex\n\ |
2928 | 328 \n\ |
9153
5247e89688e1
Eliminate most overfull errors when running texi2pdf for generating pdf documentation
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
329 @c Set example in small font to prevent overfull line\n\ |
3367 | 330 @smallexample\n\ |
10840 | 331 @group\n\ |
3367 | 332 N M\n\ |
333 y(n) = - SUM c(k+1) y(n-k) + SUM d(k+1) x(n-k) for 1<=n<=length(x)\n\ | |
334 k=1 k=0\n\ | |
10840 | 335 @end group\n\ |
3367 | 336 @end smallexample\n\ |
10840 | 337 \n\ |
8517
81d6ab3ac93c
Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents:
7789
diff
changeset
|
338 @end ifnottex\n\ |
3367 | 339 \n\ |
340 @noindent\n\ | |
341 where\n\ | |
8517
81d6ab3ac93c
Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents:
7789
diff
changeset
|
342 @ifnottex\n\ |
3367 | 343 c = a/a(1) and d = b/a(1).\n\ |
8517
81d6ab3ac93c
Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents:
7789
diff
changeset
|
344 @end ifnottex\n\ |
3367 | 345 @tex\n\ |
346 $c = a/a_1$ and $d = b/a_1$.\n\ | |
347 @end tex\n\ | |
348 \n\ | |
349 If the fourth argument @var{si} is provided, it is taken as the\n\ | |
350 initial state of the system and the final state is returned as\n\ | |
351 @var{sf}. The state vector is a column vector whose length is\n\ | |
352 equal to the length of the longest coefficient vector minus one.\n\ | |
353 If @var{si} is not supplied, the initial state vector is set to all\n\ | |
2928 | 354 zeros.\n\ |
355 \n\ | |
3367 | 356 In terms of the z-transform, y is the result of passing the discrete-\n\ |
357 time signal x through a system characterized by the following rational\n\ | |
358 system function:\n\ | |
359 @tex\n\ | |
360 $$\n\ | |
361 H(z) = {\\displaystyle\\sum_{k=0}^M d_{k+1} z^{-k}\n\ | |
362 \\over 1 + \\displaystyle\\sum_{k+1}^N c_{k+1} z^{-k}}\n\ | |
363 $$\n\ | |
364 @end tex\n\ | |
8517
81d6ab3ac93c
Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents:
7789
diff
changeset
|
365 @ifnottex\n\ |
3367 | 366 \n\ |
367 @example\n\ | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
368 @group\n\ |
3367 | 369 M\n\ |
370 SUM d(k+1) z^(-k)\n\ | |
371 k=0\n\ | |
372 H(z) = ----------------------\n\ | |
373 N\n\ | |
6476 | 374 1 + SUM c(k+1) z^(-k)\n\ |
3367 | 375 k=1\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
376 @end group\n\ |
3367 | 377 @end example\n\ |
10840 | 378 \n\ |
8517
81d6ab3ac93c
Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents:
7789
diff
changeset
|
379 @end ifnottex\n\ |
3367 | 380 @end deftypefn") |
2928 | 381 { |
382 octave_value_list retval; | |
383 | |
384 int nargin = args.length (); | |
385 | |
4844 | 386 if (nargin < 3 || nargin > 5) |
2928 | 387 { |
5823 | 388 print_usage (); |
2928 | 389 return retval; |
390 } | |
391 | |
4844 | 392 const char *errmsg = "filter: arguments a and b must be vectors"; |
393 | |
394 int dim; | |
395 dim_vector x_dims = args(2).dims (); | |
2928 | 396 |
4844 | 397 if (nargin == 5) |
398 { | |
399 dim = args(4).nint_value() - 1; | |
400 if (dim < 0 || dim >= x_dims.length ()) | |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
401 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
402 error ("filter: filtering over invalid dimension"); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
403 return retval; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
404 } |
4844 | 405 } |
406 else | |
407 { | |
408 // Find first non-singleton dimension | |
409 dim = 0; | |
5059 | 410 while (dim < x_dims.length () && x_dims(dim) <= 1) |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
411 dim++; |
4844 | 412 |
413 // All dimensions singleton, pick first dimension | |
414 if (dim == x_dims.length ()) | |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
415 dim = 0; |
4844 | 416 } |
2928 | 417 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
418 bool isfloat = (args(0).is_single_type () |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
419 || args(1).is_single_type () |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
420 || args(2).is_single_type () |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
421 || (nargin >= 4 && args(3).is_single_type ())); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
422 |
2928 | 423 if (args(0).is_complex_type () |
424 || args(1).is_complex_type () | |
425 || args(2).is_complex_type () | |
4844 | 426 || (nargin >= 4 && args(3).is_complex_type ())) |
2928 | 427 { |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
428 if (isfloat) |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
429 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
430 FloatComplexColumnVector b (args(0).float_complex_vector_value ()); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
431 FloatComplexColumnVector a (args(1).float_complex_vector_value ()); |
3088 | 432 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
433 FloatComplexNDArray x (args(2).float_complex_array_value ()); |
3088 | 434 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
435 if (! error_state) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
436 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
437 FloatComplexNDArray si; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
438 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
439 if (nargin == 3 || args(3).is_empty ()) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
440 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
441 octave_idx_type a_len = a.length (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
442 octave_idx_type b_len = b.length (); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
443 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
444 octave_idx_type si_len = (a_len > b_len ? a_len : b_len) - 1; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
445 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
446 dim_vector si_dims = x.dims (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
447 for (int i = dim; i > 0; i--) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
448 si_dims(i) = si_dims(i-1); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
449 si_dims(0) = si_len; |
3088 | 450 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
451 si.resize (si_dims, 0.0); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
452 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
453 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
454 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
455 dim_vector si_dims = args (3).dims (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
456 bool si_is_vector = true; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
457 for (int i = 0; i < si_dims.length (); i++) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
458 if (si_dims(i) != 1 && si_dims(i) < si_dims.numel ()) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
459 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
460 si_is_vector = false; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
461 break; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
462 } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
463 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
464 si = args(3).float_complex_array_value (); |
2928 | 465 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
466 if (si_is_vector) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
467 si = si.reshape (dim_vector (si.numel (), 1)); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
468 } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
469 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
470 if (! error_state) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
471 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
472 FloatComplexNDArray y (filter (b, a, x, si, dim)); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
473 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
474 if (nargout == 2) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
475 retval(1) = si; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
476 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
477 retval(0) = y; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
478 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
479 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
480 error (errmsg); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
481 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
482 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
483 error (errmsg); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
484 } |
2928 | 485 else |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
486 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
487 ComplexColumnVector b (args(0).complex_vector_value ()); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
488 ComplexColumnVector a (args(1).complex_vector_value ()); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
489 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
490 ComplexNDArray x (args(2).complex_array_value ()); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
491 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
492 if (! error_state) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
493 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
494 ComplexNDArray si; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
495 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
496 if (nargin == 3 || args(3).is_empty ()) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
497 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
498 octave_idx_type a_len = a.length (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
499 octave_idx_type b_len = b.length (); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
500 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
501 octave_idx_type si_len = (a_len > b_len ? a_len : b_len) - 1; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
502 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
503 dim_vector si_dims = x.dims (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
504 for (int i = dim; i > 0; i--) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
505 si_dims(i) = si_dims(i-1); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
506 si_dims(0) = si_len; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
507 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
508 si.resize (si_dims, 0.0); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
509 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
510 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
511 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
512 dim_vector si_dims = args (3).dims (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
513 bool si_is_vector = true; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
514 for (int i = 0; i < si_dims.length (); i++) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
515 if (si_dims(i) != 1 && si_dims(i) < si_dims.numel ()) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
516 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
517 si_is_vector = false; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
518 break; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
519 } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
520 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
521 si = args(3).complex_array_value (); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
522 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
523 if (si_is_vector) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
524 si = si.reshape (dim_vector (si.numel (), 1)); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
525 } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
526 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
527 if (! error_state) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
528 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
529 ComplexNDArray y (filter (b, a, x, si, dim)); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
530 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
531 if (nargout == 2) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
532 retval(1) = si; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
533 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
534 retval(0) = y; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
535 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
536 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
537 error (errmsg); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
538 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
539 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
540 error (errmsg); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
541 } |
2928 | 542 } |
543 else | |
544 { | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
545 if (isfloat) |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
546 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
547 FloatColumnVector b (args(0).float_vector_value ()); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
548 FloatColumnVector a (args(1).float_vector_value ()); |
3088 | 549 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
550 FloatNDArray x (args(2).float_array_value ()); |
3088 | 551 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
552 if (! error_state) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
553 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
554 FloatNDArray si; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
555 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
556 if (nargin == 3 || args(3).is_empty ()) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
557 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
558 octave_idx_type a_len = a.length (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
559 octave_idx_type b_len = b.length (); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
560 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
561 octave_idx_type si_len = (a_len > b_len ? a_len : b_len) - 1; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
562 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
563 dim_vector si_dims = x.dims (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
564 for (int i = dim; i > 0; i--) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
565 si_dims(i) = si_dims(i-1); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
566 si_dims(0) = si_len; |
3088 | 567 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
568 si.resize (si_dims, 0.0); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
569 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
570 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
571 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
572 dim_vector si_dims = args (3).dims (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
573 bool si_is_vector = true; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
574 for (int i = 0; i < si_dims.length (); i++) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
575 if (si_dims(i) != 1 && si_dims(i) < si_dims.numel ()) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
576 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
577 si_is_vector = false; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
578 break; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
579 } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
580 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
581 si = args(3).float_array_value (); |
2928 | 582 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
583 if (si_is_vector) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
584 si = si.reshape (dim_vector (si.numel (), 1)); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
585 } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
586 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
587 if (! error_state) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
588 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
589 FloatNDArray y (filter (b, a, x, si, dim)); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
590 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
591 if (nargout == 2) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
592 retval(1) = si; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
593 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
594 retval(0) = y; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
595 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
596 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
597 error (errmsg); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
598 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
599 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
600 error (errmsg); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
601 } |
2928 | 602 else |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
603 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
604 ColumnVector b (args(0).vector_value ()); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
605 ColumnVector a (args(1).vector_value ()); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
606 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
607 NDArray x (args(2).array_value ()); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
608 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
609 if (! error_state) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
610 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
611 NDArray si; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
612 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
613 if (nargin == 3 || args(3).is_empty ()) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
614 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
615 octave_idx_type a_len = a.length (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
616 octave_idx_type b_len = b.length (); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
617 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
618 octave_idx_type si_len = (a_len > b_len ? a_len : b_len) - 1; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
619 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
620 dim_vector si_dims = x.dims (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
621 for (int i = dim; i > 0; i--) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
622 si_dims(i) = si_dims(i-1); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
623 si_dims(0) = si_len; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
624 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
625 si.resize (si_dims, 0.0); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
626 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
627 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
628 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
629 dim_vector si_dims = args (3).dims (); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
630 bool si_is_vector = true; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
631 for (int i = 0; i < si_dims.length (); i++) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
632 if (si_dims(i) != 1 && si_dims(i) < si_dims.numel ()) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
633 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
634 si_is_vector = false; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
635 break; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
636 } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
637 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
638 si = args(3).array_value (); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
639 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
640 if (si_is_vector) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
641 si = si.reshape (dim_vector (si.numel (), 1)); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
642 } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
643 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
644 if (! error_state) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
645 { |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
646 NDArray y (filter (b, a, x, si, dim)); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
647 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
648 if (nargout == 2) |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
649 retval(1) = si; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
650 |
10154
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
651 retval(0) = y; |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
652 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
653 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
654 error (errmsg); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
655 } |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
656 else |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
657 error (errmsg); |
40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents:
9758
diff
changeset
|
658 } |
2928 | 659 } |
660 | |
661 return retval; | |
662 } | |
663 | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
664 template MArray<double> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
665 filter (MArray<double>&, MArray<double>&, MArray<double>&, |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
666 MArray<double>&, int dim); |
2928 | 667 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
668 template MArray<double> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
669 filter (MArray<double>&, MArray<double>&, MArray<double>&, int dim); |
2928 | 670 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
671 template MArray<Complex> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
672 filter (MArray<Complex>&, MArray<Complex>&, MArray<Complex>&, |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
673 MArray<Complex>&, int dim); |
2928 | 674 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
675 template MArray<Complex> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
676 filter (MArray<Complex>&, MArray<Complex>&, MArray<Complex>&, int dim); |
2928 | 677 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
678 template MArray<float> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
679 filter (MArray<float>&, MArray<float>&, MArray<float>&, |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
680 MArray<float>&, int dim); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
681 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
682 template MArray<float> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
683 filter (MArray<float>&, MArray<float>&, MArray<float>&, int dim); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
684 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
685 template MArray<FloatComplex> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
686 filter (MArray<FloatComplex>&, MArray<FloatComplex>&, MArray<FloatComplex>&, |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
687 MArray<FloatComplex>&, int dim); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
688 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
689 template MArray<FloatComplex> |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10247
diff
changeset
|
690 filter (MArray<FloatComplex>&, MArray<FloatComplex>&, MArray<FloatComplex>&, int dim); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
691 |
2928 | 692 /* |
9432
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
693 %!shared a, b, x, r |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
694 %!test |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
695 %! a = [1 1]; |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
696 %! b = [1 1]; |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
697 %! x = zeros(1,10); x(1) = 1; |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
698 %! assert(all(filter(b, [1], x ) == [1 1 0 0 0 0 0 0 0 0] )) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
699 %! assert(all(filter(b, [1], x.') == [1 1 0 0 0 0 0 0 0 0].')) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
700 %! assert(all(filter(b.', [1], x ) == [1 1 0 0 0 0 0 0 0 0] )) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
701 %! assert(all(filter(b.', [1], x.') == [1 1 0 0 0 0 0 0 0 0].')) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
702 %! assert(all(filter([1], a, x ) == [+1 -1 +1 -1 +1 -1 +1 -1 +1 -1] )) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
703 %! assert(all(filter([1], a, x.') == [+1 -1 +1 -1 +1 -1 +1 -1 +1 -1].')) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
704 %! assert(all(filter([1], a.', x ) == [+1 -1 +1 -1 +1 -1 +1 -1 +1 -1] )) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
705 %! assert(all(filter([1], a.', x.') == [+1 -1 +1 -1 +1 -1 +1 -1 +1 -1].')) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
706 %! assert(all(filter(b, a, x ) == [1 0 0 0 0 0 0 0 0 0] )) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
707 %! assert(all(filter(b.', a, x ) == [1 0 0 0 0 0 0 0 0 0] )) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
708 %! assert(all(filter(b, a.', x ) == [1 0 0 0 0 0 0 0 0 0] )) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
709 %! assert(all(filter(b.', a, x ) == [1 0 0 0 0 0 0 0 0 0] )) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
710 %! assert(all(filter(b, a, x.') == [1 0 0 0 0 0 0 0 0 0].')) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
711 %! assert(all(filter(b.', a, x.') == [1 0 0 0 0 0 0 0 0 0].')) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
712 %! assert(all(filter(b, a.', x.') == [1 0 0 0 0 0 0 0 0 0].')) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
713 %! assert(all(filter(b.', a, x.') == [1 0 0 0 0 0 0 0 0 0].')) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
714 %! |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
715 %!test |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
716 %! r = sqrt(1/2)*(1+i); |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
717 %! a = a*r; |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
718 %! b = b*r; |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
719 %! assert(all(filter(b, [1], x ) == r*[1 1 0 0 0 0 0 0 0 0] )) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
720 %! assert(all(filter(b, [1], r*x ) == r*r*[1 1 0 0 0 0 0 0 0 0] )) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
721 %! assert(all(filter(b, [1], x.' ) == r*[1 1 0 0 0 0 0 0 0 0].' )) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
722 %! assert(all(filter(b, a, x ) == [1 0 0 0 0 0 0 0 0 0] )) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
723 %! assert(all(filter(b, a, r*x ) == r*[1 0 0 0 0 0 0 0 0 0] )) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
724 %! |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
725 %!shared a, b, x, y, so |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
726 %!test |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
727 %! a = [1,1]; b=[1,1]; |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
728 %! x = zeros(1,10); x(1) = 1; |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
729 %! [y, so] = filter(b, [1], x, [-1]); |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
730 %! assert(all(y == [0 1 0 0 0 0 0 0 0 0])) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
731 %! assert(so,0) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
732 %! |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
733 %!test |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
734 %! x = zeros(10,3); x(1,1)=-1; x(1,2)=1; |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
735 %! y0 = zeros(10,3); y0(1:2,1)=-1; y0(1:2,2)=1; |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
736 %! y = filter(b,[1],x); |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
737 %! assert(all(all(y==y0))) |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
738 %! |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
739 %!test |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
740 %! a = [1,1]; b=[1,1]; |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
741 %! x = zeros(4,4,2); x(1,1:4,1) = +1; x(1,1:4,2) = -1; |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
742 %! y0 = zeros(4,4,2); y0(1:2,1:4,1) = +1; y0(1:2,1:4,2) = -1; |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
743 %! y = filter(b, [1], x); |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
744 %! assert(all(all(all(y==y0)))) |
10247
edfceeab945a
Add test case for empty argument in filter()
Thomas Weber <thomas.weber.mail@gmail.com>
parents:
10241
diff
changeset
|
745 %! |
edfceeab945a
Add test case for empty argument in filter()
Thomas Weber <thomas.weber.mail@gmail.com>
parents:
10241
diff
changeset
|
746 %!assert(filter(1,ones(10,1)/10,[]), []) |
edfceeab945a
Add test case for empty argument in filter()
Thomas Weber <thomas.weber.mail@gmail.com>
parents:
10241
diff
changeset
|
747 %!assert(filter(1,ones(10,1)/10,zeros(0,10)), zeros(0,10)) |
9432
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
748 |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
749 %% Should put some tests of the "DIM" parameter in here. |
8cc2d087f3c1
src/DLD-FUNCTIONS/filter.cc: new tests
Robert T. Short <octave@phaselockedsystems.com>
parents:
9153
diff
changeset
|
750 |
10155
d0ce5e973937
DLD-FUNCTIONS/*.cc: delete Emacs local-variables settings
John W. Eaton <jwe@octave.org>
parents:
10154
diff
changeset
|
751 */ |