endif
it1=istk(il1+3)
-c If "fast" algo was chosen and polynomial is complex,
+c If "fast" algo was chosen and polynomial is complex,
c then produce an error.
if ( .not.eigen .and. it1 .eq. 1 ) then
err=2
n=mn1
if(.not.ref) then
- call dtild(n*(it1+1),stk(l1),1)
+ call dtild(n,stk(l1),1)
+ if(it1.eq.1) then
+ call dtild(n,stk(l1+n),1)
+ endif
lc=l1
else
lc=lw
endif
if ( .not.eigen .and.n.gt.100) then
-c If "fast" algo was chosen and polynomial has degree greater than 100,
+c If "fast" algo was chosen and polynomial has degree greater than 100,
c then produce an error.
err=2
call error(116)
istk(ilr+2)=0
istk(ilr+3)=0
lstk(top+1)=sadr(ilr+4)
-
+
return
end
c =======================================
E = sortRoots(E);
R = sortRoots(R);
assert_checkalmostequal(R, E, 1.e-10, 1.e-8);
+assert_checkequal(roots([4 3 2 1]), roots(poly([1 2 3 4], 'x', 'coeff')));
+assert_checkequal(roots([4 3 2 1] + [1 2 3 4]*%i), roots(poly([1 2 3 4]+[4 3 2 1]*%i,'x','coeff')));
E = sortRoots(E);
R = sortRoots(R);
assert_checkalmostequal(R, E, 1.e-10, 1.e-8);
+
+assert_checkequal(roots([4 3 2 1]), roots(poly([1 2 3 4], 'x', 'coeff')));
+assert_checkequal(roots([4 3 2 1] + [1 2 3 4]*%i), roots(poly([1 2 3 4]+[4 3 2 1]*%i,'x','coeff')));
+