mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix shadow warnings triggered by clang
This commit is contained in:
@@ -71,11 +71,11 @@ template<typename MatrixType> void inverse(const MatrixType& m)
|
||||
|
||||
// check with submatrices
|
||||
{
|
||||
Matrix<Scalar, MatrixType::RowsAtCompileTime+1, MatrixType::RowsAtCompileTime+1, MatrixType::Options> m3;
|
||||
m3.setRandom();
|
||||
m3.topLeftCorner(rows,rows) = m1;
|
||||
m2 = m3.template topLeftCorner<MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime>().inverse();
|
||||
VERIFY_IS_APPROX( (m3.template topLeftCorner<MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime>()), m2.inverse() );
|
||||
Matrix<Scalar, MatrixType::RowsAtCompileTime+1, MatrixType::RowsAtCompileTime+1, MatrixType::Options> m5;
|
||||
m5.setRandom();
|
||||
m5.topLeftCorner(rows,rows) = m1;
|
||||
m2 = m5.template topLeftCorner<MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime>().inverse();
|
||||
VERIFY_IS_APPROX( (m5.template topLeftCorner<MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime>()), m2.inverse() );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -267,7 +267,6 @@ template<typename Solver> void check_sparse_spd_solving(Solver& solver)
|
||||
{
|
||||
if (it.sym() == SPD){
|
||||
A = it.matrix();
|
||||
Mat halfA;
|
||||
DenseVector b = it.rhs();
|
||||
DenseVector refX = it.refX();
|
||||
PermutationMatrix<Dynamic, Dynamic, StorageIndex> pnull;
|
||||
|
||||
@@ -55,16 +55,16 @@ template<typename Scalar,typename Index> void sparse_vector(int rows, int cols)
|
||||
|
||||
// test coeffRef with reallocation
|
||||
{
|
||||
SparseVectorType v1(rows);
|
||||
DenseVector v2 = DenseVector::Zero(rows);
|
||||
SparseVectorType v4(rows);
|
||||
DenseVector v5 = DenseVector::Zero(rows);
|
||||
for(int k=0; k<rows; ++k)
|
||||
{
|
||||
int i = internal::random<int>(0,rows-1);
|
||||
Scalar v = internal::random<Scalar>();
|
||||
v1.coeffRef(i) += v;
|
||||
v2.coeffRef(i) += v;
|
||||
v4.coeffRef(i) += v;
|
||||
v5.coeffRef(i) += v;
|
||||
}
|
||||
VERIFY_IS_APPROX(v1,v2);
|
||||
VERIFY_IS_APPROX(v4,v5);
|
||||
}
|
||||
|
||||
v1.coeffRef(nonzerocoords[0]) = Scalar(5);
|
||||
|
||||
Reference in New Issue
Block a user