From: bangerth Date: Wed, 27 Mar 2013 13:03:14 +0000 (+0000) Subject: Add an assertion. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc485cd303b409c3112c6552b985baaf593f3ed2;p=dealii-svn.git Add an assertion. git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29068 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h b/deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h index 76b6a32d0f..fd4079e289 100644 --- a/deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h +++ b/deal.II/include/deal.II/lac/trilinos_sparsity_pattern.h @@ -1647,6 +1647,18 @@ namespace TrilinosWrappers if (begin == end) return; + // verify that the size of the data type Trilinos expects matches that the + // iterator points to. we allow for some slippage between signed and + // unsigned and only compare that they are both eiter 32 or 64 bit. to + // write this test properly, not that we cannot compare the size of + // '*begin' because 'begin' may be an iterator and '*begin' may be an + // accessor class. consequently, we need to somehow get an actual value + // from it which we can by evaluating an expression such as when + // multiplying the value produced by 2 + Assert (sizeof(TrilinosWrappers::types::int_type) == + sizeof((*begin)*2), + ExcNotImplemented()); + TrilinosWrappers::types::int_type *col_index_ptr = (TrilinosWrappers::types::int_type *)(&*begin); const int n_cols = static_cast(end - begin);