mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
* Merge Extract and Part to the Part expression.
Renamed "MatrixBase::extract() const" to "MatrixBase::part() const" * Renamed static functions identity, zero, ones, random with an upper case first letter: Identity, Zero, Ones and Random.
This commit is contained in:
@@ -209,7 +209,7 @@ typename HessenbergDecomposition<MatrixType>::MatrixType
|
||||
HessenbergDecomposition<MatrixType>::matrixQ(void) const
|
||||
{
|
||||
int n = m_matrix.rows();
|
||||
MatrixType matQ = MatrixType::identity(n,n);
|
||||
MatrixType matQ = MatrixType::Identity(n,n);
|
||||
for (int i = n-2; i>=0; i--)
|
||||
{
|
||||
Scalar tmp = m_matrix.coeff(i+1,i);
|
||||
|
||||
@@ -57,11 +57,11 @@ template<typename MatrixType> class QR
|
||||
bool isFullRank() const { return ei_isMuchSmallerThan(m_hCoeffs.cwise().abs().minCoeff(), Scalar(1)); }
|
||||
|
||||
/** \returns a read-only expression of the matrix R of the actual the QR decomposition */
|
||||
const Extract<NestByValue<MatrixRBlockType>, Upper>
|
||||
const Part<NestByValue<MatrixRBlockType>, Upper>
|
||||
matrixR(void) const
|
||||
{
|
||||
int cols = m_qr.cols();
|
||||
return MatrixRBlockType(m_qr, 0, 0, cols, cols).nestByValue().template extract<Upper>();
|
||||
return MatrixRBlockType(m_qr, 0, 0, cols, cols).nestByValue().template part<Upper>();
|
||||
}
|
||||
|
||||
MatrixType matrixQ(void) const;
|
||||
@@ -144,7 +144,7 @@ MatrixType QR<MatrixType>::matrixQ(void) const
|
||||
// and v_k is the k-th Householder vector [1,m_qr(k+1,k), m_qr(k+2,k), ...]
|
||||
int rows = m_qr.rows();
|
||||
int cols = m_qr.cols();
|
||||
MatrixType res = MatrixType::identity(rows, cols);
|
||||
MatrixType res = MatrixType::Identity(rows, cols);
|
||||
for (int k = cols-1; k >= 0; k--)
|
||||
{
|
||||
// to make easier the computation of the transformation, let's temporarily
|
||||
|
||||
@@ -79,6 +79,7 @@ template<typename _MatrixType> class SelfAdjointEigenSolver
|
||||
|
||||
void compute(const MatrixType& matA, const MatrixType& matB, bool computeEigenvectors = true);
|
||||
|
||||
/** \returns the computed eigen vectors as a matrix of column vectors */
|
||||
MatrixType eigenvectors(void) const
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
@@ -87,6 +88,7 @@ template<typename _MatrixType> class SelfAdjointEigenSolver
|
||||
return m_eivec;
|
||||
}
|
||||
|
||||
/** \returns the computed eigen values */
|
||||
RealVectorType eigenvalues(void) const { return m_eivalues; }
|
||||
|
||||
protected:
|
||||
|
||||
@@ -215,7 +215,7 @@ void Tridiagonalization<MatrixType>::_compute(MatrixType& matA, CoeffVectorType&
|
||||
|
||||
matA.col(i).coeffRef(i+1) = 1;
|
||||
// let's use the end of hCoeffs to store temporary values
|
||||
hCoeffs.end(n-i-1) = h * (matA.corner(BottomRight,n-i-1,n-i-1).template extract<Lower|SelfAdjoint>()
|
||||
hCoeffs.end(n-i-1) = h * (matA.corner(BottomRight,n-i-1,n-i-1).template part<Lower|SelfAdjoint>()
|
||||
* matA.col(i).end(n-i-1));
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ typename Tridiagonalization<MatrixType>::MatrixType
|
||||
Tridiagonalization<MatrixType>::matrixQ(void) const
|
||||
{
|
||||
int n = m_matrix.rows();
|
||||
MatrixType matQ = MatrixType::identity(n,n);
|
||||
MatrixType matQ = MatrixType::Identity(n,n);
|
||||
for (int i = n-2; i>=0; i--)
|
||||
{
|
||||
Scalar tmp = m_matrix.coeff(i+1,i);
|
||||
|
||||
Reference in New Issue
Block a user