n_columns = 0;
for (unsigned int j=0; j<n_cols; ++j)
{
- const double value = values[j];
+ const PetscScalar value = values[j];
Assert (numbers::is_finite(value),
ExcMessage("The given value is not finite but either "
"infinite or Not A Number (NaN)"));
- if (value != 0)
+ if (value != PetscScalar())
{
column_indices[n_columns] = col_indices[j];
column_values[n_columns] = value;
ExcMessage("The given value is not finite but either "
"infinite or Not A Number (NaN)"));
- if (value == 0)
+ if (value == PetscScalar())
{
// we have to do checkings on Insert/Add
// in any case
n_columns = 0;
for (unsigned int j=0; j<n_cols; ++j)
{
- const double value = values[j];
+ const PetscScalar value = values[j];
Assert (numbers::is_finite(value),
ExcMessage("The given value is not finite but either "
"infinite or Not A Number (NaN)"));
- if (value != 0)
+ if (value != PetscScalar())
{
column_indices[n_columns] = col_indices[j];
column_values[n_columns] = value;
// PETScWrappers::MPI::Vector), but we
// can save some work if the addend is
// zero
- if (value == 0)
+ if (value == PetscScalar())
return *this;
// use the PETSc function to add something
// PETScWrappers::MPI::Vector), but we
// can save some work if the addend is
// zero
- if (value == 0)
+ if (value == PetscScalar())
return *this;
// use the PETSc function to add something