Re: Confusion in using BicubicSplineInterpolation

Posted by Luigi Ballabio-2 on
URL: http://quantlib.414.s1.nabble.com/Confusion-in-using-BicubicSplineInterpolation-tp2714p2715.html

At 12:41 AM 10/14/03, amar singh wrote:

>I observed a strange thing in using the class.
>Am I using it wrongly, or could there possibly be some problem?
>
>Following is the code:
>     {
>       std::vector<double> x(5);
>      ...
>      std::vector<double> y(6);
>      ...
>      Math::Matrix z(x.size(),y.size());

Amar,
         we'll have to document it better. When I wrote it, I visualized
the thing as on two Carthesian axes:

   [yM] [                   ]
   |. | |                   |
   |. | |     Z matrix      |
   |. | |                   |
   |y2| |                   |
   [y1] [                   |
        [ x1  x2  . . .  xN ]

Therefore, the i-th y-value corresponds to the i-th row, and the j-th
x-value to the j-th column. The constructor of Matrix being:

     Matrix(Size rows, Size columns);

the constructor call in your code should be:

     Matrix(y.size(), x.size())

Please, if anyone feels it's the wrong way around, just tell me so that we
can change the parameter order...

Later,
         Luigi