Eigen::SparseQR_QProduct< SparseQRType, Derived > Struct Template Reference

#include <SparseQR.h>

+ 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::traits< SparseQR_QProduct< SparseQRType, Derived > >::ReturnType ReturnType
 
typedef internal::dense_xpr_base< ReturnByValue >::type Base
 

Public Member Functions

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

Public Attributes

const SparseQRType & m_qr
 
const Derived & m_other
 
bool m_transpose
 

Member Typedef Documentation

◆ MatrixType

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

◆ Scalar

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

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
586  : m_qr(qr), m_other(other), m_transpose(transpose) {}
HouseholderQR< MatrixXf > qr(A)
void transpose()
Definition: skew_symmetric_matrix3.cpp:135
const SparseQRType & m_qr
Definition: SparseQR.h:628
bool m_transpose
Definition: SparseQR.h:630
const Derived & m_other
Definition: SparseQR.h:629

Member Function Documentation

◆ cols()

◆ evalTo()

template<typename SparseQRType , typename Derived >
template<typename DesType >
void Eigen::SparseQR_QProduct< SparseQRType, Derived >::evalTo ( DesType &  res) const
inline
592  {
593  Index m = m_qr.rows();
594  Index n = m_qr.cols();
595  Index diagSize = (std::min)(m, n);
596  res = m_other;
597  if (m_transpose) {
598  eigen_assert(m_qr.m_Q.rows() == m_other.rows() && "Non conforming object sizes");
599  // Compute res = Q' * other column by column
600  for (Index j = 0; j < res.cols(); j++) {
601  for (Index k = 0; k < diagSize; k++) {
602  Scalar tau = Scalar(0);
603  tau = m_qr.m_Q.col(k).dot(res.col(j));
604  if (tau == Scalar(0)) continue;
605  tau = tau * m_qr.m_hcoeffs(k);
606  res.col(j) -= tau * m_qr.m_Q.col(k);
607  }
608  }
609  } else {
610  eigen_assert(m_qr.matrixQ().cols() == m_other.rows() && "Non conforming object sizes");
611 
612  res.conservativeResize(rows(), cols());
613 
614  // Compute res = Q * other column by column
615  for (Index j = 0; j < res.cols(); j++) {
616  Index start_k = internal::is_identity<Derived>::value ? numext::mini(j, diagSize - 1) : diagSize - 1;
617  for (Index k = start_k; k >= 0; k--) {
618  Scalar tau = Scalar(0);
619  tau = m_qr.m_Q.col(k).dot(res.col(j));
620  if (tau == Scalar(0)) continue;
621  tau = tau * numext::conj(m_qr.m_hcoeffs(k));
622  res.col(j) -= tau * m_qr.m_Q.col(k);
623  }
624  }
625  }
626  }
AnnoyingScalar conj(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:133
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
#define eigen_assert(x)
Definition: Macros.h:910
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
SCALAR Scalar
Definition: bench_gemm.cpp:45
#define min(a, b)
Definition: datatypes.h:22
int * m
Definition: level2_cplx_impl.h:294
char char char int int * k
Definition: level2_impl.h:374
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
Definition: MathFunctions.h:920
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
Index cols() const
Definition: SparseQR.h:588
SparseQRType::Scalar Scalar
Definition: SparseQR.h:583
Index rows() const
Definition: SparseQR.h:587
@ value
Definition: XprHelper.h:845
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References Eigen::SparseQR_QProduct< SparseQRType, Derived >::cols(), conj(), eigen_assert, j, k, m, Eigen::SparseQR_QProduct< SparseQRType, Derived >::m_other, Eigen::SparseQR_QProduct< SparseQRType, Derived >::m_qr, Eigen::SparseQR_QProduct< SparseQRType, Derived >::m_transpose, min, Eigen::numext::mini(), n, res, and Eigen::SparseQR_QProduct< SparseQRType, Derived >::rows().

◆ rows()

Member Data Documentation

◆ m_other

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

◆ m_qr

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

◆ m_transpose

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

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