Go to the documentation of this file.
16 #ifndef EIGEN_SVDBASE_H
17 #define EIGEN_SVDBASE_H
62 template<
typename Derived>
class SVDBase
63 :
public SolverBase<SVDBase<Derived> >
67 template<
typename Derived_>
89 Derived&
derived() {
return *
static_cast<Derived*
>(
this); }
90 const Derived&
derived()
const {
return *
static_cast<const Derived*
>(
this); }
215 #ifdef EIGEN_PARSED_BY_DOXYGEN
225 template<
typename Rhs>
242 #ifndef EIGEN_PARSED_BY_DOXYGEN
243 template<
typename RhsType,
typename DstType>
244 void _solve_impl(
const RhsType &rhs, DstType &dst)
const;
246 template<
bool Conjugate,
typename RhsType,
typename DstType>
261 template<
bool Transpose_,
typename Rhs>
265 eigen_assert(
computeU() &&
computeV() &&
"SVDBase::solve(): Both unitaries U and V are required to be computed (thin unitaries suffice).");
266 eigen_assert((Transpose_?
cols():
rows())==
b.rows() &&
"SVDBase::solve(): invalid number of rows of the right hand side matrix b");
305 #ifndef EIGEN_PARSED_BY_DOXYGEN
306 template<
typename Derived>
307 template<
typename RhsType,
typename DstType>
314 Index l_rank = rank();
315 tmp.noalias() = m_matrixU.leftCols(l_rank).adjoint() * rhs;
316 tmp = m_singularValues.head(l_rank).asDiagonal().inverse() * tmp;
317 dst = m_matrixV.leftCols(l_rank) * tmp;
320 template<
typename Derived>
321 template<
bool Conjugate,
typename RhsType,
typename DstType>
328 Index l_rank = rank();
330 tmp.noalias() = m_matrixV.leftCols(l_rank).transpose().template conjugateIf<Conjugate>() * rhs;
331 tmp = m_singularValues.head(l_rank).asDiagonal().inverse() * tmp;
332 dst = m_matrixU.template conjugateIf<!Conjugate>().leftCols(l_rank) * tmp;
336 template<
typename MatrixType>
344 computationOptions == m_computationOptions)
352 m_isInitialized =
false;
353 m_isAllocated =
true;
354 m_computationOptions = computationOptions;
355 m_computeFullU = (computationOptions &
ComputeFullU) != 0;
356 m_computeThinU = (computationOptions &
ComputeThinU) != 0;
357 m_computeFullV = (computationOptions &
ComputeFullV) != 0;
358 m_computeThinV = (computationOptions &
ComputeThinV) != 0;
359 eigen_assert(!(m_computeFullU && m_computeThinU) &&
"SVDBase: you can't ask for both full and thin U");
360 eigen_assert(!(m_computeFullV && m_computeThinV) &&
"SVDBase: you can't ask for both full and thin V");
362 "SVDBase: thin U and V are only available when your matrix has a dynamic number of columns.");
364 m_diagSize = (
std::min)(m_rows, m_cols);
365 m_singularValues.resize(m_diagSize);
367 m_matrixU.resize(m_rows, m_computeFullU ? m_rows : m_computeThinU ? m_diagSize : 0);
369 m_matrixV.resize(m_cols, m_computeFullV ? m_cols : m_computeThinV ? m_diagSize : 0);
376 #endif // EIGEN_SVDBASE_H
SVDBase()
Default Constructor.
void _check_solve_assertion(const Rhs &b) const
#define EIGEN_DEVICE_FUNC
Namespace containing all symbols from the Eigen library.
bool m_usePrescribedThreshold
SolverStorage StorageKind
Base class of SVD algorithms.
bool allocate(Index rows, Index cols, unsigned int computationOptions)
Derived & setThreshold(const RealScalar &threshold)
RealScalar threshold() const
Matrix< Scalar, ColsAtCompileTime, ColsAtCompileTime, MatrixOptions, MaxColsAtCompileTime, MaxColsAtCompileTime > MatrixVType
internal::traits< Derived >::MatrixType MatrixType
SingularValuesType m_singularValues
const Derived & derived() const
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Eigen::internal::traits< SVDBase >::StorageIndex StorageIndex
NumTraits< typename MatrixType::Scalar >::Real RealScalar
void _solve_impl(const RhsType &rhs, DstType &dst) const
#define EIGEN_SIZE_MIN_PREFER_DYNAMIC(a, b)
Index m_nonzeroSingularValues
Index nonzeroSingularValues() const
const MatrixVType & matrixV() const
const SingularValuesType & singularValues() const
static void check_template_parameters()
@ MaxDiagSizeAtCompileTime
Matrix< Scalar, RowsAtCompileTime, RowsAtCompileTime, MatrixOptions, MaxRowsAtCompileTime, MaxRowsAtCompileTime > MatrixUType
Pseudo expression representing a solving operation.
internal::plain_diag_type< MatrixType, RealScalar >::type SingularValuesType
void _check_compute_assertions() const
Base class for all dense matrices, vectors, and expressions.
#define EIGEN_IMPLIES(a, b)
MatrixType::Scalar Scalar
unsigned int m_computationOptions
EIGEN_DEVICE_FUNC ComputationInfo info() const
Reports whether previous computation was successful.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
void _solve_impl_transposed(const RhsType &rhs, DstType &dst) const
#define EIGEN_SIZE_MIN_PREFER_FIXED(a, b)
Derived & setThreshold(Default_t)
RealScalar m_prescribedThreshold
const MatrixUType & matrixU() const
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
#define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE)
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:05:15