From: Doug Shi-Dong Date: Fri, 19 Jun 2020 16:34:35 +0000 (-0400) Subject: Update Trilinos Matrix::clear_rows 2nd arg test. X-Git-Tag: v9.3.0-rc1~1396^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10463%2Fhead;p=dealii.git Update Trilinos Matrix::clear_rows 2nd arg test. --- diff --git a/tests/trilinos/69.cc b/tests/trilinos/69.cc index d715a11134..3ca148d159 100644 --- a/tests/trilinos/69.cc +++ b/tests/trilinos/69.cc @@ -72,8 +72,8 @@ test(TrilinosWrappers::SparseMatrix &m) Assert(m.n_nonzero_elements() - nnz == 0, ExcInternalError()); // now remove the entries of rows N/2 and - // N/3. set diagonal entries to rnd - const double rnd = Testing::rand(); + // N/3. set diagonal entries to diag + const double diag = Testing::rand(); for (unsigned int i = 0; i < N; ++i) { const double s = m.el(N / 2, i); @@ -84,10 +84,14 @@ test(TrilinosWrappers::SparseMatrix &m) const double s = m.el(N / 3, i); norm_sqr -= s * s; } - norm_sqr += 2 * rnd * rnd; + norm_sqr += 2 * diag * diag; - const types::global_dof_index rows[2] = {N / 3, N / 2}; - m.clear_rows(std::vector(&rows[0], &rows[2]), rnd); + const std::vector rows = {N / 3, N / 2}; + m.clear_rows(rows, diag); + for (const auto row : rows) + { + Assert(m.el(row, row) == diag, ExcInternalError()); + } deallog << m.frobenius_norm() << ' ' << std::sqrt(norm_sqr) << std::endl; deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl; diff --git a/tests/trilinos/69.output b/tests/trilinos/69.output index d14aebb0a1..615e171a2c 100644 --- a/tests/trilinos/69.output +++ b/tests/trilinos/69.output @@ -1,6 +1,6 @@ DEAL::7.15267e+09 7.15267e+09 DEAL::32 32 -DEAL::6.82410e+09 6.96580e+09 +DEAL::6.96580e+09 6.96580e+09 DEAL::32 32 DEAL::OK