* Swaps the given vector with the calling vector.
*/
void
- swap(AlignedVector<T> &vec);
+ swap(AlignedVector<T> &vec) noexcept;
/**
* Return whether the vector is empty, i.e., its size is zero.
template <class T>
inline void
-AlignedVector<T>::swap(AlignedVector<T> &vec)
+AlignedVector<T>::swap(AlignedVector<T> &vec) noexcept
{
// Swap the data in the 'elements' objects. Then also make sure that
// their respective deleter objects point to the right place.
* @relatesalso ArrayView
*/
template <typename Iterator, typename MemorySpaceType = MemorySpace::Host>
-ArrayView<typename std::remove_reference<
- typename std::iterator_traits<Iterator>::reference>::type,
- MemorySpaceType>
+ArrayView<
+ std::remove_reference_t<typename std::iterator_traits<Iterator>::reference>,
+ MemorySpaceType>
make_array_view(const Iterator begin, const Iterator end)
{
static_assert(
Assert(internal::ArrayViewHelper::is_contiguous(begin, end),
ExcMessage("The provided range isn't contiguous in memory!"));
// the reference type, not the value type, knows the constness of the iterator
- return ArrayView<typename std::remove_reference<
- typename std::iterator_traits<Iterator>::reference>::type,
- MemorySpaceType>(std::addressof(*begin), end - begin);
+ return ArrayView<
+ std::remove_reference_t<typename std::iterator_traits<Iterator>::reference>,
+ MemorySpaceType>(std::addressof(*begin), end - begin);
}
* Constructor from a Trilinos Teuchos::RCP<Tpetra::Map>.
*/
explicit IndexSet(
- Teuchos::RCP<const Tpetra::Map<int, types::signed_global_dof_index>> map);
+ const Teuchos::RCP<const Tpetra::Map<int, types::signed_global_dof_index>>
+ &map);
# endif // DEAL_II_TRILINOS_WITH_TPETRA
/**
*/
template <typename T, typename MemorySpace>
inline void
- swap(MemorySpaceData<T, MemorySpace> &u, MemorySpaceData<T, MemorySpace> &v);
+ swap(MemorySpaceData<T, MemorySpace> &u,
+ MemorySpaceData<T, MemorySpace> &v) noexcept;
#ifndef DOXYGEN
*/
template <typename T, typename MemorySpace>
inline void
- swap(MemorySpaceData<T, MemorySpace> &u, MemorySpaceData<T, MemorySpace> &v)
+ swap(MemorySpaceData<T, MemorySpace> &u,
+ MemorySpaceData<T, MemorySpace> &v) noexcept
{
std::swap(u.values_host_buffer, v.values_host_buffer);
std::swap(u.values, v.values);
* functions.
*/
void
- swap(TableBase<N, T> &v);
+ swap(TableBase<N, T> &v) noexcept;
/**
* Determine an estimate for the memory consumption (in bytes) of this
/**
* Type of the stored pointer to the table.
*/
- using container_pointer_type = typename std::
- conditional<Constness, const TableType *, TableType *>::type;
+ using container_pointer_type =
+ std::conditional_t<Constness, const TableType *, TableType *>;
/**
* Value type of the underlying container.
/**
* Type of the stored pointer to the table.
*/
- using container_pointer_type = typename std::
- conditional<Constness, const TableType *, TableType *>::type;
+ using container_pointer_type =
+ std::conditional_t<Constness, const TableType *, TableType *>;
/**
* Constructor from an accessor.
template <int N, typename T>
inline void
-TableBase<N, T>::swap(TableBase<N, T> &v)
+TableBase<N, T>::swap(TableBase<N, T> &v) noexcept
{
values.swap(v.values);
std::swap(table_size, v.table_size);
*/
template <int N, typename T>
inline void
-swap(TableBase<N, T> &u, TableBase<N, T> &v)
+swap(TableBase<N, T> &u, TableBase<N, T> &v) noexcept
{
u.swap(v);
}
class ThreadLocalStorage
{
static_assert(
- std::is_copy_constructible<
- typename internal::unpack_container<T>::type>::value ||
+ std::is_copy_constructible_v<
+ typename internal::unpack_container<T>::type> ||
std::is_default_constructible_v<T>,
"The stored type must be either copyable, or default constructible");
std::enable_if_t<
std::is_floating_point_v<ScalarType> ||
(boost::is_complex<ScalarType>::value &&
- std::is_floating_point<
- typename internal::RemoveComplexWrapper<ScalarType>::type>::value)>>
+ std::is_floating_point_v<
+ typename internal::RemoveComplexWrapper<ScalarType>::type>)>>
{
/**
* The type of taping used
/**
* The actual auto-differentiable number type
*/
- using ad_type = typename std::
- conditional<is_real_valued, real_type, complex_type>::type;
+ using ad_type =
+ std::conditional_t<is_real_valued, real_type, complex_type>;
/**
* The actual auto-differentiable number directional derivative type
std::enable_if_t<
std::is_floating_point_v<ScalarType> ||
(boost::is_complex<ScalarType>::value &&
- std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>>::is_taped =
+ std::is_floating_point_v<typename internal::RemoveComplexWrapper<
+ ScalarType>::type>)>>::is_taped =
internal::ADNumberInfoFromEnum<
typename internal::RemoveComplexWrapper<ScalarType>::type,
ADNumberTypeCode>::is_taped;
std::enable_if_t<
std::is_floating_point_v<ScalarType> ||
(boost::is_complex<ScalarType>::value &&
- std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>>::is_tapeless =
+ std::is_floating_point_v<typename internal::RemoveComplexWrapper<
+ ScalarType>::type>)>>::is_tapeless =
!(NumberTraits<ScalarType, ADNumberTypeCode>::is_taped);
std::enable_if_t<
std::is_floating_point_v<ScalarType> ||
(boost::is_complex<ScalarType>::value &&
- std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>>::is_real_valued =
+ std::is_floating_point_v<typename internal::RemoveComplexWrapper<
+ ScalarType>::type>)>>::is_real_valued =
(!boost::is_complex<ScalarType>::value);
std::enable_if_t<
std::is_floating_point_v<ScalarType> ||
(boost::is_complex<ScalarType>::value &&
- std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>>::is_complex_valued =
+ std::is_floating_point_v<typename internal::RemoveComplexWrapper<
+ ScalarType>::type>)>>::is_complex_valued =
!(NumberTraits<ScalarType, ADNumberTypeCode>::is_real_valued);
std::enable_if_t<
std::is_floating_point_v<ScalarType> ||
(boost::is_complex<ScalarType>::value &&
- std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>>::n_supported_derivative_levels =
+ std::is_floating_point_v<typename internal::RemoveComplexWrapper<
+ ScalarType>::type>)>>::n_supported_derivative_levels =
internal::ADNumberInfoFromEnum<
typename internal::RemoveComplexWrapper<ScalarType>::type,
ADNumberTypeCode>::n_supported_derivative_levels;
std::enable_if_t<
std::is_floating_point_v<ScalarType> ||
(boost::is_complex<ScalarType>::value &&
- std::is_floating_point<
- typename internal::RemoveComplexWrapper<ScalarType>::type>::value)>>
+ std::is_floating_point_v<
+ typename internal::RemoveComplexWrapper<ScalarType>::type>)>>
{
/**
* The internal number type code.
std::enable_if_t<
std::is_floating_point_v<ScalarType> ||
(boost::is_complex<ScalarType>::value &&
- std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>>::is_taped = false;
+ std::is_floating_point_v<typename internal::RemoveComplexWrapper<
+ ScalarType>::type>)>>::is_taped = false;
template <typename ScalarType>
std::enable_if_t<
std::is_floating_point_v<ScalarType> ||
(boost::is_complex<ScalarType>::value &&
- std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>>::is_tapeless = false;
+ std::is_floating_point_v<typename internal::RemoveComplexWrapper<
+ ScalarType>::type>)>>::is_tapeless = false;
template <typename ScalarType>
std::enable_if_t<
std::is_floating_point_v<ScalarType> ||
(boost::is_complex<ScalarType>::value &&
- std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>>::is_real_valued =
+ std::is_floating_point_v<typename internal::RemoveComplexWrapper<
+ ScalarType>::type>)>>::is_real_valued =
(!boost::is_complex<ScalarType>::value);
std::enable_if_t<
std::is_floating_point_v<ScalarType> ||
(boost::is_complex<ScalarType>::value &&
- std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>>::is_complex_valued =
+ std::is_floating_point_v<typename internal::RemoveComplexWrapper<
+ ScalarType>::type>)>>::is_complex_valued =
!(NumberTraits<ScalarType, NumberTypes::none>::is_real_valued);
std::enable_if_t<
std::is_floating_point_v<ScalarType> ||
(boost::is_complex<ScalarType>::value &&
- std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>>::n_supported_derivative_levels = 0;
+ std::is_floating_point_v<typename internal::RemoveComplexWrapper<
+ ScalarType>::type>)>>::n_supported_derivative_levels = 0;
# else
{
static const bool is_supported = true;
- using ReturnType = typename std::
- conditional<std::is_same_v<ReturnType_, float>, float, double>::type;
+ using ReturnType =
+ std::conditional_t<std::is_same_v<ReturnType_, float>, float, double>;
};
struct LLVMOptimizer<ReturnType_,
std::enable_if_t<std::is_arithmetic_v<ReturnType_>>>
{
- using ReturnType = typename std::
- conditional<std::is_same_v<ReturnType_, float>, float, double>::type;
+ using ReturnType =
+ std::conditional_t<std::is_same_v<ReturnType_, float>, float, double>;
using OptimizerType =
std::conditional_t<std::is_same_v<ReturnType_, float>,
SymEngine::LLVMFloatVisitor,
// Serialize enum classes...
{
const auto m =
- static_cast<typename std::underlying_type<OptimizerType>::type>(
- method);
+ static_cast<std::underlying_type_t<OptimizerType>>(method);
ar &m;
}
{
const auto f =
- static_cast<typename std::underlying_type<OptimizationFlags>::type>(
- flags);
+ static_cast<std::underlying_type_t<OptimizationFlags>>(flags);
ar &f;
}
// Deserialize enum classes...
{
- typename std::underlying_type<OptimizerType>::type m;
- ar &m;
+ std::underlying_type_t<OptimizerType> m;
+ ar &m;
method = static_cast<OptimizerType>(m);
}
{
- typename std::underlying_type<OptimizationFlags>::type f;
- ar &f;
+ std::underlying_type_t<OptimizationFlags> f;
+ ar &f;
flags = static_cast<OptimizationFlags>(f);
}
* Swap function.
*/
friend void
- swap(ConstraintLine &l1, ConstraintLine &l2)
+ swap(ConstraintLine &l1, ConstraintLine &l2) noexcept
{
std::swap(l1.index, l2.index);
std::swap(l1.entries, l2.entries);
* Swap the contents of these two objects.
*/
void
- swap(BlockIndices &b);
+ swap(BlockIndices &b) noexcept;
/**
* Determine an estimate for the memory consumption (in bytes) of this
inline void
-BlockIndices::swap(BlockIndices &b)
+BlockIndices::swap(BlockIndices &b) noexcept
{
std::swap(n_blocks, b.n_blocks);
std::swap(start_indices, b.start_indices);
* @relatesalso BlockIndices
*/
inline void
-swap(BlockIndices &u, BlockIndices &v)
+swap(BlockIndices &u, BlockIndices &v) noexcept
{
u.swap(v);
}
* <tt>u.swap(v)</tt>, again in analogy to standard functions.
*/
void
- swap(BlockVector<Number> &v);
+ swap(BlockVector<Number> &v) noexcept;
/**
* Print to a stream.
*/
template <typename Number>
inline void
-swap(BlockVector<Number> &u, BlockVector<Number> &v)
+swap(BlockVector<Number> &u, BlockVector<Number> &v) noexcept
{
u.swap(v);
}
template <typename Number>
void
-BlockVector<Number>::swap(BlockVector<Number> &v)
+BlockVector<Number>::swap(BlockVector<Number> &v) noexcept
{
std::swap(this->components, v.components);
* std::complex.
*/
static_assert(
- std::is_arithmetic<
- typename numbers::NumberTraits<number>::real_type>::value,
+ std::is_arithmetic_v<typename numbers::NumberTraits<number>::real_type>,
"The FullMatrix class only supports basic numeric types. In particular, it "
"does not support automatically differentiated numbers.");
* functions.
*/
void
- swap(BlockVector<Number> &v);
+ swap(BlockVector<Number> &v) noexcept;
/** @} */
/**
template <typename Number>
inline void
swap(LinearAlgebra::distributed::BlockVector<Number> &u,
- LinearAlgebra::distributed::BlockVector<Number> &v)
+ LinearAlgebra::distributed::BlockVector<Number> &v) noexcept
{
u.swap(v);
}
template <typename Number>
inline void
- BlockVector<Number>::swap(BlockVector<Number> &v)
+ BlockVector<Number>::swap(BlockVector<Number> &v) noexcept
{
Assert(this->n_blocks() == v.n_blocks(),
ExcDimensionMismatch(this->n_blocks(), v.n_blocks()));
* analogy to standard functions.
*/
void
- swap(Vector<Number, MemorySpace> &v);
+ swap(Vector<Number, MemorySpace> &v) noexcept;
/**
* Move assignment operator.
template <typename Number, typename MemorySpace>
inline void
swap(LinearAlgebra::distributed::Vector<Number, MemorySpace> &u,
- LinearAlgebra::distributed::Vector<Number, MemorySpace> &v)
+ LinearAlgebra::distributed::Vector<Number, MemorySpace> &v) noexcept
{
u.swap(v);
}
template <typename Number, typename MemorySpaceType>
void
- Vector<Number, MemorySpaceType>::swap(Vector<Number, MemorySpaceType> &v)
+ Vector<Number, MemorySpaceType>::swap(
+ Vector<Number, MemorySpaceType> &v) noexcept
{
#ifdef DEAL_II_WITH_MPI
const LinearOperator<Range, Domain, Payload> &op)
{
static_assert(
- std::is_convertible<typename Range::value_type,
- typename Domain::value_type>::value,
+ std::is_convertible_v<typename Range::value_type,
+ typename Domain::value_type>,
"Range and Domain must have implicitly convertible 'value_type's");
if (op.is_null_operator)
typename Domain::value_type number)
{
static_assert(
- std::is_convertible<typename Range::value_type,
- typename Domain::value_type>::value,
+ std::is_convertible_v<typename Range::value_type,
+ typename Domain::value_type>,
"Range and Domain must have implicitly convertible 'value_type's");
return number * op;
* analogy to standard functions.
*/
void
- swap(ReadWriteVector<Number> &v);
+ swap(ReadWriteVector<Number> &v) noexcept;
/**
* Copies the data and the IndexSet of the input vector @p in_vector.
template <typename Number>
inline void
swap(LinearAlgebra::ReadWriteVector<Number> &u,
- LinearAlgebra::ReadWriteVector<Number> &v)
+ LinearAlgebra::ReadWriteVector<Number> &v) noexcept
{
u.swap(v);
}
template <typename Number>
void
- ReadWriteVector<Number>::swap(ReadWriteVector<Number> &v)
+ ReadWriteVector<Number>::swap(ReadWriteVector<Number> &v) noexcept
{
std::swap(stored_elements, v.stored_elements);
std::swap(values, v.values);
* functions.
*/
void
- swap(BlockVector &v);
+ swap(BlockVector &v) noexcept;
/**
* Print to a stream.
inline void
- BlockVector::swap(BlockVector &v)
+ BlockVector::swap(BlockVector &v) noexcept
{
std::swap(this->components, v.components);
* @relatesalso TrilinosWrappers::MPI::BlockVector
*/
inline void
- swap(BlockVector &u, BlockVector &v)
+ swap(BlockVector &u, BlockVector &v) noexcept
{
u.swap(v);
}
const TrilinosWrappers::types::int_type *col_index_ptr_begin =
reinterpret_cast<TrilinosWrappers::types::int_type *>(
- const_cast<typename std::decay<decltype(*begin)>::type *>(&*begin));
+ const_cast<std::decay_t<decltype(*begin)> *>(&*begin));
const TrilinosWrappers::types::int_type *col_index_ptr_end =
reinterpret_cast<TrilinosWrappers::types::int_type *>(
- const_cast<typename std::decay<decltype(*end)>::type *>(&*end));
+ const_cast<std::decay_t<decltype(*end)> *>(&*end));
// Check at least for the first index that the conversion actually works
AssertDimension(*col_index_ptr_begin, *begin);
* handle memory separately.
*/
virtual void
- swap(Vector &v);
+ swap(Vector &v) noexcept;
/**
* Extract a range of elements all at once.
template <typename Number, typename MemorySpace>
inline void
- swap(Vector<Number, MemorySpace> &u, Vector<Number, MemorySpace> &v)
+ swap(Vector<Number, MemorySpace> &u,
+ Vector<Number, MemorySpace> &v) noexcept
{
u.swap(v);
}
template <typename Number, typename MemorySpace>
inline void
- Vector<Number, MemorySpace>::swap(Vector<Number, MemorySpace> &v)
+ Vector<Number, MemorySpace>::swap(Vector<Number, MemorySpace> &v) noexcept
{
vector.swap(v.vector);
}
* analogy to standard functions.
*/
void
- swap(Vector &v);
+ swap(Vector &v) noexcept;
/**
* Estimate for the memory consumption in bytes.
* @relatesalso TrilinosWrappers::MPI::Vector
*/
inline void
- swap(Vector &u, Vector &v)
+ swap(Vector &u, Vector &v) noexcept
{
u.swap(v);
}
* std::complex.
*/
static_assert(
- std::is_arithmetic<
- typename numbers::NumberTraits<Number>::real_type>::value,
+ std::is_arithmetic_v<typename numbers::NumberTraits<Number>::real_type>,
"The Vector class only supports basic numeric types. In particular, it "
"does not support automatically differentiated numbers.");
* memory separately.
*/
virtual void
- swap(Vector<Number> &v);
+ swap(Vector<Number> &v) noexcept;
/**
* Set all components of the vector to the given number @p s.
// swap virtual.
template <typename Number>
inline void
-Vector<Number>::swap(Vector<Number> &v)
+Vector<Number>::swap(Vector<Number> &v) noexcept
{
values.swap(v.values);
std::swap(thread_loop_partitioner, v.thread_loop_partitioner);
*/
template <typename Number>
inline void
-swap(Vector<Number> &u, Vector<Number> &v)
+swap(Vector<Number> &u, Vector<Number> &v) noexcept
{
u.swap(v);
}
// the batch to the corresponding data structure.
const unsigned int n_faces =
matrix_free.n_active_entries_per_face_batch(face);
- face_batch_id_n_faces.emplace_back(
- std::make_pair(face, n_faces));
+ face_batch_id_n_faces.emplace_back(face, n_faces);
// Append the quadrature points to the points we need to search
// for.
* If value type of matrix and constrains equals, return a reference
* to the given AffineConstraint instance.
*/
- template <typename MatrixType,
- typename Number,
- std::enable_if_t<std::is_same_v<
- typename std::remove_const<typename std::remove_reference<
- typename MatrixType::value_type>::type>::type,
- typename std::remove_const<typename std::remove_reference<
- Number>::type>::type>> * = nullptr>
+ template <
+ typename MatrixType,
+ typename Number,
+ std::enable_if_t<std::is_same_v<
+ std::remove_const_t<
+ std::remove_reference_t<typename MatrixType::value_type>>,
+ std::remove_const_t<std::remove_reference_t<Number>>>> * = nullptr>
const AffineConstraints<typename MatrixType::value_type> &
create_new_affine_constraints_if_needed(
const MatrixType &,
* AffineConstraint instance with the value type of the matrix is
* created and a reference to it is returned.
*/
- template <typename MatrixType,
- typename Number,
- std::enable_if_t<!std::is_same_v<
- typename std::remove_const<typename std::remove_reference<
- typename MatrixType::value_type>::type>::type,
- typename std::remove_const<typename std::remove_reference<
- Number>::type>::type>> * = nullptr>
+ template <
+ typename MatrixType,
+ typename Number,
+ std::enable_if_t<!std::is_same_v<
+ std::remove_const_t<
+ std::remove_reference_t<typename MatrixType::value_type>>,
+ std::remove_const_t<std::remove_reference_t<Number>>>> * = nullptr>
const AffineConstraints<typename MatrixType::value_type> &
create_new_affine_constraints_if_needed(
const MatrixType &,
# ifdef DEAL_II_TRILINOS_WITH_TPETRA
IndexSet::IndexSet(
- Teuchos::RCP<const Tpetra::Map<int, types::signed_global_dof_index>> map)
+ const Teuchos::RCP<const Tpetra::Map<int, types::signed_global_dof_index>>
+ &map)
: is_compressed(true)
, index_space_size(1 + map->getMaxAllGlobalIndex())
, largest_range(numbers::invalid_unsigned_int)
Assert(SE::is_a_Boolean(entry.first.get_value()),
ExcMessage(
"The conditional expression must return a boolean type."));
- piecewise_function.push_back(
- {entry.second.get_RCP(),
- SE::rcp_static_cast<const SE::Boolean>(entry.first.get_RCP())});
+ piecewise_function.emplace_back(
+ entry.second.get_RCP(),
+ SE::rcp_static_cast<const SE::Boolean>(entry.first.get_RCP()));
}
// Add default value
- piecewise_function.push_back(
- {expression_otherwise.get_RCP(), SE::boolTrue});
+ piecewise_function.emplace_back(expression_otherwise.get_RCP(),
+ SE::boolTrue);
// Initialize
- expression = SE::piecewise(std::move(piecewise_function));
+ expression = SE::piecewise(piecewise_function);
}
SD::types::symbol_vector symb_vec;
symb_vec.reserve(symbol_vector.size());
for (const auto &entry : symbol_vector)
- symb_vec.push_back(SD::Expression(entry));
+ symb_vec.emplace_back(entry);
return symb_vec;
}
for (auto &pair : face_side_sets)
{
Assert(pair.second.size() > 0, ExcInternalError());
- face_id_to_side_sets.push_back(std::move(pair));
+ face_id_to_side_sets.emplace_back(std::move(pair));
}
// sort by side sets:
ArborXWrappers::DistributedTree distributed_tree(
comm, global_bboxes[0]);
std::vector<BoundingBox<spacedim>> query_bounding_boxes;
+ query_bounding_boxes.reserve(entities.size());
for (const auto &entity : entities)
query_bounding_boxes.emplace_back(
BoundingBox<spacedim>(entity).create_extended(tolerance));
void
- Vector::swap(Vector &v)
+ Vector::swap(Vector &v) noexcept
{
std::swap(last_action, v.last_action);
std::swap(compressed, v.compressed);