Skip to content
Snippets Groups Projects
Commit c65802e3 authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

[polynomial] deriv_coef : correctly set a coeff of full of zero when trying to...

[polynomial] deriv_coef : correctly set a coeff of full of zero when trying to derivate a polynome of degree 0
parent 38e62eb0
No related branches found
No related tags found
No related merge requests found
......@@ -332,6 +332,8 @@ namespace curves
coeff_t deriv_coeff(coeff_t coeff) const
{
if(coeff.cols() == 1) // only the constant part is left, fill with 0
return coeff_t::Zero(coeff.rows(),1);
coeff_t coeff_derivated(coeff.rows(), coeff.cols()-1);
for (std::size_t i=0; i<std::size_t(coeff_derivated.cols()); i++) {
coeff_derivated.col(i) = coeff.col(i+1)*(num_t)(i+1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment