// iterator for an empty line (what
// would it point to?)
Assert(ncols != 0, ExcInternalError());
+# ifdef DEBUG
+ for (PetscInt j = 0; j < ncols; ++j)
+ {
+ const auto column = static_cast<PetscInt>(colnums[j]);
+ AssertIntegerConversion(column, colnums[j]);
+ }
+# endif
colnum_cache =
std::make_shared<std::vector<size_type>>(colnums, colnums + ncols);
value_cache =
{
assert_is_compressed();
- // now set all the entries of these rows
- // to zero
+ // now set all the entries of these rows to zero
+# ifdef DEBUG
+ for (size_type i = 0; i < rows.size(); ++i)
+ {
+ const auto row = static_cast<PetscInt>(rows[i]);
+ AssertIntegerConversion(row, rows[i]);
+ }
+# endif
const std::vector<PetscInt> petsc_rows(rows.begin(), rows.end());
// call the functions. note that we have
{
assert_is_compressed();
- // now set all the entries of these rows
- // to zero
+ // now set all the entries of these rows to zero
+# ifdef DEBUG
+ for (size_type i = 0; i < rows.size(); ++i)
+ {
+ const auto row = static_cast<PetscInt>(rows[i]);
+ AssertIntegerConversion(row, rows[i]);
+ }
+# endif
const std::vector<PetscInt> petsc_rows(rows.begin(), rows.end());
// call the functions. note that we have
PetscScalar
MatrixBase::el(const size_type i, const size_type j) const
{
- PetscInt petsc_i = i, petsc_j = j;
+ const auto petsc_i = static_cast<PetscInt>(i);
+ AssertIntegerConversion(petsc_i, i);
+ const auto petsc_j = static_cast<PetscInt>(j);
+ AssertIntegerConversion(petsc_j, j);
PetscScalar value;