what are the conventions for makeGivens()

Submitted by Peter Milani

Assigned to Nobody

Link to original bugzilla bug (#1748)
Version: 3.2
Operating system: Linux

Description

I've been developing a QR factorisation on the GPU and comparing against Eigen.

At one step I am calculating Givens Rotations but I notice that very often the values of the sine and cosine from

Eigen::JacobiRotation<float>::makeGivens()

are of the same magnitude but of opposite sign.

Looking into Jacobi.h I notice that on lines 238, 247 and 248 an extra negativity is introduced.

Additionally when I use a single Givens rotation to generate a 3x3 Tridiagonal matrix from a 3x3 symmetric matrix, I notice that

Eigen::Matrix3f QMat = Eigen::TridiagonalizationEigen::Matrix3f::matrixQ(),

which should be a single 3x3 Givens Rotation matrix, has cosine elements of opposite signs e.g:

QMat:

    1         0         0  

    0 -0.668965 -0.743294  

    0 -0.743294  0.668965  

i.e. the elements on the diagonal (the cosine elements, should have the same value and sign)

Is there some funniny convention going on. I've also prototyped my stuff in python with success and ensured that all matrix implementations are RowMajor (my convention), but the above hints to me of some significant convention disparity (or an error :-))