From ac10ab4f3f7e3cac4981f93dec33de97d04b5566 Mon Sep 17 00:00:00 2001 From: David Wells Date: Fri, 16 Mar 2018 13:22:09 -0400 Subject: [PATCH] Use rectangular matrices in FullMatrix tests. This catches more bugs. --- tests/full_matrix/full_matrix_common.h | 68 +++++++++++++++++++++----- 1 file changed, 56 insertions(+), 12 deletions(-) diff --git a/tests/full_matrix/full_matrix_common.h b/tests/full_matrix/full_matrix_common.h index 394e360193..62d55ae0ca 100644 --- a/tests/full_matrix/full_matrix_common.h +++ b/tests/full_matrix/full_matrix_common.h @@ -34,43 +34,87 @@ template void check (); +static constexpr int n_rows = 5; +static constexpr int n_cols = 4; + + +template +void make_square_matrix (FullMatrix &m) +{ + m.reinit (n_rows, n_rows); + for (unsigned int i=0; i void make_matrix (FullMatrix &m) { - m.reinit (5,5); - for (unsigned int i=0; i<5; ++i) - for (unsigned int j=0; j<5; ++j) + m.reinit (n_rows, n_cols); + for (unsigned int i=0; i +void make_complex_square_matrix (FullMatrix > &m) +{ + m.reinit (n_rows, n_rows); + for (unsigned int i=0; i((i+1)*(j+2), (i+3)*(j+4)); +} + + template void make_complex_matrix (FullMatrix > &m) { - m.reinit (5,5); - for (unsigned int i=0; i<5; ++i) - for (unsigned int j=0; j<5; ++j) + m.reinit (n_rows, n_cols); + for (unsigned int i=0; i((i+1)*(j+2), (i+3)*(j+4)); } template -void make_vector (Vector &v) +void make_domain_vector (Vector &v) +{ + v.reinit (n_cols); + for (unsigned int i=0; i +void make_range_vector (Vector &v) { - v.reinit (5); - for (unsigned int i=0; i<5; ++i) + v.reinit (n_rows); + for (unsigned int i=0; i -void make_complex_vector (Vector > &v) +void make_complex_domain_vector (Vector > &v) +{ + v.reinit (n_cols); + for (unsigned int i=0; i(i+1, i+3); +} + + + + +template +void make_complex_range_vector (Vector > &v) { - v.reinit (5); - for (unsigned int i=0; i<5; ++i) + v.reinit (n_rows); + for (unsigned int i=0; i(i+1, i+3); } -- 2.39.5