mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-23 10:09:36 +08:00
Backed out changeset 58fb27cd566f4057cee914be4cfe4f87abe8dc04
This commit is contained in:
parent
58fb27cd56
commit
b05f59ee07
@ -25,7 +25,6 @@ namespace Eigen {
|
|||||||
#include "src/misc/Solve.h"
|
#include "src/misc/Solve.h"
|
||||||
#include "src/SVD/SVD.h"
|
#include "src/SVD/SVD.h"
|
||||||
#include "src/SVD/JacobiSVD.h"
|
#include "src/SVD/JacobiSVD.h"
|
||||||
#include "src/SVD/UpperBidiagonalization.h"
|
|
||||||
|
|
||||||
} // namespace Eigen
|
} // namespace Eigen
|
||||||
|
|
||||||
|
@ -171,21 +171,15 @@ class BandMatrix : public AnyMatrixBase<BandMatrix<_Scalar,Rows,Cols,Supers,Subs
|
|||||||
return Block<DataType,1,Dynamic>(m_data, supers()-i, std::max(0,i), 1, diagonalLength(i));
|
return Block<DataType,1,Dynamic>(m_data, supers()-i, std::max(0,i), 1, diagonalLength(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Dest> inline void evalTo(Dest& dst) const
|
|
||||||
{
|
|
||||||
dst.resize(rows(),cols());
|
|
||||||
dst.setZero();
|
|
||||||
dst.diagonal() = diagonal();
|
|
||||||
for (int i=1; i<=supers();++i)
|
|
||||||
dst.diagonal(i) = diagonal(i);
|
|
||||||
for (int i=1; i<=subs();++i)
|
|
||||||
dst.diagonal(-i) = diagonal(-i);
|
|
||||||
}
|
|
||||||
|
|
||||||
DenseMatrixType toDenseMatrix() const
|
DenseMatrixType toDenseMatrix() const
|
||||||
{
|
{
|
||||||
DenseMatrixType res(rows(),cols());
|
DenseMatrixType res(rows(),cols());
|
||||||
evalTo(res);
|
res.setZero();
|
||||||
|
res.diagonal() = diagonal();
|
||||||
|
for (int i=1; i<=supers();++i)
|
||||||
|
res.diagonal(i) = diagonal(i);
|
||||||
|
for (int i=1; i<=subs();++i)
|
||||||
|
res.diagonal(-i) = diagonal(-i);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,10 +105,10 @@ template<typename VectorsType, typename CoeffsType> class HouseholderSequence
|
|||||||
{
|
{
|
||||||
if(m_trans)
|
if(m_trans)
|
||||||
dst.corner(BottomRight, length-k, length-k)
|
dst.corner(BottomRight, length-k, length-k)
|
||||||
.applyHouseholderOnTheRight(m_vectors.col(k).tail(length-k-1), m_coeffs.coeff(k), &temp.coeffRef(0));
|
.applyHouseholderOnTheRight(m_vectors.col(k).tail(length-k-1), m_coeffs.coeff(k), &temp.coeffRef(0));
|
||||||
else
|
else
|
||||||
dst.corner(BottomRight, length-k, length-k)
|
dst.corner(BottomRight, length-k, length-k)
|
||||||
.applyHouseholderOnTheLeft(m_vectors.col(k).tail(length-k-1), m_coeffs.coeff(k), &temp.coeffRef(k));
|
.applyHouseholderOnTheLeft(m_vectors.col(k).tail(length-k-1), m_coeffs.coeff(k), &temp.coeffRef(k));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ template<typename VectorsType, typename CoeffsType> class HouseholderSequence
|
|||||||
for(int k = 0; k < vecs; ++k)
|
for(int k = 0; k < vecs; ++k)
|
||||||
{
|
{
|
||||||
int actual_k = m_trans ? vecs-k-1 : k;
|
int actual_k = m_trans ? vecs-k-1 : k;
|
||||||
dst.block(0, dst.cols()-length, dst.rows(), length-actual_k)
|
dst.corner(BottomRight, dst.rows(), length-actual_k)
|
||||||
.applyHouseholderOnTheRight(m_vectors.col(actual_k).tail(length-actual_k-1), m_coeffs.coeff(actual_k), &temp.coeffRef(0));
|
.applyHouseholderOnTheRight(m_vectors.col(actual_k).tail(length-actual_k-1), m_coeffs.coeff(actual_k), &temp.coeffRef(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -135,7 +135,7 @@ template<typename VectorsType, typename CoeffsType> class HouseholderSequence
|
|||||||
for(int k = 0; k < vecs; ++k)
|
for(int k = 0; k < vecs; ++k)
|
||||||
{
|
{
|
||||||
int actual_k = m_trans ? k : vecs-k-1;
|
int actual_k = m_trans ? k : vecs-k-1;
|
||||||
dst.block(dst.rows()-length, 0, length-actual_k, dst.cols())
|
dst.corner(BottomRight, length-actual_k, dst.cols())
|
||||||
.applyHouseholderOnTheLeft(m_vectors.col(actual_k).tail(length-actual_k-1), m_coeffs.coeff(actual_k), &temp.coeffRef(0));
|
.applyHouseholderOnTheLeft(m_vectors.col(actual_k).tail(length-actual_k-1), m_coeffs.coeff(actual_k), &temp.coeffRef(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ template<typename _MatrixType> class HouseholderQR
|
|||||||
RowsAtCompileTime = MatrixType::RowsAtCompileTime,
|
RowsAtCompileTime = MatrixType::RowsAtCompileTime,
|
||||||
ColsAtCompileTime = MatrixType::ColsAtCompileTime,
|
ColsAtCompileTime = MatrixType::ColsAtCompileTime,
|
||||||
Options = MatrixType::Options,
|
Options = MatrixType::Options,
|
||||||
DiagSizeAtCompileTime = EIGEN_SIZE_MIN(ColsAtCompileTime,RowsAtCompileTime)
|
DiagSizeAtCompileTime = EIGEN_ENUM_MIN(ColsAtCompileTime,RowsAtCompileTime)
|
||||||
};
|
};
|
||||||
typedef typename MatrixType::Scalar Scalar;
|
typedef typename MatrixType::Scalar Scalar;
|
||||||
typedef typename MatrixType::RealScalar RealScalar;
|
typedef typename MatrixType::RealScalar RealScalar;
|
||||||
|
@ -133,7 +133,6 @@ ei_add_test(hessenberg " " "${GSL_LIBRARIES}")
|
|||||||
ei_add_test(eigensolver_selfadjoint " " "${GSL_LIBRARIES}")
|
ei_add_test(eigensolver_selfadjoint " " "${GSL_LIBRARIES}")
|
||||||
ei_add_test(eigensolver_generic " " "${GSL_LIBRARIES}")
|
ei_add_test(eigensolver_generic " " "${GSL_LIBRARIES}")
|
||||||
ei_add_test(eigensolver_complex)
|
ei_add_test(eigensolver_complex)
|
||||||
ei_add_test(upperbidiagonalization)
|
|
||||||
ei_add_test(svd)
|
ei_add_test(svd)
|
||||||
ei_add_test(jacobisvd)
|
ei_add_test(jacobisvd)
|
||||||
ei_add_test(geo_orthomethods)
|
ei_add_test(geo_orthomethods)
|
||||||
|
@ -79,7 +79,7 @@ template<typename MatrixType> void householder(const MatrixType& m)
|
|||||||
m3.rowwise() = v1.transpose();
|
m3.rowwise() = v1.transpose();
|
||||||
m4 = m3;
|
m4 = m3;
|
||||||
m3.row(0).makeHouseholder(essential, beta, alpha);
|
m3.row(0).makeHouseholder(essential, beta, alpha);
|
||||||
m3.applyHouseholderOnTheRight(essential,beta,tmp);
|
m3.applyHouseholderOnTheRight(essential.transpose(),beta,tmp);
|
||||||
VERIFY_IS_APPROX(m3.norm(), m4.norm());
|
VERIFY_IS_APPROX(m3.norm(), m4.norm());
|
||||||
VERIFY_IS_MUCH_SMALLER_THAN(m3.block(0,1,rows,rows-1).norm(), m3.norm());
|
VERIFY_IS_MUCH_SMALLER_THAN(m3.block(0,1,rows,rows-1).norm(), m3.norm());
|
||||||
VERIFY_IS_MUCH_SMALLER_THAN(ei_imag(m3(0,0)), ei_real(m3(0,0)));
|
VERIFY_IS_MUCH_SMALLER_THAN(ei_imag(m3(0,0)), ei_real(m3(0,0)));
|
||||||
|
@ -114,7 +114,7 @@ template<typename MatrixType> void qr_verify_assert()
|
|||||||
|
|
||||||
void test_qr()
|
void test_qr()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < g_repeat; i++) {
|
for(int i = 0; i < 1; i++) {
|
||||||
CALL_SUBTEST_1( qr(MatrixXf(47,40)) );
|
CALL_SUBTEST_1( qr(MatrixXf(47,40)) );
|
||||||
CALL_SUBTEST_2( qr(MatrixXcd(17,7)) );
|
CALL_SUBTEST_2( qr(MatrixXcd(17,7)) );
|
||||||
CALL_SUBTEST_3(( qr_fixedsize<Matrix<float,3,4>, 2 >() ));
|
CALL_SUBTEST_3(( qr_fixedsize<Matrix<float,3,4>, 2 >() ));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user