* find the proper way of nesting the expression in Flagged:

finally that's more subtle than just using ei_nested, because when
  flagging with NestByValueBit we want to store the expression by value
  already, regardless of whether it already had the NestByValueBit set.
* rename temporary() ----> nestByValue()
* move the old Product.h to disabled/, replace by what was ProductWIP.h
* tweak -O and -g flags for tests and examples
* reorder the tests -- basic things go first
* simplifications, e.g. in many methoeds return derived() and count on
  implicit casting to the actual return type.
* strip some not-really-useful stuff from the heaviest tests
This commit is contained in:
Benoit Jacob
2008-05-28 04:38:16 +00:00
parent 559233c73e
commit aebecae510
15 changed files with 394 additions and 399 deletions

View File

@@ -73,14 +73,10 @@ template<typename MatrixType> void product(const MatrixType& m)
VERIFY_IS_APPROX(s1*(square*m1), (s1*square)*m1);
VERIFY_IS_APPROX(s1*(square*m1), square*(m1*s1));
// continue testing Product.h: lazy product
VERIFY_IS_APPROX(square.lazy() * m1, square*m1);
VERIFY_IS_APPROX(square * m1.lazy(), square*m1);
// again, test operator() to check const-qualification
s1 += (square.lazy() * m1)(r,c);
// test Product.h together with Identity.h
VERIFY_IS_APPROX(m1, identity*m1);
VERIFY_IS_APPROX(v1, identity*v1);
// again, test operator() to check const-qualification
VERIFY_IS_APPROX(MatrixType::identity(rows, cols)(r,c), static_cast<Scalar>(r==c));
@@ -92,18 +88,14 @@ template<typename MatrixType> void product(const MatrixType& m)
void test_product()
{
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( product(Matrix<float, 1, 1>()) );
CALL_SUBTEST( product(Matrix<float, 3, 3>()) );
CALL_SUBTEST( product(Matrix<float, 4, 2>()) );
CALL_SUBTEST( product(Matrix3i()) );
CALL_SUBTEST( product(Matrix<float, 3, 2>()) );
CALL_SUBTEST( product(Matrix4d()) );
}
for(int i = 0; i < g_repeat; i++) {
int rows = ei_random<int>(1,320);
int cols = ei_random<int>(1,320);
CALL_SUBTEST( product(MatrixXf(rows, cols)) );
CALL_SUBTEST( product(MatrixXd(rows, cols)) );
CALL_SUBTEST( product(MatrixXi(rows, cols)) );
CALL_SUBTEST( product(MatrixXcf(rows, cols)) );
CALL_SUBTEST( product(MatrixXcd(rows, cols)) );
CALL_SUBTEST( product(MatrixXf(ei_random<int>(1,320), ei_random<int>(1,320))) );
CALL_SUBTEST( product(MatrixXd(ei_random<int>(1,320), ei_random<int>(1,320))) );
CALL_SUBTEST( product(MatrixXi(ei_random<int>(1,320), ei_random<int>(1,320))) );
CALL_SUBTEST( product(MatrixXcf(ei_random<int>(1,50), ei_random<int>(1,50))) );
}
}