scicpp::polynomial::polycompanion

Defined in header <scicpp/polynomials.hpp>

Return the companion matrix of a polynomial.


template<typename T, std::size_t N>
Eigen::Matrix<T, N - 1, N - 1> polycompanion(const std::array<T, N> &P)

Polynomial coefficients stored in a std::array.

Return a square fixed size Eigen::Matrix of size the polynomial degree.


template<typename T>
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> polycompanion(const std::vector<T> &P)

Polynomial coefficients stored in a std::vector.

Return a square dynamic size Eigen::Matrix of size the polynomial degree.