17 template<
typename _MatrixType,
int _UpLo>
struct traits<
LLT<_MatrixType, _UpLo> >
26 template<
typename MatrixType,
int UpLo>
struct LLT_Traits;
66 template<
typename _MatrixType,
int _UpLo>
class LLT 76 MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
81 AlignmentMask =
int(PacketSize)-1,
93 LLT() : m_matrix(), m_isInitialized(false) {}
102 m_isInitialized(false) {}
104 template<
typename InputType>
106 : m_matrix(matrix.
rows(), matrix.
cols()),
107 m_isInitialized(false)
119 template<
typename InputType>
121 : m_matrix(matrix.derived()),
122 m_isInitialized(false)
128 inline typename Traits::MatrixU
matrixU()
const 130 eigen_assert(m_isInitialized &&
"LLT is not initialized.");
131 return Traits::getU(m_matrix);
135 inline typename Traits::MatrixL
matrixL()
const 137 eigen_assert(m_isInitialized &&
"LLT is not initialized.");
138 return Traits::getL(m_matrix);
141 #ifdef EIGEN_PARSED_BY_DOXYGEN 152 template<
typename Rhs>
157 template<
typename Derived>
160 template<
typename InputType>
168 eigen_assert(m_isInitialized &&
"LLT is not initialized.");
179 eigen_assert(m_isInitialized &&
"LLT is not initialized.");
183 MatrixType reconstructedMatrix()
const;
193 eigen_assert(m_isInitialized &&
"LLT is not initialized.");
207 template<
typename VectorType>
210 #ifndef EIGEN_PARSED_BY_DOXYGEN 211 template<
typename RhsType,
typename DstType>
212 void _solve_impl(
const RhsType &rhs, DstType &dst)
const;
214 template<
bool Conjugate,
typename RhsType,
typename DstType>
215 void _solve_impl_transposed(
const RhsType &rhs, DstType &dst)
const;
239 template<
typename MatrixType,
typename VectorType>
261 temp =
sqrt(sigma) * vec;
271 ColXprSegment
x(mat.col(i).tail(rs));
272 TempVecSegment
y(temp.tail(rs));
285 Scalar wj = temp.coeff(
j);
287 RealScalar gamma = dj*beta + swj2;
289 RealScalar
x = dj + swj2/beta;
292 RealScalar nLjj =
sqrt(x);
293 mat.coeffRef(
j,
j) = nLjj;
300 temp.tail(rs) -= (wj/Ljj) * mat.col(j).tail(rs);
302 mat.col(j).tail(rs) = (nLjj/Ljj) * mat.col(j).tail(rs) + (nLjj * sigma*
numext::conj(wj)/gamma)*temp.tail(rs);
312 template<
typename MatrixType>
328 if (k>0) x -= A10.squaredNorm();
331 mat.coeffRef(k,k) = x =
sqrt(x);
332 if (k>0 && rs>0) A21.noalias() -= A20 * A10.adjoint();
338 template<
typename MatrixType>
346 Index blockSize = size/8;
347 blockSize = (blockSize/16)*16;
357 Index rs = size - k - bs;
363 if((ret=unblocked(A11))>=0)
return k+
ret;
364 if(rs>0) A11.adjoint().template triangularView<Upper>().
template solveInPlace<OnTheRight>(A21);
370 template<
typename MatrixType,
typename VectorType>
381 template<
typename MatrixType>
387 template<
typename MatrixType>
393 template<
typename MatrixType,
typename VectorType>
430 template<
typename MatrixType,
int _UpLo>
431 template<
typename InputType>
434 check_template_parameters();
438 m_matrix.resize(size, size);
448 abs_col_sum = m_matrix.col(
col).tail(size -
col).template lpNorm<1>() + m_matrix.row(
col).head(
col).template lpNorm<1>();
450 abs_col_sum = m_matrix.col(
col).head(
col).template lpNorm<1>() + m_matrix.row(
col).tail(size -
col).template lpNorm<1>();
451 if (abs_col_sum > m_l1_norm)
452 m_l1_norm = abs_col_sum;
455 m_isInitialized =
true;
456 bool ok = Traits::inplace_decomposition(m_matrix);
467 template<
typename _MatrixType,
int _UpLo>
468 template<
typename VectorType>
482 #ifndef EIGEN_PARSED_BY_DOXYGEN 483 template<
typename _MatrixType,
int _UpLo>
484 template<
typename RhsType,
typename DstType>
487 _solve_impl_transposed<true>(rhs, dst);
490 template<
typename _MatrixType,
int _UpLo>
491 template<
bool Conjugate,
typename RhsType,
typename DstType>
496 matrixL().template conjugateIf<!Conjugate>().solveInPlace(dst);
497 matrixU().template conjugateIf<!Conjugate>().solveInPlace(dst);
514 template<
typename MatrixType,
int _UpLo>
515 template<
typename Derived>
518 eigen_assert(m_isInitialized &&
"LLT is not initialized.");
520 matrixL().solveInPlace(bAndX);
521 matrixU().solveInPlace(bAndX);
527 template<
typename MatrixType,
int _UpLo>
530 eigen_assert(m_isInitialized &&
"LLT is not initialized.");
531 return matrixL() * matrixL().adjoint().toDenseMatrix();
538 template<
typename Derived>
549 template<
typename MatrixType,
unsigned int UpLo>
558 #endif // EIGEN_LLT_H
#define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived)
#define EIGEN_STRONG_INLINE
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
void _solve_impl_transposed(const RhsType &rhs, DstType &dst) const
VectorBlock< Derived > SegmentReturnType
internal::traits< Derived >::Scalar Scalar
const TriangularView< const MatrixType, Lower > MatrixL
MatrixType reconstructedMatrix() const
Expression of the transpose of a matrix.
EIGEN_DEVICE_FUNC void apply_rotation_in_the_plane(DenseBase< VectorX > &xpr_x, DenseBase< VectorY > &xpr_y, const JacobiRotation< OtherScalar > &j)
const LLT & adjoint() const EIGEN_NOEXCEPT
LLT(Index size)
Default Constructor with memory preallocation.
Namespace containing all symbols from the Eigen library.
Block< Derived, internal::traits< Derived >::RowsAtCompileTime, 1, !IsRowMajor > ColXpr
Rotation given by a cosine-sine pair.
static bool inplace_decomposition(MatrixType &m)
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
const TriangularView< const typename MatrixType::AdjointReturnType, Upper > MatrixU
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
LLT(const EigenBase< InputType > &matrix)
Decomposition::RealScalar rcond_estimate_helper(typename Decomposition::RealScalar matrix_norm, const Decomposition &dec)
Reciprocal condition number estimator.
Eigen::Index Index
The interface type of indices.
void _solve_impl(const RhsType &rhs, DstType &dst) const
void g(const string &key, int i)
LLT(EigenBase< InputType > &matrix)
Constructs a LLT factorization from a given matrix.
AnnoyingScalar conj(const AnnoyingScalar &x)
static EIGEN_STRONG_INLINE Index blocked(MatrixType &mat)
EIGEN_DEVICE_FUNC void makeGivens(const Scalar &p, const Scalar &q, Scalar *r=0)
internal::LLT_Traits< MatrixType, UpLo > Traits
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Array< int, Dynamic, 1 > v
NumTraits< Scalar >::Real RealScalar
#define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE)
EIGEN_DEVICE_FUNC bool is_same_dense(const T1 &mat1, const T2 &mat2, typename enable_if< possibly_same_dense< T1, T2 >::value >::type *=0)
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
static void check_template_parameters()
ComputationInfo info() const
Reports whether previous computation was successful.
NumTraits< Scalar >::Real RealScalar
static Index rankUpdate(MatrixType &mat, const VectorType &vec, const RealScalar &sigma)
static Index unblocked(MatrixType &mat)
static bool inplace_decomposition(MatrixType &m)
Traits::MatrixL matrixL() const
EIGEN_CONSTEXPR Index size(const T &x)
static Index llt_rank_update_lower(MatrixType &mat, const VectorType &vec, const typename MatrixType::RealScalar &sigma)
Expression of a fixed-size or dynamic-size block.
static EIGEN_STRONG_INLINE Index unblocked(MatrixType &mat)
SolverStorage StorageKind
static MatrixU getU(const MatrixType &m)
Traits::MatrixU matrixU() const
static MatrixU getU(const MatrixType &m)
static Index rankUpdate(MatrixType &mat, const VectorType &vec, const RealScalar &sigma)
Expression of a triangular part in a matrix.
LLT & rankUpdate(const VectorType &vec, const RealScalar &sigma=1)
const TriangularView< const MatrixType, Upper > MatrixU
const LLT< PlainObject > llt() const
LLT & compute(const EigenBase< InputType > &matrix)
static const double sigma
static Index blocked(MatrixType &m)
const TriangularView< const typename MatrixType::AdjointReturnType, Lower > MatrixL
const MatrixType & matrixLLT() const
Jet< T, N > sqrt(const Jet< T, N > &f)
Pseudo expression representing a solving operation.
LLT()
Default Constructor.
EIGEN_DONT_INLINE void compute(Solver &solver, const MatrixType &A)
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
static MatrixL getL(const MatrixType &m)
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
A base class for matrix decomposition and solvers.
EIGEN_DEVICE_FUNC bool abs2(bool x)
EIGEN_DEVICE_FUNC Derived & derived()
Base class for all dense matrices, vectors, and expressions.
const LLT< PlainObject, UpLo > llt() const
static MatrixL getL(const MatrixType &m)
void solveInPlace(const MatrixBase< Derived > &bAndX) const
NumTraits< Scalar >::Real RealScalar