Skip to content

Commit

Permalink
Merge pull request #2440 from chebfun/fix-chebpoly
Browse files Browse the repository at this point in the history
Fix chebpoly
  • Loading branch information
trefethen committed Apr 17, 2023
2 parents b839628 + e20e785 commit d9c5e7b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chebpoly.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@

% Construct the Chebyshev coefficients:
N = max(n) + 1;
% c = eye(N); % c = c(:,n+1); % Replaced by the below. See Issue #2438.
% Code below does the same as above without forming the NxN identity matrix.
M = numel(n);
c = zeros(N, M);
c(n+1,:) = eye(M);
Expand Down
9 changes: 9 additions & 0 deletions tests/chebfun/test_chebpoly.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,13 @@

warning(warnState);

% Test on very high degree polynomials (#2438)
try
chebpoly(1e5);
pass(9) = true;
catch
pass(9) = false;
end


end

0 comments on commit d9c5e7b

Please sign in to comment.