Interpolation types not working

Hi,
I want to use ROOT::Math::Interpolator, with polynomial interpolation type. Here is my code:

[code]#include “Math/Interpolator.h”
#include “Math/Polynomial.h”

[…]

vector x;
vector y;
[fill vectors…]
ROOT::Math::Interpolator * Interpolator = new ROOT::Math::Interpolator(x, y);
TH1F *h = […];
for (int j = 0; j < x->size(); j++) {
h->SetBinContent(j, Interpolator->Deriv(x.at(j)));
}
h->Draw();

[/code]
This code works great, but uses the default interpolation method which is CSPLINE.
When I try to change the interpolator constructor to be:

ROOT::Math::Interpolator * Interpolator = new ROOT::Math::Interpolator(x, y, ROOT::Math::Interpolation::kPOLYNOMIAL);

, the code compiles, but when I try to draw h, I get the message:

Warning in <TPad::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.

What am I doing wrong?

Thank you,
Noa

It looks like the histogram you are trying to draw contains some undefined numbers.
Can ou post a small running reproducer ?