Reference documentation for deal.II version Git d902c8c1aa 2019-12-15 00:36:45 -0500
Public Member Functions | List of all members
internal::AlignedVectorCopy< T > Class Template Reference

#include <deal.II/base/aligned_vector.h>

Inheritance diagram for internal::AlignedVectorCopy< T >:

Public Member Functions

 AlignedVectorCopy (const T *const source_begin, const T *const source_end, T *const destination)
virtual void apply_to_subrange (const std::size_t begin, const std::size_t end) const override

Additional Inherited Members

- Private Member Functions inherited from parallel::ParallelForInteger
virtual ~ParallelForInteger ()=default
void apply_parallel (const std::size_t begin, const std::size_t end, const std::size_t minimum_parallel_grain_size) const

Detailed Description

template<typename T>
class internal::AlignedVectorCopy< T >

A class that actually issues the copy commands in AlignedVector. This class is based on the specialized for loop base class ParallelForLoop in parallel.h whose purpose is the following: When calling a parallel for loop on AlignedVector with apply_to_subranges, it generates different code for every different argument we might choose (as it is templated). This gives a lot of code (e.g. it triples the memory required for compiling the file and the final object size is several times larger) which is completely useless. Therefore, this class channels all copy commands through one call to apply_to_subrange for all possible types, which makes the copy operation much cleaner (thanks to a virtual function, whose cost is negligible in this context).

Definition at line 375 of file aligned_vector.h.

Constructor & Destructor Documentation

◆ AlignedVectorCopy()

template<typename T >
internal::AlignedVectorCopy< T >::AlignedVectorCopy ( const T *const  source_begin,
const T *const  source_end,
T *const  destination 

Constructor. Issues a parallel call if there are sufficiently many elements, otherwise works in serial. Copies the data from the half-open interval between source_begin and source_end to array starting at destination (by calling the copy constructor with placement new).

The elements from the source array are simply copied via the placement new copy constructor.

Definition at line 390 of file aligned_vector.h.

Member Function Documentation

◆ apply_to_subrange()

template<typename T >
virtual void internal::AlignedVectorCopy< T >::apply_to_subrange ( const std::size_t  begin,
const std::size_t  end 
) const

This method moves elements from the source to the destination given in the constructor on a subrange given by two integers.

Implements parallel::ParallelForInteger.

Definition at line 411 of file aligned_vector.h.

The documentation for this class was generated from the following file: