comparison scripts/polynomial/residue.m @ 5670:14313620a2c6

[project @ 2006-03-15 19:56:29 by jwe]
author jwe
date Wed, 15 Mar 2006 19:56:29 +0000
parents 2618a0750ae6
children 34f96dd5441b
comparison
equal deleted inserted replaced
5669:602d084346b2 5670:14313620a2c6
208 208
209 p(abs (p) < toler) = 0; 209 p(abs (p) < toler) = 0;
210 210
211 ## Determine if the poles are (effectively) real. 211 ## Determine if the poles are (effectively) real.
212 212
213 index = (abs (p) >= toler && (abs (imag (p)) ./ abs (p) < toler)); 213 index = (abs (p) >= toler & (abs (imag (p)) ./ abs (p) < toler));
214 p(index) = real (p(index)); 214 p(index) = real (p(index));
215 215
216 ## Find the direct term if there is one. 216 ## Find the direct term if there is one.
217 217
218 if (lb >= la) 218 if (lb >= la)
226 if (lp == 1) 226 if (lp == 1)
227 r = polyval (b, p); 227 r = polyval (b, p);
228 e = 1; 228 e = 1;
229 return; 229 return;
230 endif 230 endif
231
232 231
233 ## We need to determine the number and multiplicity of the roots. 232 ## We need to determine the number and multiplicity of the roots.
234 ## 233 ##
235 ## D is the number of distinct roots. 234 ## D is the number of distinct roots.
236 ## M is a vector of length D containing the multiplicity of each root. 235 ## M is a vector of length D containing the multiplicity of each root.