[vtkusers] Trouble with least squares

Denis Barbier bouzim at gmail.com
Thu Nov 19 14:46:06 EST 2009


On 2009/11/19 David Doria wrote:
> I am trying to find the least squares solution of a system (Ax = b). I
> tried to make a demo here:
> http://www.vtk.org/Wiki/Least_Squares
>
> but it crashes with some memory errors. Can anyone see where I have gone wrong?

Hi, you wrote
  vtkMath::SolveLeastSquares(NumberOfSamples, X, NumberOfVariables, Y,
NumberOfSamples, M);
instead of
   vtkMath::SolveLeastSquares(NumberOfSamples, X, NumberOfVariables, Y, 1, M);

Denis



More information about the vtkusers mailing list