mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-19 08:09:36 +08:00
fix the remainder of bug #159
This commit is contained in:
parent
f88ca0ac79
commit
313eea8f10
@ -238,8 +238,8 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView
|
|||||||
return m_matrix.const_cast_derived().coeffRef(row, col);
|
return m_matrix.const_cast_derived().coeffRef(row, col);
|
||||||
}
|
}
|
||||||
|
|
||||||
const MatrixType& nestedExpression() const { return m_matrix; }
|
const MatrixTypeNestedCleaned& nestedExpression() const { return m_matrix; }
|
||||||
MatrixType& nestedExpression() { return const_cast<MatrixType&>(m_matrix); }
|
MatrixTypeNestedCleaned& nestedExpression() { return *const_cast<MatrixTypeNestedCleaned*>(&m_matrix); }
|
||||||
|
|
||||||
/** Assigns a triangular matrix to a triangular part of a dense matrix */
|
/** Assigns a triangular matrix to a triangular part of a dense matrix */
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
|
@ -150,6 +150,12 @@ void selfadjoint()
|
|||||||
ref3 << 1, 0,
|
ref3 << 1, 0,
|
||||||
0, 4;
|
0, 4;
|
||||||
VERIFY(m3 == ref3);
|
VERIFY(m3 == ref3);
|
||||||
|
|
||||||
|
// example inspired from bug 159
|
||||||
|
int array[] = {1, 2, 3, 4};
|
||||||
|
Matrix2i::Map(array).part<SelfAdjoint>() = Matrix2i::Random().part<LowerTriangular>();
|
||||||
|
|
||||||
|
std::cout << "hello\n" << array << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_eigen2_triangular()
|
void test_eigen2_triangular()
|
||||||
|
@ -235,6 +235,11 @@ template<typename MatrixType> void triangular_rect(const MatrixType& m)
|
|||||||
VERIFY_IS_APPROX(m2,m3);
|
VERIFY_IS_APPROX(m2,m3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bug_159()
|
||||||
|
{
|
||||||
|
Matrix3d m = Matrix3d::Random().triangularView<Lower>();
|
||||||
|
}
|
||||||
|
|
||||||
void test_triangular()
|
void test_triangular()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < g_repeat ; i++)
|
for(int i = 0; i < g_repeat ; i++)
|
||||||
@ -255,4 +260,6 @@ void test_triangular()
|
|||||||
CALL_SUBTEST_5( triangular_rect(MatrixXcd(r, c)) );
|
CALL_SUBTEST_5( triangular_rect(MatrixXcd(r, c)) );
|
||||||
CALL_SUBTEST_6( triangular_rect(Matrix<float,Dynamic,Dynamic,RowMajor>(r, c)) );
|
CALL_SUBTEST_6( triangular_rect(Matrix<float,Dynamic,Dynamic,RowMajor>(r, c)) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CALL_SUBTEST_1( bug_159() );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user