virtual void apply_to_subrange (const std::size_t begin,
const std::size_t end) const
{
- // for classes trivial assignment can use memcpy
+ // for classes trivial assignment can use memcpy. cast element to
+ // (void*) to silence compiler warning for virtual classes (they will
+ // never arrive here because they are non-trivial).
+
if (std_cxx1x::is_trivial<T>::value == true)
- std::memcpy (destination_+begin, source_+begin, (end-begin)*sizeof(T));
+ std::memcpy ((void*)(destination_+begin), source_+begin,
+ (end-begin)*sizeof(T));
else if (copy_only_ == false)
for (std::size_t i=begin; i<end; ++i)
{
if (std_cxx1x::is_trivial<T>::value == true)
{
const unsigned char zero [sizeof(T)] = {};
- if (std::memcmp(zero, &element, sizeof(T)) == 0)
+ // cast element to (void*) to silence compiler warning for virtual
+ // classes (they will never arrive here because they are
+ // non-trivial).
+ if (std::memcmp(zero, (void*)&element, sizeof(T)) == 0)
trivial_element = true;
}
if (size < minimum_parallel_grain_size)
virtual void apply_to_subrange (const std::size_t begin,
const std::size_t end) const
{
- // for classes with trivial assignment of zero can use memset
+ // for classes with trivial assignment of zero can use memset. cast
+ // element to (void*) to silence compiler warning for virtual
+ // classes (they will never arrive here because they are
+ // non-trivial).
if (std_cxx1x::is_trivial<T>::value == true && trivial_element)
- std::memset (destination_+begin, 0, (end-begin)*sizeof(T));
+ std::memset ((void*)(destination_+begin), 0, (end-begin)*sizeof(T));
else
// initialize memory and set
for (std::size_t i=begin; i<end; ++i)
std::size_t memory_consumption () const;
//@}
+ /**
+ * Exception
+ */
+ DeclException3 (ExcNonMatchingElements,
+ double, double, unsigned int,
+ << "Called compress(VectorOperation::insert), but"
+ << " the element received from a remote processor, value "
+ << std::setprecision(16) << arg1
+ << ", does not match with the value "
+ << std::setprecision(16) << arg2
+ << " on the owner processor " << arg3);
+
private:
/**
* Local part of all_zero().
std::abs(local_element(j) - *read_position) <
std::abs(local_element(j)) * 1000. *
std::numeric_limits<Number>::epsilon(),
- ExcMessage("Inserted elements do not match."));
+ ExcNonMatchingElements(*read_position, local_element(j),
+ part.this_mpi_process()));
AssertDimension(read_position-import_data,part.n_import_indices());
}