* significantly more efficient to
* get memory allocation right from
* the start.
- *
- * Despite the fact that it would
- * seem to be an obvious win, setting
- * the @p preset_nonzero_locations
- * flag to @p true doesn't seem to
- * accelerate program. Rather on the
- * contrary, it seems to be able to
- * slow down entire programs
- * somewhat. This is suprising, since
- * we can use efficient function
- * calls into PETSc that allow to
- * create multiple entries at once;
- * nevertheless, given the fact that
- * it is inefficient, the respective
- * flag has a default value equal to
- * @p false.
*/
template <typename SparsityType>
SparseMatrix (const SparsityType &sparsity_pattern,
&row_values[0], INSERT_VALUES);
}
compress ();
- }
-
// In the end, tell the matrix that
// it should not expect any new
// entries.
#if (PETSC_VERSION_MAJOR <= 2)
- const int ierr =
- MatSetOption (matrix, MAT_NO_NEW_NONZERO_LOCATIONS);
+ const int ierr =
+ MatSetOption (matrix, MAT_NO_NEW_NONZERO_LOCATIONS);
#else
- const int ierr =
- MatSetOption (matrix, MAT_NEW_NONZERO_LOCATIONS, PETSC_FALSE);
+ const int ierr =
+ MatSetOption (matrix, MAT_NEW_NONZERO_LOCATIONS, PETSC_FALSE);
#endif
- AssertThrow (ierr == 0, ExcPETScError(ierr));
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+ }
}