|
From: <kin...@us...> - 2004-02-19 11:20:57
|
Update of /cvsroot/teem/teem/src/ell In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32097 Modified Files: eigen.c Log Message: ell_3m_eigenvalues_d was not sorting the eigenvalues, even though ell_3m_eigensolve_d (called tenEigensolve) did do the sorting Index: eigen.c =================================================================== RCS file: /cvsroot/teem/teem/src/ell/eigen.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** eigen.c 7 Jan 2004 15:34:29 -0000 1.16 --- eigen.c 19 Feb 2004 11:10:34 -0000 1.17 *************** *** 178,183 **** int ell_3m_eigenvalues_d(double _eval[3], double _m[9], int newton) { ! double A, B, C, scale, frob, m[9], eval[3]; ! int ret; frob = ELL_3M_FROB(_m); --- 178,183 ---- int ell_3m_eigenvalues_d(double _eval[3], double _m[9], int newton) { ! double A, B, C, scale, frob, m[9], eval[3], tmp; ! int roots; frob = ELL_3M_FROB(_m); *************** *** 196,202 **** + (m[0]*m[5] - m[2]*m[3])*m[7] + (m[1]*m[3] - m[0]*m[4])*m[8]; ! ret = ell_cubic(eval, A, B, C, newton); ELL_3V_SCALE(_eval, 1.0/scale, eval); ! return ret; } --- 196,206 ---- + (m[0]*m[5] - m[2]*m[3])*m[7] + (m[1]*m[3] - m[0]*m[4])*m[8]; ! roots = ell_cubic(eval, A, B, C, newton); ! if (ell_cubic_root_three == roots ! || ell_cubic_root_single_double == roots) { ! ELL_SORT3(eval[0], eval[1], eval[2], tmp); ! } ELL_3V_SCALE(_eval, 1.0/scale, eval); ! return roots; } |