Function lbcrypto::Degree

Function Documentation

uint32_t lbcrypto::Degree(const std::vector<double> &coefficients)

Gets the degree of a polynomial specified by its coefficients, which is the index of the last non-zero element in the coefficients. If all the coefficients are zero, it returns 0.

Parameters

coefficients – vector of coefficients of a polynomial (can not be empty)

Returns

the integer degree of the polynomial.