mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Make is_same_dense compatible with different scalar types.
This commit is contained in:
@@ -14,9 +14,13 @@ using internal::is_same_dense;
|
||||
void test_is_same_dense()
|
||||
{
|
||||
typedef Matrix<double,Dynamic,Dynamic,ColMajor> ColMatrixXd;
|
||||
typedef Matrix<std::complex<double>,Dynamic,Dynamic,ColMajor> ColMatrixXcd;
|
||||
ColMatrixXd m1(10,10);
|
||||
ColMatrixXcd m2(10,10);
|
||||
Ref<ColMatrixXd> ref_m1(m1);
|
||||
Ref<ColMatrixXd,0, Stride<Dynamic,Dynamic> > ref_m2_real(m2.real());
|
||||
Ref<const ColMatrixXd> const_ref_m1(m1);
|
||||
|
||||
VERIFY(is_same_dense(m1,m1));
|
||||
VERIFY(is_same_dense(m1,ref_m1));
|
||||
VERIFY(is_same_dense(const_ref_m1,m1));
|
||||
@@ -30,4 +34,8 @@ void test_is_same_dense()
|
||||
|
||||
Ref<const ColMatrixXd> const_ref_m1_col(m1.col(1));
|
||||
VERIFY(is_same_dense(m1.col(1),const_ref_m1_col));
|
||||
|
||||
|
||||
VERIFY(!is_same_dense(m1, ref_m2_real));
|
||||
VERIFY(!is_same_dense(m2, ref_m2_real));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user