Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57:06

0001 namespace Eigen { 
0002 
0003 namespace internal {
0004 
0005 // TODO : move this to GivensQR once there's such a thing in Eigen
0006 
0007 template <typename Scalar>
0008 void r1mpyq(DenseIndex m, DenseIndex n, Scalar *a, const std::vector<JacobiRotation<Scalar> > &v_givens, const std::vector<JacobiRotation<Scalar> > &w_givens)
0009 {
0010     typedef DenseIndex Index;
0011 
0012     /*     apply the first set of givens rotations to a. */
0013     for (Index j = n-2; j>=0; --j)
0014         for (Index i = 0; i<m; ++i) {
0015             Scalar temp = v_givens[j].c() * a[i+m*j] - v_givens[j].s() * a[i+m*(n-1)];
0016             a[i+m*(n-1)] = v_givens[j].s() * a[i+m*j] + v_givens[j].c() * a[i+m*(n-1)];
0017             a[i+m*j] = temp;
0018         }
0019     /*     apply the second set of givens rotations to a. */
0020     for (Index j = 0; j<n-1; ++j)
0021         for (Index i = 0; i<m; ++i) {
0022             Scalar temp = w_givens[j].c() * a[i+m*j] + w_givens[j].s() * a[i+m*(n-1)];
0023             a[i+m*(n-1)] = -w_givens[j].s() * a[i+m*j] + w_givens[j].c() * a[i+m*(n-1)];
0024             a[i+m*j] = temp;
0025         }
0026 }
0027 
0028 } // end namespace internal
0029 
0030 } // end namespace Eigen