Eigen::SparseQR_QProduct< SparseQRType, Derived > Struct Template Reference
+ Inheritance diagram for Eigen::SparseQR_QProduct< SparseQRType, Derived >:

Public Types

typedef SparseQRType::QRMatrixType MatrixType
 
typedef SparseQRType::Scalar Scalar
 
- Public Types inherited from Eigen::ReturnByValue< SparseQR_QProduct< SparseQRType, Derived > >
typedef internal::dense_xpr_base< ReturnByValue >::type Base
 
typedef internal::traits< SparseQR_QProduct< SparseQRType, Derived > >::ReturnType ReturnType
 

Public Member Functions

Index cols () const
 
template<typename DesType >
void evalTo (DesType &res) const
 
Index rows () const
 
 SparseQR_QProduct (const SparseQRType &qr, const Derived &other, bool transpose)
 
- Public Member Functions inherited from Eigen::ReturnByValue< SparseQR_QProduct< SparseQRType, Derived > >
EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
void evalTo (Dest &dst) const
 
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 

Public Attributes

const Derived & m_other
 
const SparseQRType & m_qr
 
bool m_transpose
 

Detailed Description

template<typename SparseQRType, typename Derived>
struct Eigen::SparseQR_QProduct< SparseQRType, Derived >

Definition at line 615 of file SparseQR.h.

Member Typedef Documentation

◆ MatrixType

template<typename SparseQRType , typename Derived >
typedef SparseQRType::QRMatrixType Eigen::SparseQR_QProduct< SparseQRType, Derived >::MatrixType

Definition at line 617 of file SparseQR.h.

◆ Scalar

template<typename SparseQRType , typename Derived >
typedef SparseQRType::Scalar Eigen::SparseQR_QProduct< SparseQRType, Derived >::Scalar

Definition at line 618 of file SparseQR.h.

Constructor & Destructor Documentation

◆ SparseQR_QProduct()

template<typename SparseQRType , typename Derived >
Eigen::SparseQR_QProduct< SparseQRType, Derived >::SparseQR_QProduct ( const SparseQRType &  qr,
const Derived &  other,
bool  transpose 
)
inline

Definition at line 620 of file SparseQR.h.

620  :
621  m_qr(qr),m_other(other),m_transpose(transpose) {}
HouseholderQR< MatrixXf > qr(A)
const SparseQRType & m_qr
Definition: SparseQR.h:670
const Derived & m_other
Definition: SparseQR.h:671

Member Function Documentation

◆ cols()

template<typename SparseQRType , typename Derived >
Index Eigen::SparseQR_QProduct< SparseQRType, Derived >::cols ( void  ) const
inline

Definition at line 623 of file SparseQR.h.

623 { return m_other.cols(); }

◆ evalTo()

template<typename SparseQRType , typename Derived >
template<typename DesType >
void Eigen::SparseQR_QProduct< SparseQRType, Derived >::evalTo ( DesType &  res) const
inline

Definition at line 627 of file SparseQR.h.

628  {
629  Index m = m_qr.rows();
630  Index n = m_qr.cols();
631  Index diagSize = (std::min)(m,n);
632  res = m_other;
633  if (m_transpose)
634  {
635  eigen_assert(m_qr.m_Q.rows() == m_other.rows() && "Non conforming object sizes");
636  //Compute res = Q' * other column by column
637  for(Index j = 0; j < res.cols(); j++){
638  for (Index k = 0; k < diagSize; k++)
639  {
640  Scalar tau = Scalar(0);
641  tau = m_qr.m_Q.col(k).dot(res.col(j));
642  if(tau==Scalar(0)) continue;
643  tau = tau * m_qr.m_hcoeffs(k);
644  res.col(j) -= tau * m_qr.m_Q.col(k);
645  }
646  }
647  }
648  else
649  {
650  eigen_assert(m_qr.matrixQ().cols() == m_other.rows() && "Non conforming object sizes");
651 
652  res.conservativeResize(rows(), cols());
653 
654  // Compute res = Q * other column by column
655  for(Index j = 0; j < res.cols(); j++)
656  {
657  Index start_k = internal::is_identity<Derived>::value ? numext::mini(j,diagSize-1) : diagSize-1;
658  for (Index k = start_k; k >=0; k--)
659  {
660  Scalar tau = Scalar(0);
661  tau = m_qr.m_Q.col(k).dot(res.col(j));
662  if(tau==Scalar(0)) continue;
663  tau = tau * numext::conj(m_qr.m_hcoeffs(k));
664  res.col(j) -= tau * m_qr.m_Q.col(k);
665  }
666  }
667  }
668  }
Matrix3f m
int n
#define eigen_assert(x)
Definition: Macros.h:902
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
bfloat16() min(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:684
EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:82
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_conjugate_op< typename Derived::Scalar >, const Derived > conj(const Eigen::ArrayBase< Derived > &x)
Index cols() const
Definition: SparseQR.h:623
SparseQRType::Scalar Scalar
Definition: SparseQR.h:618
Index rows() const
Definition: SparseQR.h:622
std::ptrdiff_t j

◆ rows()

template<typename SparseQRType , typename Derived >
Index Eigen::SparseQR_QProduct< SparseQRType, Derived >::rows ( void  ) const
inline

Definition at line 622 of file SparseQR.h.

622 { return m_qr.matrixQ().rows(); }

Member Data Documentation

◆ m_other

template<typename SparseQRType , typename Derived >
const Derived& Eigen::SparseQR_QProduct< SparseQRType, Derived >::m_other

Definition at line 671 of file SparseQR.h.

◆ m_qr

template<typename SparseQRType , typename Derived >
const SparseQRType& Eigen::SparseQR_QProduct< SparseQRType, Derived >::m_qr

Definition at line 670 of file SparseQR.h.

◆ m_transpose

template<typename SparseQRType , typename Derived >
bool Eigen::SparseQR_QProduct< SparseQRType, Derived >::m_transpose

Definition at line 672 of file SparseQR.h.


The documentation for this struct was generated from the following file: