Boost logo

Ublas :

Subject: [ublas] lapack bindings: ppsv returns info=2
From: George Slavov (gpslavov_at_[hidden])
Date: 2011-04-22 13:04:55

I called ppsv on a matrix A and vector b, printed the contents of b and
they were unaltered (they weren't replaced by the solution). I noticed
the return value is 2 and the netlib docs say that means that

if INFO = i>0, the leading minor of order i of A is not
positive definite, so the factorization could not be
completed, and the solution has not been computed.

Unfortunately, no matter how I look at my matrix or how I slice it, its
eigenvalues are strictly positive, so I'm really confused by this
result. I've tried other simple examples and I have gotten correct
results but this example fails. For now I have switched to using gesv,
but I would really like it if I didn't resort to that. Here's some code:

ublas::symmetric_matrix<double> m2(4,4);
     m2(0,0) = 3.875; m2(0,1) = -.25; m2(0,2) = 0; m2(0,3) = -1;
                      m2(1,1) = 4.42857; m2(1,2) = 0; m2(1,3) = -1.14286;
                                         m2(2,2) = 4.0625; m2(2,3) = -1.25;
                                                           m2(3,3) = 4.04762;
ublas::vector<double> b2(4);
     b2(0) = 10.5833;
     b2(1) = 15.3393;
     b2(2) = 3.4896;
     b2(3) = 2.4702;

auto ppsvres = lapack::ppsv(m2, b2);

The result is ppsvres=2. It might be useful to know my build
environment: WinXP SP3, GotoBlas2, LAPACK (fortran lib), VS 2010
Express. What could be going wrong?

Best regards,
George Slavov