mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
fix a couple of compilations issues
This commit is contained in:
@@ -205,8 +205,8 @@ void LDLT<MatrixType>::compute(const MatrixType& a)
|
||||
continue;
|
||||
}
|
||||
|
||||
RealScalar Djj = ei_real(m_matrix.coeff(j,j) - (m_matrix.row(j).start(j)
|
||||
* m_matrix.col(j).start(j).conjugate()).coeff(0,0));
|
||||
RealScalar Djj = ei_real(m_matrix.coeff(j,j) - m_matrix.row(j).start(j)
|
||||
.dot(m_matrix.col(j).start(j)));
|
||||
m_matrix.coeffRef(j,j) = Djj;
|
||||
|
||||
// Finish early if the matrix is not full rank.
|
||||
|
||||
@@ -149,7 +149,7 @@ class GeneralProduct<Lhs, Rhs, InnerProduct>
|
||||
template<typename Dest> void addTo(Dest& dst, Scalar alpha) const
|
||||
{
|
||||
ei_assert(dst.rows()==1 && dst.cols()==1);
|
||||
dst.coeffRef(0,0) += (m_lhs.cwise()*m_rhs).sum();
|
||||
dst.coeffRef(0,0) += alpha * (m_lhs.cwise()*m_rhs).sum();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -911,11 +911,7 @@ Transform<Scalar,Dim,Mode>::inverse(TransformTraits hint) const
|
||||
}
|
||||
// translation and remaining parts
|
||||
res.template corner<Dim,1>(TopRight) = - res.template corner<Dim,Dim>(TopLeft) * translation();
|
||||
if (int(Mode)!=AffineCompact)
|
||||
{
|
||||
res.template corner<1,Dim>(BottomLeft).setZero();
|
||||
res.coeffRef(Dim,Dim) = Scalar(1);
|
||||
}
|
||||
makeAffine();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,8 +174,10 @@ umeyama(const MatrixBase<Derived>& src, const MatrixBase<OtherDerived>& dst, boo
|
||||
const Scalar c = 1/src_var * svd.singularValues().dot(S);
|
||||
|
||||
// Eq. (41)
|
||||
// TODO: lazyness does not make much sense over here, right?
|
||||
Rt.col(m).segment(0,m) = dst_mean - c*Rt.block(0,0,m,m)*src_mean;
|
||||
// Note that we first assign dst_mean to the destination so that there no need
|
||||
// for a temporary.
|
||||
Rt.col(m).start(m) = dst_mean;
|
||||
Rt.col(m).start(m) -= (c*Rt.corner(TopLeft,m,m)*src_mean).lazy();
|
||||
|
||||
if (with_scaling) Rt.block(0,0,m,m) *= c;
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ void HessenbergDecomposition<MatrixType>::_compute(MatrixType& matA, CoeffVector
|
||||
// i.e., A = H' A H where H = I - h v v' and v = matA.col(i).end(n-i-1)
|
||||
matA.col(i).coeffRef(i+1) = 1;
|
||||
|
||||
// first let's do A = H A
|
||||
// first let's do A = H' A
|
||||
matA.corner(BottomRight,n-i-1,n-i-1) -= ((ei_conj(h) * matA.col(i).end(n-i-1)) *
|
||||
(matA.col(i).end(n-i-1).adjoint() * matA.corner(BottomRight,n-i-1,n-i-1))).lazy();
|
||||
|
||||
@@ -213,14 +213,15 @@ HessenbergDecomposition<MatrixType>::matrixQ(void) const
|
||||
{
|
||||
int n = m_matrix.rows();
|
||||
MatrixType matQ = MatrixType::Identity(n,n);
|
||||
Matrix<Scalar,1,MatrixType::ColsAtCompileTime> temp(n);
|
||||
for (int i = n-2; i>=0; i--)
|
||||
{
|
||||
Scalar tmp = m_matrix.coeff(i+1,i);
|
||||
m_matrix.const_cast_derived().coeffRef(i+1,i) = 1;
|
||||
|
||||
matQ.corner(BottomRight,n-i-1,n-i-1) -=
|
||||
((m_hCoeffs.coeff(i) * m_matrix.col(i).end(n-i-1)) *
|
||||
(m_matrix.col(i).end(n-i-1).adjoint() * matQ.corner(BottomRight,n-i-1,n-i-1)).lazy()).lazy();
|
||||
int rs = n-i-1;
|
||||
temp.end(rs) = (m_matrix.col(i).end(rs).adjoint() * matQ.corner(BottomRight,rs,rs)).lazy();
|
||||
matQ.corner(BottomRight,rs,rs) -= (m_hCoeffs.coeff(i) * m_matrix.col(i).end(rs) * temp.end(rs)).lazy();
|
||||
|
||||
m_matrix.const_cast_derived().coeffRef(i+1,i) = tmp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user