usnistgov / ChebTools

C++ tools for working with Chebyshev expansion interpolants
MIT License
28 stars 8 forks source link

Linear roots1d capabilities #12

Closed LBouck closed 7 years ago

LBouck commented 7 years ago

Added capabilities to take care of some corner cases for Chebyshev Expansions with trailing zeros and Chebyshev Expansions that are linear. Changes were made in real_roots function to handle linear cases and a new function was added called reduce_zeros in ChebTools.h to get rid of trailing zeros and some tests cases were added to tests.cpp. These changes were made to prevent nans from popping up in the companion matrix when there are trailing zeros or Eigen throwing exceptions when the matrix would be 1x1 in the linear case.

Everything compiled and could build properly. Also, all previous test cases still pass in tests.cpp.