this function could return "const std::vector<double> &" here so the vector won't be copied. You can also make the function const:
const std::vector<double> & cos_coeffs() const