aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/adjoint.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-12-12 17:48:20 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-12-12 17:48:20 +0000
commitfc7b2b5c2091c4a165587ceea4c8228b0feabab8 (patch)
tree8cbc7436000efafe800d09f8bf5b0e4d81c4a3cf /test/adjoint.cpp
parente9a458a7a56705bf546be8d86ccc32af14cd5bff (diff)
expand unit-tests and fix const-qualifaction bugs thus discovered
Diffstat (limited to 'test/adjoint.cpp')
-rw-r--r--test/adjoint.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/adjoint.cpp b/test/adjoint.cpp
index 1d98d6a9b..7a33f8b73 100644
--- a/test/adjoint.cpp
+++ b/test/adjoint.cpp
@@ -87,6 +87,13 @@ template<typename MatrixType> void adjoint(const MatrixType& m)
// check compatibility of dot and adjoint
VERIFY_IS_APPROX(v1.dot(square * v2), (square.adjoint() * v1).dot(v2));
+
+ // like in testBasicStuff, test operator() to check const-qualification
+ int r = random<int>(0, rows-1),
+ c = random<int>(0, cols-1);
+ VERIFY_IS_APPROX(m1.conjugate()(r,c), conj(m1(r,c)));
+ VERIFY_IS_APPROX(m1.adjoint()(c,r), conj(m1(r,c)));
+
}
void EigenTest::testAdjoint()