* @relatesalso ProductType
*/
template <typename T, typename U>
-inline typename std::enable_if<
+inline std::enable_if_t<
std::is_floating_point<T>::value && std::is_floating_point<U>::value,
- typename ProductType<std::complex<T>, std::complex<U>>::type>::type
+ typename ProductType<std::complex<T>, std::complex<U>>::type>
operator*(const std::complex<T> &left, const std::complex<U> &right)
{
using result_type =
* @relatesalso ProductType
*/
template <typename T, typename U>
-inline typename std::enable_if<
+inline std::enable_if_t<
std::is_floating_point<T>::value && std::is_floating_point<U>::value,
- typename ProductType<std::complex<T>, std::complex<U>>::type>::type
+ typename ProductType<std::complex<T>, std::complex<U>>::type>
operator/(const std::complex<T> &left, const std::complex<U> &right)
{
using result_type =
* @relatesalso ProductType
*/
template <typename T, typename U>
-inline
- typename std::enable_if<std::is_floating_point<T>::value &&
- std::is_floating_point<U>::value,
- typename ProductType<std::complex<T>, U>::type>::type
- operator*(const std::complex<T> &left, const U &right)
+inline std::enable_if_t<std::is_floating_point<T>::value &&
+ std::is_floating_point<U>::value,
+ typename ProductType<std::complex<T>, U>::type>
+operator*(const std::complex<T> &left, const U &right)
{
using result_type = typename ProductType<std::complex<T>, U>::type;
return static_cast<result_type>(left) * static_cast<result_type>(right);
* @relatesalso ProductType
*/
template <typename T, typename U>
-inline
- typename std::enable_if<std::is_floating_point<T>::value &&
- std::is_floating_point<U>::value,
- typename ProductType<std::complex<T>, U>::type>::type
- operator/(const std::complex<T> &left, const U &right)
+inline std::enable_if_t<std::is_floating_point<T>::value &&
+ std::is_floating_point<U>::value,
+ typename ProductType<std::complex<T>, U>::type>
+operator/(const std::complex<T> &left, const U &right)
{
using result_type = typename ProductType<std::complex<T>, U>::type;
return static_cast<result_type>(left) / static_cast<result_type>(right);
* @relatesalso ProductType
*/
template <typename T, typename U>
-inline typename
-
- std::enable_if<std::is_floating_point<T>::value &&
- std::is_floating_point<U>::value,
- typename ProductType<T, std::complex<U>>::type>::type
- operator*(const T &left, const std::complex<U> &right)
+inline std::enable_if_t<std::is_floating_point<T>::value &&
+ std::is_floating_point<U>::value,
+ typename ProductType<T, std::complex<U>>::type>
+operator*(const T &left, const std::complex<U> &right)
{
using result_type = typename ProductType<T, std::complex<U>>::type;
return static_cast<result_type>(left) * static_cast<result_type>(right);
* @relatesalso ProductType
*/
template <typename T, typename U>
-inline
- typename std::enable_if<std::is_floating_point<T>::value &&
- std::is_floating_point<U>::value,
- typename ProductType<T, std::complex<U>>::type>::type
- operator/(const T &left, const std::complex<U> &right)
+inline std::enable_if_t<std::is_floating_point<T>::value &&
+ std::is_floating_point<U>::value,
+ typename ProductType<T, std::complex<U>>::type>
+operator/(const T &left, const std::complex<U> &right)
{
using result_type = typename ProductType<T, std::complex<U>>::type;
return static_cast<result_type>(left) / static_cast<result_type>(right);
* of the FullMatrix will be FullMatrix(dim_0,dim_2)
*/
template <typename Container>
- typename std::enable_if<
+ std::enable_if_t<
std::is_same<Container,
std::vector<typename Container::value_type>>::value,
- Container>::type
+ Container>
initialize_container(const std::vector<hsize_t> &dimensions);
/**
* Same as above.
*/
template <typename Container>
- typename std::enable_if<
+ std::enable_if_t<
std::is_same<Container, Vector<typename Container::value_type>>::value,
- Container>::type
+ Container>
initialize_container(const std::vector<hsize_t> &dimensions);
/**
* Same as above.
*/
template <typename Container>
- typename std::enable_if<
+ std::enable_if_t<
std::is_same<Container,
FullMatrix<typename Container::value_type>>::value,
- Container>::type
+ Container>
initialize_container(const std::vector<hsize_t> &dimensions);
/**
template <typename Container>
- typename std::enable_if<
+ std::enable_if_t<
std::is_same<Container,
std::vector<typename Container::value_type>>::value,
- Container>::type
+ Container>
initialize_container(const std::vector<hsize_t> &dimensions)
{
return Container(std::accumulate(
template <typename Container>
- typename std::enable_if<
+ std::enable_if_t<
std::is_same<Container, Vector<typename Container::value_type>>::value,
- Container>::type
+ Container>
initialize_container(const std::vector<hsize_t> &dimensions)
{
return Container(std::accumulate(
template <typename Container>
- typename std::enable_if<
+ std::enable_if_t<
std::is_same<Container,
FullMatrix<typename Container::value_type>>::value,
- Container>::type
+ Container>
initialize_container(const std::vector<hsize_t> &dimensions)
{
// If the rank is higher than 2, then remove single-dimensional entries
* the same entry in the same container.
*/
template <typename OtherIterator>
- friend typename std::enable_if<
+ friend std::enable_if_t<
std::is_convertible<OtherIterator, DerivedIterator>::value,
- bool>::type
+ bool>
operator==(const LinearIndexIterator &left, const OtherIterator &right)
{
const auto &right_2 = static_cast<const DerivedIterator &>(right);
* Opposite of operator==().
*/
template <typename OtherIterator>
- friend typename std::enable_if<
+ friend std::enable_if_t<
std::is_convertible<OtherIterator, DerivedIterator>::value,
- bool>::type
+ bool>
operator!=(const LinearIndexIterator &left, const OtherIterator &right)
{
return !(left == right);
* implemented.
*/
template <typename T>
- inline
- typename std::enable_if<std::is_fundamental<T>::value, std::size_t>::type
- memory_consumption(const T &t);
+ inline std::enable_if_t<std::is_fundamental<T>::value, std::size_t>
+ memory_consumption(const T &t);
/**
* Estimate the memory consumption of an object. If no further template
* <tt>t.memory_consumption()</tt>'s value.
*/
template <typename T>
- inline typename std::enable_if<!(std::is_fundamental<T>::value ||
- std::is_pointer<T>::value),
- std::size_t>::type
+ inline std::enable_if_t<!(std::is_fundamental<T>::value ||
+ std::is_pointer<T>::value),
+ std::size_t>
memory_consumption(const T &t);
/**
namespace MemoryConsumption
{
template <typename T>
- inline
- typename std::enable_if<std::is_fundamental<T>::value, std::size_t>::type
- memory_consumption(const T &)
+ inline std::enable_if_t<std::is_fundamental<T>::value, std::size_t>
+ memory_consumption(const T &)
{
return sizeof(T);
}
template <typename T>
- inline typename std::enable_if<!(std::is_fundamental<T>::value ||
- std::is_pointer<T>::value),
- std::size_t>::type
+ inline std::enable_if_t<!(std::is_fundamental<T>::value ||
+ std::is_pointer<T>::value),
+ std::size_t>
memory_consumption(const T &t)
{
return t.memory_consumption();
* the @p root_process.
*/
template <typename T>
- typename std::enable_if<is_mpi_type<T> == false, T>::type
+ std::enable_if_t<is_mpi_type<T> == false, T>
broadcast(const MPI_Comm & comm,
const T & object_to_send,
const unsigned int root_process = 0);
* the @p root_process.
*/
template <typename T>
- typename std::enable_if<is_mpi_type<T> == true, T>::type
+ std::enable_if_t<is_mpi_type<T> == true, T>
broadcast(const MPI_Comm & comm,
const T & object_to_send,
const unsigned int root_process = 0);
template <typename T>
- typename std::enable_if<is_mpi_type<T> == false, T>::type
+ std::enable_if_t<is_mpi_type<T> == false, T>
broadcast(const MPI_Comm & comm,
const T & object_to_send,
const unsigned int root_process)
template <typename T>
- typename std::enable_if<is_mpi_type<T> == true, T>::type
+ std::enable_if_t<is_mpi_type<T> == true, T>
broadcast(const MPI_Comm & comm,
const T & object_to_send,
const unsigned int root_process)
*/
template <typename Dummy = number>
static constexpr DEAL_II_CUDA_HOST_DEV
- typename std::enable_if<std::is_same<Dummy, number>::value &&
- is_cuda_compatible<Dummy>::value,
- real_type>::type
+ std::enable_if_t<std::is_same<Dummy, number>::value &&
+ is_cuda_compatible<Dummy>::value,
+ real_type>
abs_square(const number &x);
template <typename Dummy = number>
- static constexpr
- typename std::enable_if<std::is_same<Dummy, number>::value &&
- !is_cuda_compatible<Dummy>::value,
- real_type>::type
- abs_square(const number &x);
+ static constexpr std::enable_if_t<std::is_same<Dummy, number>::value &&
+ !is_cuda_compatible<Dummy>::value,
+ real_type>
+ abs_square(const number &x);
/**
* Return the absolute value of a number.
template <typename number>
template <typename Dummy>
constexpr DEAL_II_CUDA_HOST_DEV
- typename std::enable_if<std::is_same<Dummy, number>::value &&
- is_cuda_compatible<Dummy>::value,
- typename NumberTraits<number>::real_type>::type
+ std::enable_if_t<std::is_same<Dummy, number>::value &&
+ is_cuda_compatible<Dummy>::value,
+ typename NumberTraits<number>::real_type>
NumberTraits<number>::abs_square(const number &x)
{
return x * x;
template <typename number>
template <typename Dummy>
- constexpr
- typename std::enable_if<std::is_same<Dummy, number>::value &&
- !is_cuda_compatible<Dummy>::value,
- typename NumberTraits<number>::real_type>::type
- NumberTraits<number>::abs_square(const number &x)
+ constexpr std::enable_if_t<std::is_same<Dummy, number>::value &&
+ !is_cuda_compatible<Dummy>::value,
+ typename NumberTraits<number>::real_type>
+ NumberTraits<number>::abs_square(const number &x)
{
return x * x;
}
template <typename F>
static constexpr DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV T
value(const F &f,
- typename std::enable_if<
- !std::is_same<typename std::decay<T>::type,
- typename std::decay<F>::type>::value &&
- std::is_constructible<T, F>::value>::type * = nullptr)
+ std::enable_if_t<!std::is_same<typename std::decay<T>::type,
+ typename std::decay<F>::type>::value &&
+ std::is_constructible<T, F>::value> * = nullptr)
{
return T(f);
}
template <typename F>
static constexpr DEAL_II_ALWAYS_INLINE T
value(const F &f,
- typename std::enable_if<
- !std::is_same<typename std::decay<T>::type,
- typename std::decay<F>::type>::value &&
- !std::is_constructible<T, F>::value &&
- is_explicitly_convertible<const F, T>::value>::type * = nullptr)
+ std::enable_if_t<!std::is_same<typename std::decay<T>::type,
+ typename std::decay<F>::type>::value &&
+ !std::is_constructible<T, F>::value &&
+ is_explicitly_convertible<const F, T>::value> * =
+ nullptr)
{
return static_cast<T>(f);
}
// might fall into the same category.
template <typename F>
static T
- value(const F &f,
- typename std::enable_if<
- !std::is_same<typename std::decay<T>::type,
- typename std::decay<F>::type>::value &&
- !std::is_constructible<T, F>::value &&
- !is_explicitly_convertible<const F, T>::value &&
- Differentiation::AD::is_ad_number<F>::value>::type * = nullptr)
+ value(
+ const F &f,
+ std::enable_if_t<!std::is_same<typename std::decay<T>::type,
+ typename std::decay<F>::type>::value &&
+ !std::is_constructible<T, F>::value &&
+ !is_explicitly_convertible<const F, T>::value &&
+ Differentiation::AD::is_ad_number<F>::value> * = nullptr)
{
return Differentiation::AD::internal::NumberType<T>::value(f);
}
// standards. To avoid this, we use std::abs on default types but
// simply return the number on unsigned types
template <typename Number>
- typename std::enable_if<
- !std::is_unsigned<Number>::value,
- typename numbers::NumberTraits<Number>::real_type>::type
+ std::enable_if_t<!std::is_unsigned<Number>::value,
+ typename numbers::NumberTraits<Number>::real_type>
get_abs(const Number a)
{
return std::abs(a);
}
template <typename Number>
- typename std::enable_if<std::is_unsigned<Number>::value, Number>::type
+ std::enable_if_t<std::is_unsigned<Number>::value, Number>
get_abs(const Number a)
{
return a;
// Arithmetic types
template <class T>
- struct Convert<T,
- typename std::enable_if<std::is_arithmetic<T>::value>::type>
+ struct Convert<T, std::enable_if_t<std::is_arithmetic<T>::value>>
{
template <typename Dummy = T>
- static
- typename std::enable_if<std::is_same<Dummy, T>::value &&
- std::is_same<T, bool>::value,
- std::unique_ptr<Patterns::PatternBase>>::type
- to_pattern()
+ static std::enable_if_t<std::is_same<Dummy, T>::value &&
+ std::is_same<T, bool>::value,
+ std::unique_ptr<Patterns::PatternBase>>
+ to_pattern()
{
return std::make_unique<Patterns::Bool>();
}
template <typename Dummy = T>
- static
- typename std::enable_if<std::is_same<Dummy, T>::value &&
- !std::is_same<T, bool>::value &&
- std::is_integral<T>::value,
- std::unique_ptr<Patterns::PatternBase>>::type
- to_pattern()
+ static std::enable_if_t<std::is_same<Dummy, T>::value &&
+ !std::is_same<T, bool>::value &&
+ std::is_integral<T>::value,
+ std::unique_ptr<Patterns::PatternBase>>
+ to_pattern()
{
return std::make_unique<Patterns::Integer>(
std::numeric_limits<T>::lowest(), std::numeric_limits<T>::max());
}
template <typename Dummy = T>
- static
- typename std::enable_if<std::is_same<Dummy, T>::value &&
- !std::is_same<T, bool>::value &&
- std::is_floating_point<T>::value,
- std::unique_ptr<Patterns::PatternBase>>::type
- to_pattern()
+ static std::enable_if_t<std::is_same<Dummy, T>::value &&
+ !std::is_same<T, bool>::value &&
+ std::is_floating_point<T>::value,
+ std::unique_ptr<Patterns::PatternBase>>
+ to_pattern()
{
return std::make_unique<Patterns::Double>(
std::numeric_limits<T>::lowest(), std::numeric_limits<T>::max());
// Rank of vector types
template <class T>
- struct RankInfo<
- T,
- typename std::enable_if<is_list_compatible<T>::value>::type>
+ struct RankInfo<T, std::enable_if_t<is_list_compatible<T>::value>>
{
static constexpr int list_rank =
RankInfo<typename T::value_type>::list_rank + 1;
// Rank of map types
template <class T>
- struct RankInfo<
- T,
- typename std::enable_if<is_map_compatible<T>::value>::type>
+ struct RankInfo<T, std::enable_if_t<is_map_compatible<T>::value>>
{
static constexpr int list_rank =
max_list_rank<typename T::key_type, typename T::mapped_type>() + 1;
// stl containers
template <class T>
- struct Convert<T,
- typename std::enable_if<is_list_compatible<T>::value>::type>
+ struct Convert<T, std::enable_if_t<is_list_compatible<T>::value>>
{
static std::unique_ptr<Patterns::PatternBase>
to_pattern()
// stl maps
template <class T>
- struct Convert<T,
- typename std::enable_if<is_map_compatible<T>::value>::type>
+ struct Convert<T, std::enable_if_t<is_map_compatible<T>::value>>
{
static std::unique_ptr<Patterns::PatternBase>
to_pattern()
* Convert a boost::geometry::point to a dealii::Point.
*/
template <std::size_t dummy_dim,
- typename std::enable_if<(dim == dummy_dim) && (dummy_dim != 0),
- int>::type = 0>
+ std::enable_if_t<(dim == dummy_dim) && (dummy_dim != 0), int> = 0>
Point(const boost::geometry::model::
point<Number, dummy_dim, boost::geometry::cs::cartesian> &boost_pt);
template <int dim, typename Number>
-template <
- std::size_t dummy_dim,
- typename std::enable_if<(dim == dummy_dim) && (dummy_dim != 0), int>::type>
+template <std::size_t dummy_dim,
+ std::enable_if_t<(dim == dummy_dim) && (dummy_dim != 0), int>>
inline Point<dim, Number>::Point(
const boost::geometry::model::
point<Number, dummy_dim, boost::geometry::cs::cartesian> &boost_pt)
// this function is for tensors of a rank not already handled
// above
template <int dim, int rank_>
- constexpr inline
- typename std::enable_if<rank_ != 2, TableIndices<rank_>>::type
- unrolled_to_component_indices(const unsigned int i,
- const std::integral_constant<int, rank_> &)
+ constexpr inline std::enable_if_t<rank_ != 2, TableIndices<rank_>>
+ unrolled_to_component_indices(const unsigned int i,
+ const std::integral_constant<int, rank_> &)
{
(void)i;
Assert(
int dim,
typename Number,
typename OtherNumber,
- typename std::enable_if<
+ std::enable_if_t<
!std::is_integral<
typename ProductType<Number, OtherNumber>::type>::value &&
!std::is_same<Number, Differentiation::SD::Expression>::value,
- int>::type = 0>
+ int> = 0>
constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE void
division_operator(Tensor<rank, dim, Number> (&t)[dim],
const OtherNumber &factor)
int dim,
typename Number,
typename OtherNumber,
- typename std::enable_if<
+ std::enable_if_t<
std::is_integral<
typename ProductType<Number, OtherNumber>::type>::value ||
std::is_same<Number, Differentiation::SD::Expression>::value,
- int>::type = 0>
+ int> = 0>
constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE void
division_operator(Tensor<rank, dim, Number> (&t)[dim],
const OtherNumber &factor)
int dim,
typename Number,
typename OtherNumber,
- typename std::enable_if<
+ std::enable_if_t<
!std::is_integral<
typename ProductType<Number, OtherNumber>::type>::value,
- int>::type = 0>
+ int> = 0>
constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type>
division_operator(const Tensor<rank, dim, Number> &t,
int dim,
typename Number,
typename OtherNumber,
- typename std::enable_if<
+ std::enable_if_t<
std::is_integral<
typename ProductType<Number, OtherNumber>::type>::value,
- int>::type = 0>
+ int> = 0>
constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type>
division_operator(const Tensor<rank, dim, Number> &t,
int dim,
typename Number,
typename OtherNumber,
- typename = typename std::enable_if<rank_1 >= 1 && rank_2 >= 1>::type>
+ typename = std::enable_if_t<rank_1 >= 1 && rank_2 >= 1>>
constexpr inline DEAL_II_ALWAYS_INLINE
typename Tensor<rank_1 + rank_2 - 2,
dim,
* current lane.
*/
template <typename U = T>
- typename std::enable_if<!std::is_same<U, const U>::value,
- typename T::value_type>::type &
+ std::enable_if_t<!std::is_same<U, const U>::value, typename T::value_type> &
operator*()
{
AssertIndexRange(lane, T::size());
typename IteratorRangeType,
typename ScratchData,
typename CopyData,
- typename = typename std::enable_if<
- has_begin_and_end<IteratorRangeType>>::type>
+ typename = std::enable_if_t<has_begin_and_end<IteratorRangeType>>>
void
run(IteratorRangeType iterator_range,
Worker worker,
typename IteratorRangeType,
typename ScratchData,
typename CopyData,
- typename = typename std::enable_if<
- has_begin_and_end<IteratorRangeType>>::type>
+ typename = std::enable_if_t<has_begin_and_end<IteratorRangeType>>>
void
run(IteratorRangeType iterator_range,
MainClass & main_object,
* Specialization for taped ADOL-C auto-differentiable numbers.
*/
template <typename ADNumberType>
- struct Types<
- ADNumberType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>
+ struct Types<ADNumberType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>
{
/**
* Typedef for tape indices. ADOL-C uses short integers, so
* Specialization for taped ADOL-C auto-differentiable numbers.
*/
template <typename ADNumberType>
- struct Numbers<
- ADNumberType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>
+ struct Numbers<ADNumberType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>
{
/**
* A tape index that is unusable and can be used to invalidate recording
struct TapedDrivers<
ADNumberType,
double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>
{
using scalar_type = double;
struct TapedDrivers<
ADNumberType,
double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>
{
using scalar_type = double;
struct TapedDrivers<
ADNumberType,
float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>
{
using scalar_type = float;
struct TapelessDrivers<
ADNumberType,
ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad_dfad>::type>
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad_dfad>>
{
/**
* Constructor
struct TapelessDrivers<
ADNumberType,
ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad_dfad>::type>
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad_dfad>>
{
/**
* Constructor
struct ADNumberInfoFromEnum<
ScalarType,
Differentiation::AD::NumberTypes::none,
- typename std::enable_if<
- std::is_floating_point<ScalarType>::value>::type>
+ std::enable_if_t<std::is_floating_point<ScalarType>::value>>
{
static const bool is_taped = false;
using real_type = ScalarType;
* mechanism can be employed (e.g. Sacado types).
*/
template <typename ScalarType>
- struct Marking<ScalarType,
- typename std::enable_if<
- std::is_floating_point<ScalarType>::value>::type>
+ struct Marking<
+ ScalarType,
+ std::enable_if_t<std::is_floating_point<ScalarType>::value>>
{
/**
* Initialize the state of an independent variable.
* A specialization of the marking strategy for complex numbers.
*/
template <typename ADNumberType>
- struct Marking<
- ADNumberType,
- typename std::enable_if<boost::is_complex<ADNumberType>::value>::type>
+ struct Marking<ADNumberType,
+ std::enable_if_t<boost::is_complex<ADNumberType>::value>>
{
/*
* Initialize the state of an independent variable.
template <typename NumberType>
struct is_taped_ad_number<
NumberType,
- typename std::enable_if<
- ADNumberTraits<typename std::decay<NumberType>::type>::is_taped>::type>
+ std::enable_if_t<
+ ADNumberTraits<typename std::decay<NumberType>::type>::is_taped>>
: std::true_type
{};
template <typename NumberType>
struct is_tapeless_ad_number<
NumberType,
- typename std::enable_if<ADNumberTraits<
- typename std::decay<NumberType>::type>::is_tapeless>::type>
+ std::enable_if_t<
+ ADNumberTraits<typename std::decay<NumberType>::type>::is_tapeless>>
: std::true_type
{};
template <typename NumberType>
struct is_real_valued_ad_number<
NumberType,
- typename std::enable_if<ADNumberTraits<
- typename std::decay<NumberType>::type>::is_real_valued>::type>
+ std::enable_if_t<
+ ADNumberTraits<typename std::decay<NumberType>::type>::is_real_valued>>
: std::true_type
{};
template <typename NumberType>
struct is_complex_valued_ad_number<
NumberType,
- typename std::enable_if<ADNumberTraits<
- typename std::decay<NumberType>::type>::is_complex_valued>::type>
+ std::enable_if_t<ADNumberTraits<
+ typename std::decay<NumberType>::type>::is_complex_valued>>
: std::true_type
{};
* mechanism can be employed (e.g. Sacado types).
*/
template <typename NumberType>
- struct ExtractData<NumberType,
- typename std::enable_if<
- std::is_floating_point<NumberType>::value>::type>
+ struct ExtractData<
+ NumberType,
+ std::enable_if_t<std::is_floating_point<NumberType>::value>>
{
/**
* Extract the floating point value.
*/
template <typename F>
static auto
- value(const F &f,
- typename std::enable_if<!is_ad_number<F>::value>::type * =
- nullptr) -> decltype(dealii::internal::NumberType<T>::value(f))
+ value(const F &f, std::enable_if_t<!is_ad_number<F>::value> * = nullptr)
+ -> decltype(dealii::internal::NumberType<T>::value(f))
{
// We call the other function defined in the numbers
// header to take care of all of the usual cases.
template <typename F>
static T
value(const F &f,
- typename std::enable_if<is_ad_number<F>::value &&
- std::is_floating_point<T>::value>::type
- * = nullptr)
+ std::enable_if_t<is_ad_number<F>::value &&
+ std::is_floating_point<T>::value> * = nullptr)
{
// We recursively call this function in case the AD number is a
// nested one. The recursion ends when the extracted value is
template <typename F>
static T
value(const F &f,
- typename std::enable_if<is_ad_number<F>::value &&
- is_ad_number<T>::value>::type * = nullptr)
+ std::enable_if_t<is_ad_number<F>::value && is_ad_number<T>::value>
+ * = nullptr)
{
return T(f);
}
*/
template <typename F>
static auto
- value(
- const F &f,
- typename std::enable_if<!is_ad_number<F>::value>::type * = nullptr)
+ value(const F &f, std::enable_if_t<!is_ad_number<F>::value> * = nullptr)
-> decltype(dealii::internal::NumberType<std::complex<T>>::value(f))
{
// We call the other function defined in the numbers
template <typename F>
static std::complex<T>
value(const F &f,
- typename std::enable_if<is_ad_number<F>::value &&
- std::is_floating_point<T>::value>::type
- * = nullptr)
+ std::enable_if_t<is_ad_number<F>::value &&
+ std::is_floating_point<T>::value> * = nullptr)
{
// We recursively call this function in case the AD number is a
// nested one. The recursion ends when the extracted value is
struct NumberTraits<
ScalarType,
ADNumberTypeCode,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
- std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>
+ std::is_floating_point<
+ typename internal::RemoveComplexWrapper<ScalarType>::type>::value)>>
{
/**
* The type of taping used
const bool NumberTraits<
ScalarType,
ADNumberTypeCode,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_taped =
+ ScalarType>::type>::value)>>::is_taped =
internal::ADNumberInfoFromEnum<
typename internal::RemoveComplexWrapper<ScalarType>::type,
ADNumberTypeCode>::is_taped;
const bool NumberTraits<
ScalarType,
ADNumberTypeCode,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_tapeless =
+ ScalarType>::type>::value)>>::is_tapeless =
!(NumberTraits<ScalarType, ADNumberTypeCode>::is_taped);
const bool NumberTraits<
ScalarType,
ADNumberTypeCode,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_real_valued =
+ ScalarType>::type>::value)>>::is_real_valued =
(!boost::is_complex<ScalarType>::value);
const bool NumberTraits<
ScalarType,
ADNumberTypeCode,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_complex_valued =
+ ScalarType>::type>::value)>>::is_complex_valued =
!(NumberTraits<ScalarType, ADNumberTypeCode>::is_real_valued);
const unsigned int NumberTraits<
ScalarType,
ADNumberTypeCode,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::n_supported_derivative_levels =
+ ScalarType>::type>::value)>>::n_supported_derivative_levels =
internal::ADNumberInfoFromEnum<
typename internal::RemoveComplexWrapper<ScalarType>::type,
ADNumberTypeCode>::n_supported_derivative_levels;
constexpr bool NumberTraits<
ScalarType,
ADNumberTypeCode,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_taped;
+ ScalarType>::type>::value)>>::is_taped;
template <typename ScalarType, enum NumberTypes ADNumberTypeCode>
constexpr bool NumberTraits<
ScalarType,
ADNumberTypeCode,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_tapeless;
+ ScalarType>::type>::value)>>::is_tapeless;
template <typename ScalarType, enum NumberTypes ADNumberTypeCode>
constexpr bool NumberTraits<
ScalarType,
ADNumberTypeCode,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_real_valued;
+ ScalarType>::type>::value)>>::is_real_valued;
template <typename ScalarType, enum NumberTypes ADNumberTypeCode>
constexpr bool NumberTraits<
ScalarType,
ADNumberTypeCode,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_complex_valued;
+ ScalarType>::type>::value)>>::is_complex_valued;
template <typename ScalarType, enum NumberTypes ADNumberTypeCode>
constexpr unsigned int NumberTraits<
ScalarType,
ADNumberTypeCode,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::n_supported_derivative_levels;
+ ScalarType>::type>::value)>>::n_supported_derivative_levels;
# endif
struct NumberTraits<
ScalarType,
NumberTypes::none,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
- std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>
+ std::is_floating_point<
+ typename internal::RemoveComplexWrapper<ScalarType>::type>::value)>>
{
/**
* The internal number type code.
const bool NumberTraits<
ScalarType,
NumberTypes::none,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_taped = false;
+ ScalarType>::type>::value)>>::is_taped = false;
template <typename ScalarType>
const bool NumberTraits<
ScalarType,
NumberTypes::none,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_tapeless = false;
+ ScalarType>::type>::value)>>::is_tapeless = false;
template <typename ScalarType>
const bool NumberTraits<
ScalarType,
NumberTypes::none,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_real_valued =
+ ScalarType>::type>::value)>>::is_real_valued =
(!boost::is_complex<ScalarType>::value);
const bool NumberTraits<
ScalarType,
NumberTypes::none,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_complex_valued =
+ ScalarType>::type>::value)>>::is_complex_valued =
!(NumberTraits<ScalarType, NumberTypes::none>::is_real_valued);
const unsigned int NumberTraits<
ScalarType,
NumberTypes::none,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::n_supported_derivative_levels =
- 0;
+ ScalarType>::type>::value)>>::n_supported_derivative_levels = 0;
# else
constexpr bool NumberTraits<
ScalarType,
NumberTypes::none,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_taped;
+ ScalarType>::type>::value)>>::is_taped;
template <typename ScalarType>
constexpr bool NumberTraits<
ScalarType,
NumberTypes::none,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_tapeless;
+ ScalarType>::type>::value)>>::is_tapeless;
template <typename ScalarType>
constexpr bool NumberTraits<
ScalarType,
NumberTypes::none,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_real_valued;
+ ScalarType>::type>::value)>>::is_real_valued;
template <typename ScalarType>
constexpr bool NumberTraits<
ScalarType,
NumberTypes::none,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::is_complex_valued;
+ ScalarType>::type>::value)>>::is_complex_valued;
template <typename ScalarType>
constexpr unsigned int NumberTraits<
ScalarType,
NumberTypes::none,
- typename std::enable_if<
+ std::enable_if_t<
std::is_floating_point<ScalarType>::value ||
(boost::is_complex<ScalarType>::value &&
std::is_floating_point<typename internal::RemoveComplexWrapper<
- ScalarType>::type>::value)>::type>::n_supported_derivative_levels;
+ ScalarType>::type>::value)>>::n_supported_derivative_levels;
# endif
template <typename ScalarType>
struct ADNumberTraits<
ScalarType,
- typename std::enable_if<std::is_floating_point<ScalarType>::value>::type>
+ std::enable_if_t<std::is_floating_point<ScalarType>::value>>
: NumberTraits<ScalarType, NumberTypes::none>
{};
template <typename ComplexScalarType>
struct ADNumberTraits<
ComplexScalarType,
- typename std::enable_if<
+ std::enable_if_t<
boost::is_complex<ComplexScalarType>::value &&
- std::is_floating_point<typename ComplexScalarType::value_type>::value>::
- type> : NumberTraits<ComplexScalarType, NumberTypes::none>
+ std::is_floating_point<typename ComplexScalarType::value_type>::value>>
+ : NumberTraits<ComplexScalarType, NumberTypes::none>
{};
} // namespace AD
struct ADNumberInfoFromEnum<
ScalarType,
Differentiation::AD::NumberTypes::adolc_taped,
- typename std::enable_if<
- std::is_floating_point<ScalarType>::value>::type>
+ std::enable_if_t<std::is_floating_point<ScalarType>::value>>
{
static const bool is_taped = true;
using real_type = adouble;
struct ADNumberInfoFromEnum<
ScalarType,
Differentiation::AD::NumberTypes::adolc_tapeless,
- typename std::enable_if<
- std::is_floating_point<ScalarType>::value>::type>
+ std::enable_if_t<std::is_floating_point<ScalarType>::value>>
{
static const bool is_taped = false;
using real_type = adtl::adouble;
template <typename ADNumberType>
struct Marking<
ADNumberType,
- typename std::enable_if<
- ADNumberTraits<ADNumberType>::type_code == NumberTypes::adolc_taped &&
- ADNumberTraits<ADNumberType>::is_real_valued>::type>
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped &&
+ ADNumberTraits<ADNumberType>::is_real_valued>>
{
using scalar_type = typename ADNumberTraits<ADNumberType>::scalar_type;
};
template <typename ADNumberType>
- struct Marking<ADNumberType,
- typename std::enable_if<
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless &&
- ADNumberTraits<ADNumberType>::is_real_valued>::type>
+ struct Marking<
+ ADNumberType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless &&
+ ADNumberTraits<ADNumberType>::is_real_valued>>
{
using scalar_type = typename ADNumberTraits<ADNumberType>::scalar_type;
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- typename std::enable_if<std::is_same<ADNumberType, adouble>::value>::type>
+ std::enable_if_t<std::is_same<ADNumberType, adouble>::value>>
: NumberTraits<double, NumberTypes::adolc_taped>
{
static_assert(std::is_same<ad_type, adouble>::value,
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- typename std::enable_if<
- std::is_same<ADNumberType, std::complex<adouble>>::value>::type>
+ std::enable_if_t<
+ std::is_same<ADNumberType, std::complex<adouble>>::value>>
: NumberTraits<std::complex<double>, NumberTypes::adolc_taped>
{
static_assert(std::is_same<ad_type, std::complex<adouble>>::value,
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- typename std::enable_if<
- std::is_same<ADNumberType, adtl::adouble>::value>::type>
+ std::enable_if_t<std::is_same<ADNumberType, adtl::adouble>::value>>
: NumberTraits<double, NumberTypes::adolc_tapeless>
{
static_assert(std::is_same<ad_type, adtl::adouble>::value,
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- typename std::enable_if<
- std::is_same<ADNumberType, std::complex<adtl::adouble>>::value>::type>
+ std::enable_if_t<
+ std::is_same<ADNumberType, std::complex<adtl::adouble>>::value>>
: NumberTraits<std::complex<double>, NumberTypes::adolc_tapeless>
{
static_assert(std::is_same<ad_type, std::complex<adtl::adouble>>::value,
template <typename NumberType>
struct is_adolc_taped_number<
NumberType,
- typename std::enable_if<
- ADNumberTraits<typename std::decay<NumberType>::type>::type_code ==
- NumberTypes::adolc_taped>::type> : std::true_type
+ std::enable_if_t<ADNumberTraits<typename std::decay<NumberType>::type>::
+ type_code == NumberTypes::adolc_taped>>
+ : std::true_type
{};
template <typename NumberType>
struct is_adolc_tapeless_number<
NumberType,
- typename std::enable_if<
- ADNumberTraits<typename std::decay<NumberType>::type>::type_code ==
- NumberTypes::adolc_tapeless>::type> : std::true_type
+ std::enable_if_t<ADNumberTraits<typename std::decay<NumberType>::type>::
+ type_code == NumberTypes::adolc_tapeless>>
+ : std::true_type
{};
* parameter is a (real or complex; taped or tapeless) ADOL-C number.
*/
template <typename NumberType>
- struct is_adolc_number<NumberType,
- typename std::enable_if<
- is_adolc_taped_number<NumberType>::value ||
- is_adolc_tapeless_number<NumberType>::value>::type>
+ struct is_adolc_number<
+ NumberType,
+ std::enable_if_t<is_adolc_taped_number<NumberType>::value ||
+ is_adolc_tapeless_number<NumberType>::value>>
: std::true_type
{};
*/
template <
typename ADNumberType,
- typename = typename std::enable_if<
+ typename = std::enable_if_t<
dealii::Differentiation::AD::is_sacado_number<ADNumberType>::value &&
dealii::Differentiation::AD::is_real_valued_ad_number<
- ADNumberType>::value>::type>
+ ADNumberType>::value>>
inline ADNumberType
erf(ADNumberType x)
{
*/
template <
typename ADNumberType,
- typename = typename std::enable_if<
- dealii::Differentiation::AD::is_sacado_number<ADNumberType>::value>::type>
+ typename = std::enable_if_t<
+ dealii::Differentiation::AD::is_sacado_number<ADNumberType>::value>>
inline ADNumberType
erfc(const ADNumberType &x)
{
template <typename SacadoNumber>
struct SacadoNumberInfo<
SacadoNumber,
- typename std::enable_if<std::is_same<
+ std::enable_if_t<std::is_same<
SacadoNumber,
- Sacado::Fad::DFad<typename SacadoNumber::value_type>>::value>::type>
+ Sacado::Fad::DFad<typename SacadoNumber::value_type>>::value>>
{
using ad_type = SacadoNumber;
using scalar_type = typename ad_type::scalar_type;
template <typename SacadoNumber>
struct SacadoNumberInfo<
SacadoNumber,
- typename std::enable_if<std::is_same<
+ std::enable_if_t<std::is_same<
SacadoNumber,
- Sacado::Rad::ADvar<typename SacadoNumber::value_type>>::value>::type>
+ Sacado::Rad::ADvar<typename SacadoNumber::value_type>>::value>>
{
using ad_type = SacadoNumber;
using scalar_type = typename ad_type::ADVari::scalar_type;
* templates used in the above specializations.
*/
template <typename Number>
- struct SacadoNumberInfo<
- Number,
- typename std::enable_if<
- std::is_arithmetic<typename std::decay<Number>::type>::value>::type>
+ struct SacadoNumberInfo<Number,
+ std::enable_if_t<std::is_arithmetic<
+ typename std::decay<Number>::type>::value>>
{
static const unsigned int n_supported_derivative_levels = 0;
};
struct ADNumberInfoFromEnum<
ScalarType,
Differentiation::AD::NumberTypes::sacado_dfad,
- typename std::enable_if<
- std::is_floating_point<ScalarType>::value>::type>
+ std::enable_if_t<std::is_floating_point<ScalarType>::value>>
{
static const bool is_taped = false;
using real_type = Sacado::Fad::DFad<ScalarType>;
struct ADNumberInfoFromEnum<
ScalarType,
Differentiation::AD::NumberTypes::sacado_dfad_dfad,
- typename std::enable_if<
- std::is_floating_point<ScalarType>::value>::type>
+ std::enable_if_t<std::is_floating_point<ScalarType>::value>>
{
static const bool is_taped = false;
using real_type = Sacado::Fad::DFad<Sacado::Fad::DFad<ScalarType>>;
struct ADNumberInfoFromEnum<
ScalarType,
Differentiation::AD::NumberTypes::sacado_rad,
- typename std::enable_if<
- std::is_floating_point<ScalarType>::value>::type>
+ std::enable_if_t<std::is_floating_point<ScalarType>::value>>
{
static const bool is_taped = false;
using real_type = Sacado::Rad::ADvar<ScalarType>;
struct ADNumberInfoFromEnum<
ScalarType,
Differentiation::AD::NumberTypes::sacado_rad_dfad,
- typename std::enable_if<
- std::is_floating_point<ScalarType>::value>::type>
+ std::enable_if_t<std::is_floating_point<ScalarType>::value>>
{
static const bool is_taped = false;
using real_type = Sacado::Rad::ADvar<Sacado::Fad::DFad<ScalarType>>;
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- typename std::enable_if<std::is_same<
+ std::enable_if_t<std::is_same<
ADNumberType,
- Sacado::Fad::DFad<typename ADNumberType::scalar_type>>::value>::type>
+ Sacado::Fad::DFad<typename ADNumberType::scalar_type>>::value>>
: NumberTraits<typename ADNumberType::scalar_type,
NumberTypes::sacado_dfad>
{};
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- typename std::enable_if<std::is_same<
+ std::enable_if_t<std::is_same<
ADNumberType,
std::complex<Sacado::Fad::DFad<
- typename ADNumberType::value_type::scalar_type>>>::value>::type>
+ typename ADNumberType::value_type::scalar_type>>>::value>>
: NumberTraits<
std::complex<typename ADNumberType::value_type::scalar_type>,
NumberTypes::sacado_dfad>
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- typename std::enable_if<std::is_same<
+ std::enable_if_t<std::is_same<
ADNumberType,
- Sacado::Rad::ADvar<typename ADNumberType::ADVari::scalar_type>>::
- value>::type>
+ Sacado::Rad::ADvar<typename ADNumberType::ADVari::scalar_type>>::value>>
: NumberTraits<typename ADNumberType::ADVari::scalar_type,
NumberTypes::sacado_rad>
{};
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- typename std::enable_if<std::is_same<
+ std::enable_if_t<std::is_same<
ADNumberType,
- std::complex<Sacado::Rad::ADvar<typename ADNumberType::value_type::
- ADVari::scalar_type>>>::value>::type>
+ std::complex<Sacado::Rad::ADvar<
+ typename ADNumberType::value_type::ADVari::scalar_type>>>::value>>
: NumberTraits<
std::complex<typename ADNumberType::value_type::ADVari::scalar_type>,
NumberTypes::sacado_rad>
* a floating point type.
*/
template <typename ADNumberType>
- struct ADNumberTraits<
- ADNumberType,
- typename std::enable_if<
- std::is_same<ADNumberType,
- Sacado::Fad::DFad<Sacado::Fad::DFad<
- typename ADNumberType::scalar_type>>>::value>::type>
+ struct ADNumberTraits<ADNumberType,
+ std::enable_if_t<std::is_same<
+ ADNumberType,
+ Sacado::Fad::DFad<Sacado::Fad::DFad<
+ typename ADNumberType::scalar_type>>>::value>>
: NumberTraits<typename ADNumberType::scalar_type,
NumberTypes::sacado_dfad_dfad>
{};
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- typename std::enable_if<std::is_same<
+ std::enable_if_t<std::is_same<
ADNumberType,
std::complex<Sacado::Fad::DFad<Sacado::Fad::DFad<
- typename ADNumberType::value_type::scalar_type>>>>::value>::type>
+ typename ADNumberType::value_type::scalar_type>>>>::value>>
: NumberTraits<
std::complex<typename ADNumberType::value_type::scalar_type>,
NumberTypes::sacado_dfad_dfad>
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- typename std::enable_if<std::is_same<
- ADNumberType,
- Sacado::Rad::ADvar<Sacado::Fad::DFad<
- typename ADNumberType::ADVari::scalar_type>>>::value>::type>
+ std::enable_if_t<
+ std::is_same<ADNumberType,
+ Sacado::Rad::ADvar<Sacado::Fad::DFad<
+ typename ADNumberType::ADVari::scalar_type>>>::value>>
: NumberTraits<typename ADNumberType::ADVari::scalar_type,
NumberTypes::sacado_rad_dfad>
{};
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- typename std::enable_if<std::is_same<
+ std::enable_if_t<std::is_same<
ADNumberType,
std::complex<Sacado::Rad::ADvar<Sacado::Fad::DFad<
- typename ADNumberType::value_type::ADVari::scalar_type>>>>::value>::
- type>
+ typename ADNumberType::value_type::ADVari::scalar_type>>>>::value>>
: NumberTraits<
std::complex<typename ADNumberType::value_type::ADVari::scalar_type>,
NumberTypes::sacado_rad_dfad>
template <typename NumberType>
struct is_sacado_dfad_number<
NumberType,
- typename std::enable_if<
+ std::enable_if_t<
ADNumberTraits<typename std::decay<NumberType>::type>::type_code ==
NumberTypes::sacado_dfad ||
ADNumberTraits<typename std::decay<NumberType>::type>::type_code ==
- NumberTypes::sacado_dfad_dfad>::type> : std::true_type
+ NumberTypes::sacado_dfad_dfad>> : std::true_type
{};
template <typename NumberType>
struct is_sacado_dfad_number<
NumberType,
- typename std::enable_if<std::is_same<
+ std::enable_if_t<std::is_same<
NumberType,
- Sacado::Fad::Expr<typename NumberType::value_type>>::value>::type>
+ Sacado::Fad::Expr<typename NumberType::value_type>>::value>>
: std::true_type
{};
template <typename NumberType>
struct is_sacado_rad_number<
NumberType,
- typename std::enable_if<
+ std::enable_if_t<
ADNumberTraits<typename std::decay<NumberType>::type>::type_code ==
NumberTypes::sacado_rad ||
ADNumberTraits<typename std::decay<NumberType>::type>::type_code ==
- NumberTypes::sacado_rad_dfad>::type> : std::true_type
+ NumberTypes::sacado_rad_dfad>> : std::true_type
{};
template <typename NumberType>
struct is_sacado_rad_number<
NumberType,
- typename std::enable_if<std::is_same<
- NumberType,
- Sacado::Rad::ADvari<Sacado::Fad::DFad<
- typename NumberType::ADVari::scalar_type>>>::value>::type>
+ std::enable_if_t<
+ std::is_same<NumberType,
+ Sacado::Rad::ADvari<Sacado::Fad::DFad<
+ typename NumberType::ADVari::scalar_type>>>::value>>
: std::true_type
{};
template <typename NumberType>
struct is_sacado_number<
NumberType,
- typename std::enable_if<is_sacado_dfad_number<NumberType>::value ||
- is_sacado_rad_number<NumberType>::value>::type>
+ std::enable_if_t<is_sacado_dfad_number<NumberType>::value ||
+ is_sacado_rad_number<NumberType>::value>>
: std::true_type
{};
template <typename NumberType>
struct is_cuda_compatible<
NumberType,
- typename std::enable_if<dealii::Differentiation::AD::is_sacado_rad_number<
- NumberType>::value>::type> : std::false_type
+ std::enable_if_t<
+ dealii::Differentiation::AD::is_sacado_rad_number<NumberType>::value>>
+ : std::false_type
{};
} // namespace numbers
*
* This variant is used when the @p exponent is not a Expression.
*/
- template <typename NumberType,
- typename = typename std::enable_if<
- !std::is_same<NumberType, Expression>::value>::type>
+ template <
+ typename NumberType,
+ typename = std::enable_if_t<!std::is_same<NumberType, Expression>::value>>
Expression
pow(const Expression &base, const NumberType &exponent)
{
*
* This variant is used when the @p base is not a Expression.
*/
- template <typename NumberType,
- typename = typename std::enable_if<
- !std::is_same<NumberType, Expression>::value>::type>
+ template <
+ typename NumberType,
+ typename = std::enable_if_t<!std::is_same<NumberType, Expression>::value>>
Expression
pow(const NumberType &base, const Expression &exponent)
{
*
* This variant is used when the @p base is not a Expression.
*/
- template <typename NumberType,
- typename = typename std::enable_if<
- !std::is_same<NumberType, Expression>::value>::type>
+ template <
+ typename NumberType,
+ typename = std::enable_if_t<!std::is_same<NumberType, Expression>::value>>
Expression
log(const Expression &x, const NumberType &base)
{
*
* This variant is used when the @p value is not a Expression.
*/
- template <typename NumberType,
- typename = typename std::enable_if<
- !std::is_same<NumberType, Expression>::value>::type>
+ template <
+ typename NumberType,
+ typename = std::enable_if_t<!std::is_same<NumberType, Expression>::value>>
Expression
log(const NumberType &x, const Expression &base)
{
*
* This variant is used when the numerator @p y is not a Expression.
*/
- template <typename NumberType,
- typename = typename std::enable_if<
- !std::is_same<NumberType, Expression>::value>::type>
+ template <
+ typename NumberType,
+ typename = std::enable_if_t<!std::is_same<NumberType, Expression>::value>>
Expression
atan2(const NumberType &y, const Expression &x)
{
*
* This variant is used when the denominator @p x is not a Expression.
*/
- template <typename NumberType,
- typename = typename std::enable_if<
- !std::is_same<NumberType, Expression>::value>::type>
+ template <
+ typename NumberType,
+ typename = std::enable_if_t<!std::is_same<NumberType, Expression>::value>>
Expression
atan2(const Expression &y, const NumberType &x)
{
*
* This variant is used when @p b is not a Expression.
*/
- template <typename NumberType,
- typename = typename std::enable_if<
- !std::is_same<NumberType, Expression>::value>::type>
+ template <
+ typename NumberType,
+ typename = std::enable_if_t<!std::is_same<NumberType, Expression>::value>>
Expression
max(const Expression &a, const NumberType &b)
{
*
* This variant is used when @p a is not a Expression.
*/
- template <typename NumberType,
- typename = typename std::enable_if<
- !std::is_same<NumberType, Expression>::value>::type>
+ template <
+ typename NumberType,
+ typename = std::enable_if_t<!std::is_same<NumberType, Expression>::value>>
Expression
max(const NumberType &a, const Expression &b)
{
*
* This variant is used when @p b is not a Expression.
*/
- template <typename NumberType,
- typename = typename std::enable_if<
- !std::is_same<NumberType, Expression>::value>::type>
+ template <
+ typename NumberType,
+ typename = std::enable_if_t<!std::is_same<NumberType, Expression>::value>>
Expression
min(const Expression &a, const NumberType &b)
{
*
* This variant is used when @p a is not a Expression.
*/
- template <typename NumberType,
- typename = typename std::enable_if<
- !std::is_same<NumberType, Expression>::value>::type>
+ template <
+ typename NumberType,
+ typename = std::enable_if_t<!std::is_same<NumberType, Expression>::value>>
Expression
min(const NumberType &a, const Expression &b)
{
* potential ambiguities related to implicit conversions in either user
* code or math functions that are loaded into the standard namespace.
*/
- template <typename NumberType,
- typename = typename std::enable_if<
- std::is_arithmetic<NumberType>::value>::type>
+ template <
+ typename NumberType,
+ typename = std::enable_if_t<std::is_arithmetic<NumberType>::value>>
explicit Expression(const NumberType &value);
/**
* potential ambiguities related to implicit conversions in either user
* code or math functions that are loaded into the standard namespace.
*/
- template <typename NumberType,
- typename = typename std::enable_if<
- std::is_arithmetic<NumberType>::value>::type>
+ template <
+ typename NumberType,
+ typename = std::enable_if_t<std::is_arithmetic<NumberType>::value>>
explicit Expression(const std::complex<NumberType> &value);
/**
* It is expected that both the @p numerator and @p denominator
* be integral types.
*/
- template <typename NumberType,
- typename = typename std::enable_if<
- std::is_integral<NumberType>::value>::type>
+ template <
+ typename NumberType,
+ typename = std::enable_if_t<std::is_integral<NumberType>::value>>
Expression(const NumberType &numerator, const NumberType &denominator);
/**
* scalar expressions using Expression more natural.
*/
template <typename NumberType,
- typename = typename std::enable_if<
- std::is_constructible<Expression, NumberType>::value>::type>
+ typename = std::enable_if_t<
+ std::is_constructible<Expression, NumberType>::value>>
inline Expression
operator+(const NumberType &lhs, const Expression &rhs)
{
* scalar expressions using Expression more natural.
*/
template <typename NumberType,
- typename = typename std::enable_if<
- std::is_constructible<Expression, NumberType>::value>::type>
+ typename = std::enable_if_t<
+ std::is_constructible<Expression, NumberType>::value>>
inline Expression
operator+(const Expression &lhs, const NumberType &rhs)
{
* scalar expressions using Expression more natural.
*/
template <typename NumberType,
- typename = typename std::enable_if<
- std::is_constructible<Expression, NumberType>::value>::type>
+ typename = std::enable_if_t<
+ std::is_constructible<Expression, NumberType>::value>>
inline Expression
operator-(const NumberType &lhs, const Expression &rhs)
{
* scalar expressions using Expression more natural.
*/
template <typename NumberType,
- typename = typename std::enable_if<
- std::is_constructible<Expression, NumberType>::value>::type>
+ typename = std::enable_if_t<
+ std::is_constructible<Expression, NumberType>::value>>
inline Expression
operator-(const Expression &lhs, const NumberType &rhs)
{
* scalar expressions using Expression more natural.
*/
template <typename NumberType,
- typename = typename std::enable_if<
- std::is_constructible<Expression, NumberType>::value>::type>
+ typename = std::enable_if_t<
+ std::is_constructible<Expression, NumberType>::value>>
inline Expression
operator*(const NumberType &lhs, const Expression &rhs)
{
* scalar expressions using Expression more natural.
*/
template <typename NumberType,
- typename = typename std::enable_if<
- std::is_constructible<Expression, NumberType>::value>::type>
+ typename = std::enable_if_t<
+ std::is_constructible<Expression, NumberType>::value>>
inline Expression
operator*(const Expression &lhs, const NumberType &rhs)
{
* scalar expressions using Expression more natural.
*/
template <typename NumberType,
- typename = typename std::enable_if<
- std::is_constructible<Expression, NumberType>::value>::type>
+ typename = std::enable_if_t<
+ std::is_constructible<Expression, NumberType>::value>>
inline Expression
operator/(const NumberType &lhs, const Expression &rhs)
{
* scalar expressions using Expression more natural.
*/
template <typename NumberType,
- typename = typename std::enable_if<
- std::is_constructible<Expression, NumberType>::value>::type>
+ typename = std::enable_if_t<
+ std::is_constructible<Expression, NumberType>::value>>
inline Expression
operator/(const Expression &lhs, const NumberType &rhs)
{
return t;
}
- template <
- typename T,
- typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+ template <typename T,
+ typename = std::enable_if_t<std::is_arithmetic<T>::value>>
static Differentiation::SD::Expression
value(const T &t)
{
return Differentiation::SD::Expression(t);
}
- template <
- typename T,
- typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+ template <typename T,
+ typename = std::enable_if_t<std::is_arithmetic<T>::value>>
static Differentiation::SD::Expression
value(T &&t)
{
return Differentiation::SD::Expression(t);
}
- template <
- typename T,
- typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+ template <typename T,
+ typename = std::enable_if_t<std::is_arithmetic<T>::value>>
static Differentiation::SD::Expression
value(const std::complex<T> &t)
{
template <typename ReturnType_>
struct SupportedOptimizerTypeTraits<
ReturnType_,
- typename std::enable_if<std::is_arithmetic<ReturnType_>::value>::type>
+ std::enable_if_t<std::is_arithmetic<ReturnType_>::value>>
{
static const bool is_supported = true;
template <typename ReturnType_>
struct SupportedOptimizerTypeTraits<
ReturnType_,
- typename std::enable_if<
+ std::enable_if_t<
boost::is_complex<ReturnType_>::value &&
- std::is_arithmetic<typename ReturnType_::value_type>::value>::type>
+ std::is_arithmetic<typename ReturnType_::value_type>::value>>
{
static const bool is_supported = true;
template <typename ReturnType_>
- struct DictionaryOptimizer<
- ReturnType_,
- typename std::enable_if<
- SupportedOptimizerTypeTraits<ReturnType_>::is_supported>::type>
+ struct DictionaryOptimizer<ReturnType_,
+ std::enable_if_t<SupportedOptimizerTypeTraits<
+ ReturnType_>::is_supported>>
{
using ReturnType =
typename SupportedOptimizerTypeTraits<ReturnType_>::ReturnType;
template <typename ReturnType_>
- struct LambdaOptimizer<
- ReturnType_,
- typename std::enable_if<
- SupportedOptimizerTypeTraits<ReturnType_>::is_supported>::type>
+ struct LambdaOptimizer<ReturnType_,
+ std::enable_if_t<SupportedOptimizerTypeTraits<
+ ReturnType_>::is_supported>>
{
using ReturnType =
typename std::conditional<!boost::is_complex<ReturnType_>::value,
template <typename ReturnType_>
struct LLVMOptimizer<
ReturnType_,
- typename std::enable_if<std::is_arithmetic<ReturnType_>::value>::type>
+ std::enable_if_t<std::is_arithmetic<ReturnType_>::value>>
{
using ReturnType =
typename std::conditional<std::is_same<ReturnType_, float>::value,
template <typename ReturnType_>
struct LLVMOptimizer<
ReturnType_,
- typename std::enable_if<
+ std::enable_if_t<
boost::is_complex<ReturnType_>::value &&
- std::is_arithmetic<typename ReturnType_::value_type>::value>::type>
+ std::is_arithmetic<typename ReturnType_::value_type>::value>>
{
// Since there is no working implementation, these are dummy types
// that help with templating in the calling function.
template <typename ReturnType, typename Optimizer>
- struct OptimizerHelper<ReturnType,
- Optimizer,
- typename std::enable_if<std::is_same<
- ReturnType,
- typename Optimizer::ReturnType>::value>::type>
+ struct OptimizerHelper<
+ ReturnType,
+ Optimizer,
+ std::enable_if_t<
+ std::is_same<ReturnType, typename Optimizer::ReturnType>::value>>
{
/**
* Initialize an instance of an optimizer.
};
template <typename ReturnType, typename Optimizer>
- struct OptimizerHelper<ReturnType,
- Optimizer,
- typename std::enable_if<!std::is_same<
- ReturnType,
- typename Optimizer::ReturnType>::value>::type>
+ struct OptimizerHelper<
+ ReturnType,
+ Optimizer,
+ std::enable_if_t<
+ !std::is_same<ReturnType, typename Optimizer::ReturnType>::value>>
{
/**
* Initialize an instance of an optimizer.
struct GeneralProductTypeImpl<
T,
Differentiation::SD::Expression,
- typename std::enable_if<std::is_arithmetic<T>::value>::type>
+ std::enable_if_t<std::is_arithmetic<T>::value>>
{
using type = Differentiation::SD::Expression;
};
struct GeneralProductTypeImpl<
T,
Differentiation::SD::Expression,
- typename std::enable_if<
- boost::is_complex<T>::value &&
- std::is_arithmetic<typename T::value_type>::value>::type>
+ std::enable_if_t<boost::is_complex<T>::value &&
+ std::is_arithmetic<typename T::value_type>::value>>
{
using type = Differentiation::SD::Expression;
};
template <bool ignore_invalid_symbols = false,
typename ValueType = double,
typename SymbolicType,
- typename T = typename std::enable_if<
+ typename T = std::enable_if_t<
!std::is_base_of<Expression, SymbolicType>::value &&
dealii::internal::is_explicitly_convertible<
SymbolicType,
- const SymEngine::RCP<const SymEngine::Basic> &>::value>::type>
+ const SymEngine::RCP<const SymEngine::Basic> &>::value>>
void
add_to_symbol_map(types::substitution_map &symbol_map,
const SymbolicType & symbol);
*/
template <typename SymbolicType,
typename ValueType,
- typename T = typename std::enable_if<
+ typename T = std::enable_if_t<
dealii::internal::is_explicitly_convertible<
SymbolicType,
const SymEngine::RCP<const SymEngine::Basic> &>::value &&
- std::is_constructible<SymbolicType, ValueType>::value>::type>
+ std::is_constructible<SymbolicType, ValueType>::value>>
void
set_value_in_symbol_map(types::substitution_map &substitution_map,
const SymbolicType & symbol,
*/
template <typename ExpressionType,
typename ValueType,
- typename T = typename std::enable_if<
+ typename T = std::enable_if_t<
dealii::internal::is_explicitly_convertible<
ExpressionType,
const SymEngine::RCP<const SymEngine::Basic> &>::value &&
- std::is_constructible<ExpressionType, ValueType>::value>::type>
+ std::is_constructible<ExpressionType, ValueType>::value>>
types::substitution_map
make_substitution_map(const ExpressionType &symbol, const ValueType &value);
template <bool ignore_invalid_symbols = false,
typename ExpressionType,
typename ValueType,
- typename = typename std::enable_if<
+ typename = std::enable_if_t<
dealii::internal::is_explicitly_convertible<
ExpressionType,
const SymEngine::RCP<const SymEngine::Basic> &>::value &&
- std::is_constructible<ExpressionType, ValueType>::value>::type>
+ std::is_constructible<ExpressionType, ValueType>::value>>
void
add_to_substitution_map(types::substitution_map &substitution_map,
const ExpressionType & symbol,
template <bool ignore_invalid_symbols = false,
typename ExpressionType,
typename ValueType,
- typename = typename std::enable_if<
+ typename = std::enable_if_t<
dealii::internal::is_explicitly_convertible<
ExpressionType,
const SymEngine::RCP<const SymEngine::Basic> &>::value &&
- std::is_constructible<ExpressionType, ValueType>::value>::type>
+ std::is_constructible<ExpressionType, ValueType>::value>>
void
add_to_substitution_map(types::substitution_map & substitution_map,
const std::vector<ExpressionType> &symbols,
};
template <class VectorType>
- struct BlockTypeHelper<
- VectorType,
- typename std::enable_if<IsBlockVector<VectorType>::value>::type>
+ struct BlockTypeHelper<VectorType,
+ std::enable_if_t<IsBlockVector<VectorType>::value>>
{
using type = typename VectorType::BlockType;
};
namespace internal
{
template <int dim, int spacedim, class InVector>
- typename std::enable_if<is_serial_vector<InVector>::value>::type
+ std::enable_if_t<is_serial_vector<InVector>::value>
back_interpolate(
const DoFHandler<dim, spacedim> & dof1,
const AffineConstraints<typename InVector::value_type> &constraints1,
* Compare for equality.
*/
template <typename OtherAccessor = Accessor>
- typename std::enable_if<std::is_convertible<OtherAccessor, Accessor>::value,
- bool>::type
+ std::enable_if_t<std::is_convertible<OtherAccessor, Accessor>::value, bool>
operator==(const TriaRawIterator<OtherAccessor> &) const;
/**
template <typename Accessor>
template <typename OtherAccessor>
-inline
- typename std::enable_if<std::is_convertible<OtherAccessor, Accessor>::value,
- bool>::type
- TriaRawIterator<Accessor>::operator==(
- const TriaRawIterator<OtherAccessor> &other) const
+inline std::enable_if_t<std::is_convertible<OtherAccessor, Accessor>::value,
+ bool>
+TriaRawIterator<Accessor>::operator==(
+ const TriaRawIterator<OtherAccessor> &other) const
{
return accessor == other.accessor;
}
// LAPACKFullMatrix is only implemented for
// floats and doubles
template <typename number>
- struct Determinant<
- number,
- typename std::enable_if<std::is_same<number, float>::value ||
- std::is_same<number, double>::value>::type>
+ struct Determinant<number,
+ std::enable_if_t<std::is_same<number, float>::value ||
+ std::is_same<number, double>::value>>
{
#ifdef DEAL_II_WITH_LAPACK
static number
is_supported_operation<initialize_dof_vector_t, T>;
// Used for (Trilinos/PETSc)Wrappers::SparseMatrix
- template <
- typename MatrixType,
+ template <typename MatrixType,
#if !defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1900
- typename std::enable_if<has_get_mpi_communicator<MatrixType> &&
- has_locally_owned_domain_indices<MatrixType>,
+ std::enable_if_t<has_get_mpi_communicator<MatrixType> &&
+ has_locally_owned_domain_indices<MatrixType>,
#else
- // workaround for Intel 18
- typename std::enable_if<
- is_supported_operation<get_mpi_communicator_t, MatrixType> &&
- is_supported_operation<locally_owned_domain_indices_t, MatrixType>,
+ // workaround for Intel 18
+ std::enable_if_t<
+ is_supported_operation<get_mpi_communicator_t, MatrixType> &&
+ is_supported_operation<locally_owned_domain_indices_t,
+ MatrixType>,
#endif
- MatrixType>::type * = nullptr>
+ MatrixType> * = nullptr>
static void
reinit_domain_vector(MatrixType & mat,
LinearAlgebra::distributed::Vector<Number> &vec,
// Used for MatrixFree and DiagonalMatrix
template <typename MatrixType,
#if !defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1900
- typename std::enable_if<has_initialize_dof_vector<MatrixType>,
+ std::enable_if_t<has_initialize_dof_vector<MatrixType>,
#else
// workaround for Intel 18
- typename std::enable_if<
+ std::enable_if_t<
is_supported_operation<initialize_dof_vector_t, MatrixType>,
#endif
- MatrixType>::type * = nullptr>
+ MatrixType> * = nullptr>
static void
reinit_domain_vector(MatrixType & mat,
LinearAlgebra::distributed::Vector<Number> &vec,
}
// Used for (Trilinos/PETSc)Wrappers::SparseMatrix
- template <
- typename MatrixType,
+ template <typename MatrixType,
#if !defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1900
- typename std::enable_if<has_get_mpi_communicator<MatrixType> &&
- has_locally_owned_range_indices<MatrixType>,
+ std::enable_if_t<has_get_mpi_communicator<MatrixType> &&
+ has_locally_owned_range_indices<MatrixType>,
#else
- // workaround for Intel 18
- typename std::enable_if<
- is_supported_operation<get_mpi_communicator_t, MatrixType> &&
- is_supported_operation<locally_owned_range_indices_t, MatrixType>,
+ // workaround for Intel 18
+ std::enable_if_t<
+ is_supported_operation<get_mpi_communicator_t, MatrixType> &&
+ is_supported_operation<locally_owned_range_indices_t,
+ MatrixType>,
#endif
- MatrixType>::type * = nullptr>
+ MatrixType> * = nullptr>
static void
reinit_range_vector(MatrixType & mat,
LinearAlgebra::distributed::Vector<Number> &vec,
// Used for MatrixFree and DiagonalMatrix
template <typename MatrixType,
#if !defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1900
- typename std::enable_if<has_initialize_dof_vector<MatrixType>,
+ std::enable_if_t<has_initialize_dof_vector<MatrixType>,
#else
// workaround for Intel 18
- typename std::enable_if<
+ std::enable_if_t<
is_supported_operation<initialize_dof_vector_t, MatrixType>,
#endif
- MatrixType>::type * = nullptr>
+ MatrixType> * = nullptr>
static void
reinit_range_vector(MatrixType & mat,
LinearAlgebra::distributed::Vector<Number> &vec,
* object @p op for which the conversion function
* <code>linear_operator</code> is defined.
*/
- template <typename Op,
- typename = typename std::enable_if<
- !std::is_base_of<LinearOperator<Range, Domain, Payload>,
- Op>::value>::type>
+ template <
+ typename Op,
+ typename = std::enable_if_t<
+ !std::is_base_of<LinearOperator<Range, Domain, Payload>, Op>::value>>
LinearOperator(const Op &op)
{
*this = linear_operator<Range, Domain, Payload, Op>(op);
* Templated copy assignment operator for an object @p op for which the
* conversion function <code>linear_operator</code> is defined.
*/
- template <typename Op,
- typename = typename std::enable_if<
- !std::is_base_of<LinearOperator<Range, Domain, Payload>,
- Op>::value>::type>
+ template <
+ typename Op,
+ typename = std::enable_if_t<
+ !std::is_base_of<LinearOperator<Range, Domain, Payload>, Op>::value>>
LinearOperator<Range, Domain, Payload> &
operator=(const Op &op)
{
typename Payload = internal::LinearOperatorImplementation::EmptyPayload,
typename OperatorExemplar,
typename Matrix,
- typename =
- typename std::enable_if<!std::is_lvalue_reference<Matrix>::value>::type>
+ typename = std::enable_if_t<!std::is_lvalue_reference<Matrix>::value>>
LinearOperator<Range, Domain, Payload>
linear_operator(const OperatorExemplar &, Matrix &&) = delete;
typename Payload = internal::LinearOperatorImplementation::EmptyPayload,
typename OperatorExemplar,
typename Matrix,
- typename = typename std::enable_if<
- !std::is_lvalue_reference<OperatorExemplar>::value>::type,
- typename = typename std::enable_if<
+ typename =
+ std::enable_if_t<!std::is_lvalue_reference<OperatorExemplar>::value>,
+ typename = std::enable_if_t<
!std::is_same<OperatorExemplar,
- LinearOperator<Range, Domain, Payload>>::value>::type>
+ LinearOperator<Range, Domain, Payload>>::value>>
LinearOperator<Range, Domain, Payload>
linear_operator(OperatorExemplar &&, const Matrix &) = delete;
typename Payload = internal::LinearOperatorImplementation::EmptyPayload,
typename OperatorExemplar,
typename Matrix,
+ typename = std::enable_if_t<!std::is_lvalue_reference<Matrix>::value>,
typename =
- typename std::enable_if<!std::is_lvalue_reference<Matrix>::value>::type,
- typename = typename std::enable_if<
- !std::is_lvalue_reference<OperatorExemplar>::value>::type,
- typename = typename std::enable_if<
+ std::enable_if_t<!std::is_lvalue_reference<OperatorExemplar>::value>,
+ typename = std::enable_if_t<
!std::is_same<OperatorExemplar,
- LinearOperator<Range, Domain, Payload>>::value>::type>
+ LinearOperator<Range, Domain, Payload>>::value>>
LinearOperator<Range, Domain, Payload>
linear_operator(OperatorExemplar &&, Matrix &&) = delete;
typename Domain = Range,
typename Payload = internal::LinearOperatorImplementation::EmptyPayload,
typename Matrix,
- typename =
- typename std::enable_if<!std::is_lvalue_reference<Matrix>::value>::type>
+ typename = std::enable_if_t<!std::is_lvalue_reference<Matrix>::value>>
LinearOperator<Range, Domain, Payload>
linear_operator(const LinearOperator<Range, Domain, Payload> &,
Matrix &&) = delete;
typename Domain = Range,
typename Payload = internal::LinearOperatorImplementation::EmptyPayload,
typename Matrix,
- typename =
- typename std::enable_if<!std::is_lvalue_reference<Matrix>::value>::type>
+ typename = std::enable_if_t<!std::is_lvalue_reference<Matrix>::value>>
LinearOperator<Range, Domain, Payload>
linear_operator(Matrix &&) = delete;
-template <typename Payload,
- typename Solver,
- typename Preconditioner,
- typename Range = typename Solver::vector_type,
- typename Domain = Range,
- typename = typename std::enable_if<
- !std::is_lvalue_reference<Preconditioner>::value>::type,
- typename = typename std::enable_if<
- !std::is_same<Preconditioner, PreconditionIdentity>::value>::type,
- typename = typename std::enable_if<
- !std::is_same<Preconditioner,
- LinearOperator<Range, Domain, Payload>>::value>::type>
+template <
+ typename Payload,
+ typename Solver,
+ typename Preconditioner,
+ typename Range = typename Solver::vector_type,
+ typename Domain = Range,
+ typename = std::enable_if_t<!std::is_lvalue_reference<Preconditioner>::value>,
+ typename = std::enable_if_t<
+ !std::is_same<Preconditioner, PreconditionIdentity>::value>,
+ typename = std::enable_if_t<
+ !std::is_same<Preconditioner,
+ LinearOperator<Range, Domain, Payload>>::value>>
LinearOperator<Domain, Range, Payload>
inverse_operator(const LinearOperator<Range, Domain, Payload> &,
Solver &,
* @ingroup LAOperators
*/
-template <typename Range,
- typename = typename std::enable_if<
- internal::PackagedOperationImplementation::has_vector_interface<
- Range>::type::value>::type>
+template <
+ typename Range,
+ typename = std::enable_if_t<internal::PackagedOperationImplementation::
+ has_vector_interface<Range>::type::value>>
PackagedOperation<Range>
operator+(const Range &u, const Range &v)
{
* @ingroup LAOperators
*/
-template <typename Range,
- typename = typename std::enable_if<
- internal::PackagedOperationImplementation::has_vector_interface<
- Range>::type::value>::type>
+template <
+ typename Range,
+ typename = std::enable_if_t<internal::PackagedOperationImplementation::
+ has_vector_interface<Range>::type::value>>
PackagedOperation<Range>
operator-(const Range &u, const Range &v)
{
*
* @ingroup LAOperators
*/
-template <typename Range,
- typename = typename std::enable_if<
- internal::PackagedOperationImplementation::has_vector_interface<
- Range>::type::value>::type>
+template <
+ typename Range,
+ typename = std::enable_if_t<internal::PackagedOperationImplementation::
+ has_vector_interface<Range>::type::value>>
PackagedOperation<Range>
operator*(const Range &u, typename Range::value_type number)
{
*
* @ingroup LAOperators
*/
-template <typename Range,
- typename = typename std::enable_if<
- internal::PackagedOperationImplementation::has_vector_interface<
- Range>::type::value>::type>
+template <
+ typename Range,
+ typename = std::enable_if_t<internal::PackagedOperationImplementation::
+ has_vector_interface<Range>::type::value>>
PackagedOperation<Range>
operator*(typename Range::value_type number, const Range &u)
{
}
template <typename VectorType,
- typename std::enable_if<has_jacobi_step<MatrixType, VectorType>,
- MatrixType>::type * = nullptr>
+ std::enable_if_t<has_jacobi_step<MatrixType, VectorType>,
+ MatrixType> * = nullptr>
void
step(VectorType &dst, const VectorType &src) const
{
this->A->Jacobi_step(dst, src, this->relaxation);
}
- template <
- typename VectorType,
- typename std::enable_if<!has_jacobi_step<MatrixType, VectorType>,
- MatrixType>::type * = nullptr>
+ template <typename VectorType,
+ std::enable_if_t<!has_jacobi_step<MatrixType, VectorType>,
+ MatrixType> * = nullptr>
void
step(VectorType &, const VectorType &) const
{
}
template <typename VectorType,
- typename std::enable_if<has_SOR_step<MatrixType, VectorType>,
- MatrixType>::type * = nullptr>
+ std::enable_if_t<has_SOR_step<MatrixType, VectorType>,
+ MatrixType> * = nullptr>
void
step(VectorType &dst, const VectorType &src) const
{
}
template <typename VectorType,
- typename std::enable_if<!has_SOR_step<MatrixType, VectorType>,
- MatrixType>::type * = nullptr>
+ std::enable_if_t<!has_SOR_step<MatrixType, VectorType>,
+ MatrixType> * = nullptr>
void
step(VectorType &, const VectorType &) const
{
}
template <typename VectorType,
- typename std::enable_if<has_SOR_step<MatrixType, VectorType>,
- MatrixType>::type * = nullptr>
+ std::enable_if_t<has_SOR_step<MatrixType, VectorType>,
+ MatrixType> * = nullptr>
void
Tstep(VectorType &dst, const VectorType &src) const
{
}
template <typename VectorType,
- typename std::enable_if<!has_SOR_step<MatrixType, VectorType>,
- MatrixType>::type * = nullptr>
+ std::enable_if_t<!has_SOR_step<MatrixType, VectorType>,
+ MatrixType> * = nullptr>
void
Tstep(VectorType &, const VectorType &) const
{
}
template <typename VectorType,
- typename std::enable_if<has_SSOR_step<MatrixType, VectorType>,
- MatrixType>::type * = nullptr>
+ std::enable_if_t<has_SSOR_step<MatrixType, VectorType>,
+ MatrixType> * = nullptr>
void
step(VectorType &dst, const VectorType &src) const
{
}
template <typename VectorType,
- typename std::enable_if<!has_SSOR_step<MatrixType, VectorType>,
- MatrixType>::type * = nullptr>
+ std::enable_if_t<!has_SSOR_step<MatrixType, VectorType>,
+ MatrixType> * = nullptr>
void
step(VectorType &, const VectorType &) const
{
const std::vector<size_type> &inverse_permutation;
};
- template <
- typename MatrixType,
- typename PreconditionerType,
- typename VectorType,
- typename std::enable_if<has_step_omega<PreconditionerType, VectorType>,
- PreconditionerType>::type * = nullptr>
+ template <typename MatrixType,
+ typename PreconditionerType,
+ typename VectorType,
+ std::enable_if_t<has_step_omega<PreconditionerType, VectorType>,
+ PreconditionerType> * = nullptr>
void
step(const MatrixType &,
const PreconditionerType &preconditioner,
typename MatrixType,
typename PreconditionerType,
typename VectorType,
- typename std::enable_if<!has_step_omega<PreconditionerType, VectorType> &&
- has_step<PreconditionerType, VectorType>,
- PreconditionerType>::type * = nullptr>
+ std::enable_if_t<!has_step_omega<PreconditionerType, VectorType> &&
+ has_step<PreconditionerType, VectorType>,
+ PreconditionerType> * = nullptr>
void
step(const MatrixType &,
const PreconditionerType &preconditioner,
typename MatrixType,
typename PreconditionerType,
typename VectorType,
- typename std::enable_if<!has_step_omega<PreconditionerType, VectorType> &&
- !has_step<PreconditionerType, VectorType>,
- PreconditionerType>::type * = nullptr>
+ std::enable_if_t<!has_step_omega<PreconditionerType, VectorType> &&
+ !has_step<PreconditionerType, VectorType>,
+ PreconditionerType> * = nullptr>
void
step(const MatrixType & A,
const PreconditionerType &preconditioner,
dst.add(relaxation, tmp);
}
- template <
- typename MatrixType,
- typename PreconditionerType,
- typename VectorType,
- typename std::enable_if<has_Tstep_omega<PreconditionerType, VectorType>,
- PreconditionerType>::type * = nullptr>
+ template <typename MatrixType,
+ typename PreconditionerType,
+ typename VectorType,
+ std::enable_if_t<has_Tstep_omega<PreconditionerType, VectorType>,
+ PreconditionerType> * = nullptr>
void
Tstep(const MatrixType &,
const PreconditionerType &preconditioner,
preconditioner.Tstep(dst, src, relaxation);
}
- template <typename MatrixType,
- typename PreconditionerType,
- typename VectorType,
- typename std::enable_if<
- !has_Tstep_omega<PreconditionerType, VectorType> &&
- has_Tstep<PreconditionerType, VectorType>,
- PreconditionerType>::type * = nullptr>
+ template <
+ typename MatrixType,
+ typename PreconditionerType,
+ typename VectorType,
+ std::enable_if_t<!has_Tstep_omega<PreconditionerType, VectorType> &&
+ has_Tstep<PreconditionerType, VectorType>,
+ PreconditionerType> * = nullptr>
void
Tstep(const MatrixType &,
const PreconditionerType &preconditioner,
template <typename MatrixType,
typename VectorType,
- typename std::enable_if<has_Tvmult<MatrixType, VectorType>,
- MatrixType>::type * = nullptr>
+ std::enable_if_t<has_Tvmult<MatrixType, VectorType>, MatrixType>
+ * = nullptr>
void
Tvmult(const MatrixType &A, VectorType &dst, const VectorType &src)
{
template <typename MatrixType,
typename VectorType,
- typename std::enable_if<!has_Tvmult<MatrixType, VectorType>,
- MatrixType>::type * = nullptr>
+ std::enable_if_t<!has_Tvmult<MatrixType, VectorType>, MatrixType>
+ * = nullptr>
void
Tvmult(const MatrixType &, VectorType &, const VectorType &)
{
ExcMessage("Matrix A does not provide a Tvmult() function!"));
}
- template <typename MatrixType,
- typename PreconditionerType,
- typename VectorType,
- typename std::enable_if<
- !has_Tstep_omega<PreconditionerType, VectorType> &&
- !has_Tstep<PreconditionerType, VectorType>,
- PreconditionerType>::type * = nullptr>
+ template <
+ typename MatrixType,
+ typename PreconditionerType,
+ typename VectorType,
+ std::enable_if_t<!has_Tstep_omega<PreconditionerType, VectorType> &&
+ !has_Tstep<PreconditionerType, VectorType>,
+ PreconditionerType> * = nullptr>
void
Tstep(const MatrixType & A,
const PreconditionerType &preconditioner,
template <typename MatrixType,
typename VectorType,
- typename std::enable_if<!IsBlockVector<VectorType>::value,
- VectorType>::type * = nullptr>
+ std::enable_if_t<!IsBlockVector<VectorType>::value, VectorType>
+ * = nullptr>
void
step_operations(const MatrixType & A,
const DiagonalMatrix<VectorType> &preconditioner,
typename MatrixType,
typename VectorType,
typename PreconditionerType,
- typename std::enable_if<!has_vmult_with_std_functions<MatrixType,
- VectorType,
- PreconditionerType>,
- int>::type * = nullptr>
+ std::enable_if_t<!has_vmult_with_std_functions<MatrixType,
+ VectorType,
+ PreconditionerType>,
+ int> * = nullptr>
inline void
vmult_and_update(const MatrixType & matrix,
const PreconditionerType &preconditioner,
solution);
}
- template <
- typename MatrixType,
- typename VectorType,
- typename PreconditionerType,
- typename std::enable_if<has_vmult_with_std_functions<MatrixType,
- VectorType,
- PreconditionerType>,
- int>::type * = nullptr>
+ template <typename MatrixType,
+ typename VectorType,
+ typename PreconditionerType,
+ std::enable_if_t<has_vmult_with_std_functions<MatrixType,
+ VectorType,
+ PreconditionerType>,
+ int> * = nullptr>
inline void
vmult_and_update(const MatrixType & matrix,
const PreconditionerType &preconditioner,
VectorType,
MatrixType,
PreconditionerType,
- typename std::enable_if<has_vmult_functions<MatrixType, VectorType> &&
- (has_apply_to_subrange<PreconditionerType> ||
- has_apply<PreconditionerType>)&&std::
- is_same<VectorType,
- LinearAlgebra::distributed::Vector<
- typename VectorType::value_type,
- MemorySpace::Host>>::value,
- int>::type>
+ std::enable_if_t<has_vmult_functions<MatrixType, VectorType> &&
+ (has_apply_to_subrange<PreconditionerType> ||
+ has_apply<PreconditionerType>)&&std::
+ is_same<VectorType,
+ LinearAlgebra::distributed::Vector<
+ typename VectorType::value_type,
+ MemorySpace::Host>>::value,
+ int>>
: public IterationWorkerBase<VectorType, MatrixType, PreconditionerType>
{
using Number = typename VectorType::value_type;
// Function that we use if the PreconditionerType implements an apply()
// function
template <typename U = void>
- typename std::enable_if<has_apply<PreconditionerType>, U>::type
+ std::enable_if_t<has_apply<PreconditionerType>, U>
operation_before_loop(const unsigned int iteration_index,
const unsigned int start_range,
const unsigned int end_range) const
// Function that we use if the PreconditionerType implements an apply()
// function
template <typename U = void>
- typename std::enable_if<has_apply<PreconditionerType>, U>::type
+ std::enable_if_t<has_apply<PreconditionerType>, U>
operation_after_loop(
const unsigned int start_range,
const unsigned int end_range,
// Function that we use if the PreconditionerType implements an apply()
// function
template <typename U = void>
- typename std::enable_if<has_apply<PreconditionerType>, U>::type
+ std::enable_if_t<has_apply<PreconditionerType>, U>
finalize_after_convergence(const unsigned int iteration_index)
{
if (iteration_index % 2 == 1 || iteration_index == 2)
// apply() function, where we instead need to choose the
// apply_to_subrange function
template <typename U = void>
- typename std::enable_if<!has_apply<PreconditionerType>, U>::type
+ std::enable_if_t<!has_apply<PreconditionerType>, U>
operation_before_loop(const unsigned int iteration_index,
const unsigned int start_range,
const unsigned int end_range) const
// apply() function and where we instead need to use the
// apply_to_subrange function
template <typename U = void>
- typename std::enable_if<!has_apply<PreconditionerType>, U>::type
+ std::enable_if_t<!has_apply<PreconditionerType>, U>
operation_after_loop(
const unsigned int start_range,
const unsigned int end_range,
// apply() function, where we instead need to choose the
// apply_to_subrange function
template <typename U = void>
- typename std::enable_if<!has_apply<PreconditionerType>, U>::type
+ std::enable_if_t<!has_apply<PreconditionerType>, U>
finalize_after_convergence(const unsigned int iteration_index)
{
if (iteration_index % 2 == 1 || iteration_index == 2)
using size_type = types::global_dof_index;
template <typename T>
- typename std::enable_if<std::is_trivial<T>::value>::type
+ std::enable_if_t<std::is_trivial<T>::value>
zero_subrange(const size_type begin, const size_type end, T *dst)
{
std::memset(dst + begin, 0, (end - begin) * sizeof(T));
}
template <typename T>
- typename std::enable_if<!std::is_trivial<T>::value>::type
+ std::enable_if_t<!std::is_trivial<T>::value>
zero_subrange(const size_type begin, const size_type end, T *dst)
{
std::fill(dst + begin, dst + end, 0);
* processors in order to avoid a dead lock.
*/
template <typename SparsityPatternType>
- typename std::enable_if<
- !std::is_same<SparsityPatternType,
- dealii::SparseMatrix<double>>::value>::type
+ std::enable_if_t<
+ !std::is_same<SparsityPatternType, dealii::SparseMatrix<double>>::value>
reinit(const IndexSet & row_parallel_partitioning,
const IndexSet & col_parallel_partitioning,
const SparsityPatternType &sparsity_pattern,
* distributed. Otherwise, an exception will be thrown.
*/
template <typename VectorType>
- typename std::enable_if<std::is_same<typename VectorType::value_type,
- TrilinosScalar>::value>::type
+ std::enable_if_t<
+ std::is_same<typename VectorType::value_type, TrilinosScalar>::value>
vmult(VectorType &dst, const VectorType &src) const;
/**
* Despite looking complicated, the return type is just `void`.
*/
template <typename VectorType>
- typename std::enable_if<!std::is_same<typename VectorType::value_type,
- TrilinosScalar>::value>::type
+ std::enable_if_t<
+ !std::is_same<typename VectorType::value_type, TrilinosScalar>::value>
vmult(VectorType &dst, const VectorType &src) const;
/**
* Despite looking complicated, the return type is just `void`.
*/
template <typename VectorType>
- typename std::enable_if<std::is_same<typename VectorType::value_type,
- TrilinosScalar>::value>::type
+ std::enable_if_t<
+ std::is_same<typename VectorType::value_type, TrilinosScalar>::value>
Tvmult(VectorType &dst, const VectorType &src) const;
/**
* Despite looking complicated, the return type is just `void`.
*/
template <typename VectorType>
- typename std::enable_if<!std::is_same<typename VectorType::value_type,
- TrilinosScalar>::value>::type
+ std::enable_if_t<
+ !std::is_same<typename VectorType::value_type, TrilinosScalar>::value>
Tvmult(VectorType &dst, const VectorType &src) const;
/**
* 2. the @p Preconditioner derives from TrilinosWrappers::PreconditionBase.
*/
template <typename Solver, typename Preconditioner>
- typename std::enable_if<
+ std::enable_if_t<
std::is_base_of<TrilinosWrappers::SolverBase, Solver>::value &&
std::is_base_of<TrilinosWrappers::PreconditionBase,
Preconditioner>::value,
- TrilinosPayload>::type
+ TrilinosPayload>
inverse_payload(Solver &, const Preconditioner &) const;
/**
* TrilinosWrappers::PreconditionBase.
*/
template <typename Solver, typename Preconditioner>
- typename std::enable_if<
+ std::enable_if_t<
!(std::is_base_of<TrilinosWrappers::SolverBase, Solver>::value &&
std::is_base_of<TrilinosWrappers::PreconditionBase,
Preconditioner>::value),
- TrilinosPayload>::type
+ TrilinosPayload>
inverse_payload(Solver &, const Preconditioner &) const;
//@}
template <typename Solver, typename Preconditioner>
- typename std::enable_if<
+ std::enable_if_t<
std::is_base_of<TrilinosWrappers::SolverBase, Solver>::value &&
std::is_base_of<TrilinosWrappers::PreconditionBase,
Preconditioner>::value,
- TrilinosPayload>::type
+ TrilinosPayload>
TrilinosPayload::inverse_payload(
Solver & solver,
const Preconditioner &preconditioner) const
}
template <typename Solver, typename Preconditioner>
- typename std::enable_if<
+ std::enable_if_t<
!(std::is_base_of<TrilinosWrappers::SolverBase, Solver>::value &&
std::is_base_of<TrilinosWrappers::PreconditionBase,
Preconditioner>::value),
- TrilinosPayload>::type
+ TrilinosPayload>
TrilinosPayload::inverse_payload(Solver &, const Preconditioner &) const
{
TrilinosPayload return_op(*this);
::dealii::MemorySpace::MemorySpaceData<Number,
::dealii::MemorySpace::Host>
&data,
- typename std::enable_if<
+ std::enable_if_t<
std::is_same<MemorySpace2, dealii::MemorySpace::Host>::value,
- int>::type = 0)
+ int> = 0)
{
if (operation == VectorOperation::insert)
{
::dealii::MemorySpace::MemorySpaceData<Number,
::dealii::MemorySpace::Host>
&data,
- typename std::enable_if<
+ std::enable_if_t<
std::is_same<MemorySpace2, ::dealii::MemorySpace::CUDA>::value,
- int>::type = 0)
+ int> = 0)
{
if (operation == VectorOperation::insert)
{
::dealii::MemorySpace::MemorySpaceData<Number,
::dealii::MemorySpace::CUDA>
&data,
- typename std::enable_if<
+ std::enable_if_t<
std::is_same<MemorySpace2, ::dealii::MemorySpace::CUDA>::value,
- int>::type = 0)
+ int> = 0)
{
if (operation == VectorOperation::insert)
{
::dealii::MemorySpace::MemorySpaceData<Number,
::dealii::MemorySpace::CUDA>
&data,
- typename std::enable_if<
+ std::enable_if_t<
std::is_same<MemorySpace2, ::dealii::MemorySpace::Host>::value,
- int>::type = 0)
+ int> = 0)
{
if (operation == VectorOperation::insert)
{
const FEEvaluationData<dim, Number, false> &fe_eval,
const Number * in_array,
Number * out_array,
- typename std::enable_if<fe_degree != -1>::type * = nullptr)
+ std::enable_if_t<fe_degree != -1> * = nullptr)
{
constexpr unsigned int dofs_per_component =
Utilities::pow(fe_degree + 1, dim);
const FEEvaluationData<dim, Number, false> &fe_eval,
const Number * in_array,
Number * out_array,
- typename std::enable_if<fe_degree == -1>::type * = nullptr)
+ std::enable_if_t<fe_degree == -1> * = nullptr)
{
static_assert(fe_degree == -1, "Only usable for degree -1");
const unsigned int dofs_per_component =
const AlignedVector<Number> &inverse_coefficients,
const Number * in_array,
Number * out_array,
- typename std::enable_if<fe_degree != -1>::type * = nullptr)
+ std::enable_if_t<fe_degree != -1> * = nullptr)
{
constexpr unsigned int dofs_per_component =
Utilities::pow(fe_degree + 1, dim);
const AlignedVector<Number> &,
const Number *,
Number *,
- typename std::enable_if<fe_degree == -1>::type * = nullptr)
+ std::enable_if_t<fe_degree == -1> * = nullptr)
{
static_assert(fe_degree == -1, "Only usable for degree -1");
Assert(false, ExcNotImplemented());
namespace internal
{
- template <typename Number,
- typename VectorType,
- typename std::enable_if<!IsBlockVector<VectorType>::value,
- VectorType>::type * = nullptr>
+ template <
+ typename Number,
+ typename VectorType,
+ std::enable_if_t<!IsBlockVector<VectorType>::value, VectorType> * = nullptr>
decltype(std::declval<VectorType>().begin())
get_beginning(VectorType &vec)
{
return vec.begin();
}
- template <typename Number,
- typename VectorType,
- typename std::enable_if<IsBlockVector<VectorType>::value,
- VectorType>::type * = nullptr>
+ template <
+ typename Number,
+ typename VectorType,
+ std::enable_if_t<IsBlockVector<VectorType>::value, VectorType> * = nullptr>
typename VectorType::value_type *
get_beginning(VectorType &)
{
}
template <typename VectorType,
- typename std::enable_if<has_shared_vector_data<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<has_shared_vector_data<VectorType>, VectorType> * =
+ nullptr>
const std::vector<ArrayView<const typename VectorType::value_type>> *
get_shared_vector_data(VectorType & vec,
const bool is_valid_mode_for_sm,
}
template <typename VectorType,
- typename std::enable_if<!has_shared_vector_data<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<!has_shared_vector_data<VectorType>, VectorType>
+ * = nullptr>
const std::vector<ArrayView<const typename VectorType::value_type>> *
get_shared_vector_data(VectorType &,
const bool,
typename VectorizedArrayType,
typename VectorType,
typename EvaluatorType,
- typename std::enable_if<internal::has_begin<VectorType> &&
- !IsBlockVector<VectorType>::value,
- VectorType>::type * = nullptr>
+ std::enable_if_t<internal::has_begin<VectorType> &&
+ !IsBlockVector<VectorType>::value,
+ VectorType> * = nullptr>
VectorizedArrayType *
check_vector_access_inplace(const EvaluatorType &fe_eval, VectorType &vector)
{
typename VectorizedArrayType,
typename VectorType,
typename EvaluatorType,
- typename std::enable_if<!internal::has_begin<VectorType> ||
- IsBlockVector<VectorType>::value,
- VectorType>::type * = nullptr>
+ std::enable_if_t<!internal::has_begin<VectorType> ||
+ IsBlockVector<VectorType>::value,
+ VectorType> * = nullptr>
VectorizedArrayType *
check_vector_access_inplace(const EvaluatorType &, VectorType &)
{
* Start update_ghost_value for serial vectors
*/
template <typename VectorType,
- typename std::enable_if<is_not_parallel_vector<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<is_not_parallel_vector<VectorType>, VectorType>
+ * = nullptr>
void
update_ghost_values_start(const unsigned int /*component_in_block_vector*/,
const VectorType & /*vec*/)
* Start update_ghost_value for vectors that do not support
* the split into _start() and finish() stages
*/
- template <
- typename VectorType,
- typename std::enable_if<!has_update_ghost_values_start<VectorType> &&
- !is_not_parallel_vector<VectorType>,
- VectorType>::type * = nullptr>
+ template <typename VectorType,
+ std::enable_if_t<!has_update_ghost_values_start<VectorType> &&
+ !is_not_parallel_vector<VectorType>,
+ VectorType> * = nullptr>
void
update_ghost_values_start(const unsigned int component_in_block_vector,
const VectorType & vec)
* the split into _start() and finish() stages, but don't support
* exchange on a subset of DoFs
*/
- template <
- typename VectorType,
- typename std::enable_if<has_update_ghost_values_start<VectorType> &&
- !has_exchange_on_subset<VectorType>,
- VectorType>::type * = nullptr>
+ template <typename VectorType,
+ std::enable_if_t<has_update_ghost_values_start<VectorType> &&
+ !has_exchange_on_subset<VectorType>,
+ VectorType> * = nullptr>
void
update_ghost_values_start(const unsigned int component_in_block_vector,
const VectorType & vec)
* exchange on a subset of DoFs,
* i.e. LinearAlgebra::distributed::Vector
*/
- template <
- typename VectorType,
- typename std::enable_if<has_update_ghost_values_start<VectorType> &&
- has_exchange_on_subset<VectorType>,
- VectorType>::type * = nullptr>
+ template <typename VectorType,
+ std::enable_if_t<has_update_ghost_values_start<VectorType> &&
+ has_exchange_on_subset<VectorType>,
+ VectorType> * = nullptr>
void
update_ghost_values_start(const unsigned int component_in_block_vector,
const VectorType & vec)
* Finish update_ghost_value for vectors that do not support
* the split into _start() and finish() stages and serial vectors
*/
- template <
- typename VectorType,
- typename std::enable_if<!has_update_ghost_values_start<VectorType>,
- VectorType>::type * = nullptr>
+ template <typename VectorType,
+ std::enable_if_t<!has_update_ghost_values_start<VectorType>,
+ VectorType> * = nullptr>
void
update_ghost_values_finish(const unsigned int /*component_in_block_vector*/,
const VectorType & /*vec*/)
* the split into _start() and finish() stages, but don't support
* exchange on a subset of DoFs
*/
- template <
- typename VectorType,
- typename std::enable_if<has_update_ghost_values_start<VectorType> &&
- !has_exchange_on_subset<VectorType>,
- VectorType>::type * = nullptr>
+ template <typename VectorType,
+ std::enable_if_t<has_update_ghost_values_start<VectorType> &&
+ !has_exchange_on_subset<VectorType>,
+ VectorType> * = nullptr>
void
update_ghost_values_finish(const unsigned int component_in_block_vector,
const VectorType & vec)
* exchange on a subset of DoFs,
* i.e. LinearAlgebra::distributed::Vector
*/
- template <
- typename VectorType,
- typename std::enable_if<has_update_ghost_values_start<VectorType> &&
- has_exchange_on_subset<VectorType>,
- VectorType>::type * = nullptr>
+ template <typename VectorType,
+ std::enable_if_t<has_update_ghost_values_start<VectorType> &&
+ has_exchange_on_subset<VectorType>,
+ VectorType> * = nullptr>
void
update_ghost_values_finish(const unsigned int component_in_block_vector,
const VectorType & vec)
* Start compress for serial vectors
*/
template <typename VectorType,
- typename std::enable_if<is_not_parallel_vector<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<is_not_parallel_vector<VectorType>, VectorType>
+ * = nullptr>
void
compress_start(const unsigned int /*component_in_block_vector*/,
VectorType & /*vec*/)
* the split into _start() and finish() stages
*/
template <typename VectorType,
- typename std::enable_if<!has_compress_start<VectorType> &&
- !is_not_parallel_vector<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<!has_compress_start<VectorType> &&
+ !is_not_parallel_vector<VectorType>,
+ VectorType> * = nullptr>
void
compress_start(const unsigned int component_in_block_vector,
VectorType & vec)
* exchange on a subset of DoFs
*/
template <typename VectorType,
- typename std::enable_if<has_compress_start<VectorType> &&
- !has_exchange_on_subset<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<has_compress_start<VectorType> &&
+ !has_exchange_on_subset<VectorType>,
+ VectorType> * = nullptr>
void
compress_start(const unsigned int component_in_block_vector,
VectorType & vec)
* i.e. LinearAlgebra::distributed::Vector
*/
template <typename VectorType,
- typename std::enable_if<has_compress_start<VectorType> &&
- has_exchange_on_subset<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<has_compress_start<VectorType> &&
+ has_exchange_on_subset<VectorType>,
+ VectorType> * = nullptr>
void
compress_start(const unsigned int component_in_block_vector,
VectorType & vec)
* Finish compress for vectors that do not support
* the split into _start() and finish() stages and serial vectors
*/
- template <typename VectorType,
- typename std::enable_if<!has_compress_start<VectorType>,
- VectorType>::type * = nullptr>
+ template <
+ typename VectorType,
+ std::enable_if_t<!has_compress_start<VectorType>, VectorType> * = nullptr>
void
compress_finish(const unsigned int /*component_in_block_vector*/,
VectorType & /*vec*/)
* exchange on a subset of DoFs
*/
template <typename VectorType,
- typename std::enable_if<has_compress_start<VectorType> &&
- !has_exchange_on_subset<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<has_compress_start<VectorType> &&
+ !has_exchange_on_subset<VectorType>,
+ VectorType> * = nullptr>
void
compress_finish(const unsigned int component_in_block_vector,
VectorType & vec)
* i.e. LinearAlgebra::distributed::Vector
*/
template <typename VectorType,
- typename std::enable_if<has_compress_start<VectorType> &&
- has_exchange_on_subset<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<has_compress_start<VectorType> &&
+ has_exchange_on_subset<VectorType>,
+ VectorType> * = nullptr>
void
compress_finish(const unsigned int component_in_block_vector,
VectorType & vec)
* Reset all ghost values for serial vectors
*/
template <typename VectorType,
- typename std::enable_if<is_not_parallel_vector<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<is_not_parallel_vector<VectorType>, VectorType>
+ * = nullptr>
void
reset_ghost_values(const VectorType & /*vec*/) const
{}
* exchange on a subset of DoFs
*/
template <typename VectorType,
- typename std::enable_if<!has_exchange_on_subset<VectorType> &&
- !is_not_parallel_vector<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<!has_exchange_on_subset<VectorType> &&
+ !is_not_parallel_vector<VectorType>,
+ VectorType> * = nullptr>
void
reset_ghost_values(const VectorType &vec) const
{
* LinearAlgebra::distributed::Vector
*/
template <typename VectorType,
- typename std::enable_if<has_exchange_on_subset<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<has_exchange_on_subset<VectorType>, VectorType>
+ * = nullptr>
void
reset_ghost_values(const VectorType &vec) const
{
* i.e. LinearAlgebra::distributed::Vector
*/
template <typename VectorType,
- typename std::enable_if<has_exchange_on_subset<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<has_exchange_on_subset<VectorType>, VectorType>
+ * = nullptr>
void
zero_vector_region(const unsigned int range_index, VectorType &vec) const
{
* vector type
*/
template <typename VectorType,
- typename std::enable_if<!has_exchange_on_subset<VectorType>,
- VectorType>::type * = nullptr,
- typename VectorType::value_type * = nullptr>
+ std::enable_if_t<!has_exchange_on_subset<VectorType>, VectorType>
+ * = nullptr,
+ typename VectorType::value_type * = nullptr>
void
zero_vector_region(const unsigned int range_index, VectorType &vec) const
{
// default value for vectors that do not have communication_block_size
template <typename VectorStruct,
- typename std::enable_if<!has_communication_block_size<VectorStruct>,
- VectorStruct>::type * = nullptr>
+ std::enable_if_t<!has_communication_block_size<VectorStruct>,
+ VectorStruct> * = nullptr>
constexpr unsigned int
get_communication_block_size(const VectorStruct &)
{
template <typename VectorStruct,
- typename std::enable_if<has_communication_block_size<VectorStruct>,
- VectorStruct>::type * = nullptr>
+ std::enable_if_t<has_communication_block_size<VectorStruct>,
+ VectorStruct> * = nullptr>
constexpr unsigned int
get_communication_block_size(const VectorStruct &)
{
typename VectorStruct,
typename Number,
typename VectorizedArrayType,
- typename std::enable_if<IsBlockVector<VectorStruct>::value,
- VectorStruct>::type * = nullptr>
+ std::enable_if_t<IsBlockVector<VectorStruct>::value, VectorStruct>
+ * = nullptr>
void
update_ghost_values_start(
const VectorStruct & vec,
typename VectorStruct,
typename Number,
typename VectorizedArrayType,
- typename std::enable_if<!IsBlockVector<VectorStruct>::value,
- VectorStruct>::type * = nullptr>
+ std::enable_if_t<!IsBlockVector<VectorStruct>::value, VectorStruct>
+ * = nullptr>
void
update_ghost_values_start(
const VectorStruct & vec,
typename VectorStruct,
typename Number,
typename VectorizedArrayType,
- typename std::enable_if<IsBlockVector<VectorStruct>::value,
- VectorStruct>::type * = nullptr>
+ std::enable_if_t<IsBlockVector<VectorStruct>::value, VectorStruct>
+ * = nullptr>
void
update_ghost_values_finish(
const VectorStruct & vec,
typename VectorStruct,
typename Number,
typename VectorizedArrayType,
- typename std::enable_if<!IsBlockVector<VectorStruct>::value,
- VectorStruct>::type * = nullptr>
+ std::enable_if_t<!IsBlockVector<VectorStruct>::value, VectorStruct>
+ * = nullptr>
void
update_ghost_values_finish(
const VectorStruct & vec,
typename VectorStruct,
typename Number,
typename VectorizedArrayType,
- typename std::enable_if<IsBlockVector<VectorStruct>::value,
- VectorStruct>::type * = nullptr>
+ std::enable_if_t<IsBlockVector<VectorStruct>::value, VectorStruct>
+ * = nullptr>
inline void
compress_start(
VectorStruct & vec,
typename VectorStruct,
typename Number,
typename VectorizedArrayType,
- typename std::enable_if<!IsBlockVector<VectorStruct>::value,
- VectorStruct>::type * = nullptr>
+ std::enable_if_t<!IsBlockVector<VectorStruct>::value, VectorStruct>
+ * = nullptr>
inline void
compress_start(
VectorStruct & vec,
typename VectorStruct,
typename Number,
typename VectorizedArrayType,
- typename std::enable_if<IsBlockVector<VectorStruct>::value,
- VectorStruct>::type * = nullptr>
+ std::enable_if_t<IsBlockVector<VectorStruct>::value, VectorStruct>
+ * = nullptr>
inline void
compress_finish(
VectorStruct & vec,
typename VectorStruct,
typename Number,
typename VectorizedArrayType,
- typename std::enable_if<!IsBlockVector<VectorStruct>::value,
- VectorStruct>::type * = nullptr>
+ std::enable_if_t<!IsBlockVector<VectorStruct>::value, VectorStruct>
+ * = nullptr>
inline void
compress_finish(
VectorStruct & vec,
typename VectorStruct,
typename Number,
typename VectorizedArrayType,
- typename std::enable_if<IsBlockVector<VectorStruct>::value,
- VectorStruct>::type * = nullptr>
+ std::enable_if_t<IsBlockVector<VectorStruct>::value, VectorStruct>
+ * = nullptr>
inline void
reset_ghost_values(
const VectorStruct & vec,
typename VectorStruct,
typename Number,
typename VectorizedArrayType,
- typename std::enable_if<!IsBlockVector<VectorStruct>::value,
- VectorStruct>::type * = nullptr>
+ std::enable_if_t<!IsBlockVector<VectorStruct>::value, VectorStruct>
+ * = nullptr>
inline void
reset_ghost_values(
const VectorStruct & vec,
typename VectorStruct,
typename Number,
typename VectorizedArrayType,
- typename std::enable_if<IsBlockVector<VectorStruct>::value,
- VectorStruct>::type * = nullptr>
+ std::enable_if_t<IsBlockVector<VectorStruct>::value, VectorStruct>
+ * = nullptr>
inline void
zero_vector_region(
const unsigned int range_index,
typename VectorStruct,
typename Number,
typename VectorizedArrayType,
- typename std::enable_if<!IsBlockVector<VectorStruct>::value,
- VectorStruct>::type * = nullptr>
+ std::enable_if_t<!IsBlockVector<VectorStruct>::value, VectorStruct>
+ * = nullptr>
inline void
zero_vector_region(
const unsigned int range_index,
// a non-block vector has one block and the only subblock is the vector
// itself
template <typename VectorType>
- typename std::enable_if<IsBlockVector<VectorType>::value,
- unsigned int>::type
+ std::enable_if_t<IsBlockVector<VectorType>::value, unsigned int>
n_blocks(const VectorType &vector)
{
return vector.n_blocks();
}
template <typename VectorType>
- typename std::enable_if<!IsBlockVector<VectorType>::value,
- unsigned int>::type
+ std::enable_if_t<!IsBlockVector<VectorType>::value, unsigned int>
n_blocks(const VectorType &)
{
return 1;
}
template <typename VectorType>
- typename std::enable_if<IsBlockVector<VectorType>::value,
- typename VectorType::BlockType &>::type
+ std::enable_if_t<IsBlockVector<VectorType>::value,
+ typename VectorType::BlockType &>
subblock(VectorType &vector, unsigned int block_no)
{
AssertIndexRange(block_no, vector.n_blocks());
}
template <typename VectorType>
- typename std::enable_if<IsBlockVector<VectorType>::value,
- const typename VectorType::BlockType &>::type
+ std::enable_if_t<IsBlockVector<VectorType>::value,
+ const typename VectorType::BlockType &>
subblock(const VectorType &vector, unsigned int block_no)
{
AssertIndexRange(block_no, vector.n_blocks());
}
template <typename VectorType>
- typename std::enable_if<!IsBlockVector<VectorType>::value,
- VectorType &>::type
+ std::enable_if_t<!IsBlockVector<VectorType>::value, VectorType &>
subblock(VectorType &vector, unsigned int)
{
return vector;
}
template <typename VectorType>
- typename std::enable_if<!IsBlockVector<VectorType>::value,
- const VectorType &>::type
+ std::enable_if_t<!IsBlockVector<VectorType>::value, const VectorType &>
subblock(const VectorType &vector, unsigned int)
{
return vector;
}
template <typename VectorType>
- typename std::enable_if<IsBlockVector<VectorType>::value, void>::type
+ std::enable_if_t<IsBlockVector<VectorType>::value, void>
collect_sizes(VectorType &vector)
{
vector.collect_sizes();
}
template <typename VectorType>
- typename std::enable_if<!IsBlockVector<VectorType>::value, void>::type
+ std::enable_if_t<!IsBlockVector<VectorType>::value, void>
collect_sizes(const VectorType &)
{}
} // namespace BlockHelper
*/
template <typename MatrixType,
typename Number,
- typename std::enable_if<std::is_same<
+ std::enable_if_t<std::is_same<
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>::value>::type * = nullptr>
+ Number>::type>::type>::value> * = nullptr>
const AffineConstraints<typename MatrixType::value_type> &
create_new_affine_constraints_if_needed(
const MatrixType &,
*/
template <typename MatrixType,
typename Number,
- typename std::enable_if<!std::is_same<
+ std::enable_if_t<!std::is_same<
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>::value>::type * = nullptr>
+ Number>::type>::type>::value> * = nullptr>
const AffineConstraints<typename MatrixType::value_type> &
create_new_affine_constraints_if_needed(
const MatrixType &,
* indeed a serial vector.
*/
template <class VectorType>
- using is_serial_vector_type = decltype(
- typename std::enable_if<is_serial_vector<VectorType>::value, int>::type());
+ using is_serial_vector_type =
+ decltype(std::enable_if_t<is_serial_vector<VectorType>::value, int>());
/**
* A variable that indicates that the type `T` is either (i) not
// access to generic const vectors that have operator ().
// FIXME: this is wrong for Trilinos/Petsc MPI vectors
// where we should first do Partitioner::local_to_global()
- template <typename VectorType,
- typename std::enable_if<!has_local_element<VectorType>,
- VectorType>::type * = nullptr>
+ template <
+ typename VectorType,
+ std::enable_if_t<!has_local_element<VectorType>, VectorType> * = nullptr>
inline typename VectorType::value_type
vector_access(const VectorType &vec, const unsigned int entry)
{
// access to generic non-const vectors that have operator ().
// FIXME: this is wrong for Trilinos/Petsc MPI vectors
// where we should first do Partitioner::local_to_global()
- template <typename VectorType,
- typename std::enable_if<!has_local_element<VectorType>,
- VectorType>::type * = nullptr>
+ template <
+ typename VectorType,
+ std::enable_if_t<!has_local_element<VectorType>, VectorType> * = nullptr>
inline typename VectorType::value_type &
vector_access(VectorType &vec, const unsigned int entry)
{
// access to distributed MPI vectors that have a local_element(uint)
// method to access data in local index space, which is what we use in
// DoFInfo and hence in read_dof_values etc.
- template <typename VectorType,
- typename std::enable_if<has_local_element<VectorType>,
- VectorType>::type * = nullptr>
+ template <
+ typename VectorType,
+ std::enable_if_t<has_local_element<VectorType>, VectorType> * = nullptr>
inline typename VectorType::value_type &
vector_access(VectorType &vec, const unsigned int entry)
{
// same for const access
- template <typename VectorType,
- typename std::enable_if<has_local_element<VectorType>,
- VectorType>::type * = nullptr>
+ template <
+ typename VectorType,
+ std::enable_if_t<has_local_element<VectorType>, VectorType> * = nullptr>
inline typename VectorType::value_type
vector_access(const VectorType &vec, const unsigned int entry)
{
- template <typename VectorType,
- typename std::enable_if<has_add_local_element<VectorType>,
- VectorType>::type * = nullptr>
+ template <
+ typename VectorType,
+ std::enable_if_t<has_add_local_element<VectorType>, VectorType> * = nullptr>
inline void
vector_access_add(VectorType & vec,
const unsigned int entry,
template <typename VectorType,
- typename std::enable_if<!has_add_local_element<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<!has_add_local_element<VectorType>, VectorType> * =
+ nullptr>
inline void
vector_access_add(VectorType & vec,
const unsigned int entry,
- template <typename VectorType,
- typename std::enable_if<has_add_local_element<VectorType>,
- VectorType>::type * = nullptr>
+ template <
+ typename VectorType,
+ std::enable_if_t<has_add_local_element<VectorType>, VectorType> * = nullptr>
inline void
vector_access_add_global(VectorType & vec,
const types::global_dof_index entry,
template <typename VectorType,
- typename std::enable_if<!has_add_local_element<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<!has_add_local_element<VectorType>, VectorType> * =
+ nullptr>
inline void
vector_access_add_global(VectorType & vec,
const types::global_dof_index entry,
- template <typename VectorType,
- typename std::enable_if<has_set_local_element<VectorType>,
- VectorType>::type * = nullptr>
+ template <
+ typename VectorType,
+ std::enable_if_t<has_set_local_element<VectorType>, VectorType> * = nullptr>
inline void
vector_access_set(VectorType & vec,
const unsigned int entry,
template <typename VectorType,
- typename std::enable_if<!has_set_local_element<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<!has_set_local_element<VectorType>, VectorType> * =
+ nullptr>
inline void
vector_access_set(VectorType & vec,
const unsigned int entry,
// is really the same as stored in MatrixFree.
// version below is when has_partitioners_are_compatible == false
// FIXME: this is incorrect for PETSc/Trilinos MPI vectors
- template <
- int dim,
- typename Number,
- typename VectorizedArrayType,
- typename VectorType,
- typename std::enable_if<!has_partitioners_are_compatible<VectorType>,
- VectorType>::type * = nullptr>
+ template <int dim,
+ typename Number,
+ typename VectorizedArrayType,
+ typename VectorType,
+ std::enable_if_t<!has_partitioners_are_compatible<VectorType>,
+ VectorType> * = nullptr>
inline void
check_vector_compatibility(
const VectorType & vec,
typename Number,
typename VectorizedArrayType,
typename VectorType,
- typename std::enable_if<has_partitioners_are_compatible<VectorType>,
- VectorType>::type * = nullptr>
+ std::enable_if_t<has_partitioners_are_compatible<VectorType>,
+ VectorType> * = nullptr>
inline void
check_vector_compatibility(
const VectorType & vec,
class SolverType,
class MatrixType,
class PreconditionerType,
- typename std::enable_if<
+ std::enable_if_t<
std::is_same<VectorType, typename SolverType::vector_type>::value,
- VectorType>::type * = nullptr>
+ VectorType> * = nullptr>
void
solve(SolverType & solver,
const MatrixType & matrix,
class SolverType,
class MatrixType,
class PreconditionerType,
- typename std::enable_if<
+ std::enable_if_t<
!std::is_same<VectorType, typename SolverType::vector_type>::value,
- VectorType>::type * = nullptr>
+ VectorType> * = nullptr>
void
solve(SolverType & solver,
const MatrixType & matrix,
typename VectorType,
class TRANSFER,
typename OtherVectorType>
- typename std::enable_if<TRANSFER::supports_dof_handler_vector>::type
+ std::enable_if_t<TRANSFER::supports_dof_handler_vector>
vmult(
const std::vector<const dealii::DoFHandler<dim> *> &dof_handler_vector,
dealii::Multigrid<VectorType> & multigrid,
typename VectorType,
class TRANSFER,
typename OtherVectorType>
- typename std::enable_if<TRANSFER::supports_dof_handler_vector>::type
+ std::enable_if_t<TRANSFER::supports_dof_handler_vector>
vmult_add(
const std::vector<const dealii::DoFHandler<dim> *> &dof_handler_vector,
dealii::Multigrid<VectorType> & multigrid,
int spacedim,
typename VectorType,
typename Number,
- typename std::enable_if<IsBlockVector<VectorType>::value,
- VectorType>::type * = nullptr>
+ std::enable_if_t<IsBlockVector<VectorType>::value, VectorType>
+ * = nullptr>
void
create_dof_vector(const DoFHandler<dim, spacedim> &dof_handler,
const VectorType & src,
int spacedim,
typename VectorType,
typename Number,
- typename std::enable_if<!IsBlockVector<VectorType>::value,
- VectorType>::type * = nullptr>
+ std::enable_if_t<!IsBlockVector<VectorType>::value, VectorType>
+ * = nullptr>
void
create_dof_vector(const DoFHandler<dim, spacedim> &dof_handler,
const VectorType & src,
*/
template <typename VectorType,
typename Number,
- typename std::enable_if<IsBlockVector<VectorType>::value,
- VectorType>::type * = nullptr>
+ std::enable_if_t<IsBlockVector<VectorType>::value, VectorType>
+ * = nullptr>
void
create_cell_vector(const VectorType & src,
LinearAlgebra::distributed::BlockVector<Number> &dst)
*/
template <typename VectorType,
typename Number,
- typename std::enable_if<!IsBlockVector<VectorType>::value,
- VectorType>::type * = nullptr>
+ std::enable_if_t<!IsBlockVector<VectorType>::value, VectorType>
+ * = nullptr>
void
create_cell_vector(const VectorType & src,
LinearAlgebra::distributed::BlockVector<Number> &dst)
namespace internals
{
template <int dim, typename cell_iterator, typename number>
- typename std::enable_if<dim == 3>::type
+ std::enable_if_t<dim == 3>
compute_edge_projection_l2(const cell_iterator & cell,
const unsigned int face,
const unsigned int line,
template <int dim, typename cell_iterator, typename number>
- typename std::enable_if<dim != 3>::type
+ std::enable_if_t<dim != 3>
compute_edge_projection_l2(const cell_iterator &,
const unsigned int,
const unsigned int,
namespace internal
{
template <typename VectorType>
- typename std::enable_if<dealii::is_serial_vector<VectorType>::value ==
- true>::type
+ std::enable_if_t<dealii::is_serial_vector<VectorType>::value == true>
subtract_mean_value(VectorType &v, const std::vector<bool> &p_select)
{
if (p_select.size() == 0)
template <typename VectorType>
- typename std::enable_if<dealii::is_serial_vector<VectorType>::value ==
- false>::type
+ std::enable_if_t<dealii::is_serial_vector<VectorType>::value == false>
subtract_mean_value(VectorType &v, const std::vector<bool> &p_select)
{
(void)p_select;
* positions.
*/
template <class VectorType>
- typename std::enable_if<
- std::is_convertible<VectorType *, Function<spacedim> *>::value ==
- false>::type
+ std::enable_if_t<
+ std::is_convertible<VectorType *, Function<spacedim> *>::value == false>
set_particle_positions(const VectorType &input_vector,
const bool displace_particles = true);
template <int dim, int spacedim>
template <class VectorType>
- inline typename std::enable_if<
- std::is_convertible<VectorType *, Function<spacedim> *>::value ==
- false>::type
+ inline std::enable_if_t<
+ std::is_convertible<VectorType *, Function<spacedim> *>::value == false>
ParticleHandler<dim, spacedim>::set_particle_positions(
const VectorType &input_vector,
const bool displace_particles)
// Specialization for taped ADOL-C auto-differentiable numbers.
template <typename ADNumberType>
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::TapedDrivers()
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::TapedDrivers()
: active_tape(Numbers<ADNumberType>::invalid_tape_index)
, keep_values(true)
, is_recording_flag(false)
template <typename ADNumberType>
bool
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::is_recording()
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::is_recording()
const
{
return is_recording_flag;
template <typename ADNumberType>
typename Types<ADNumberType>::tape_index
- TapedDrivers<ADNumberType,
- double,
- typename std::enable_if<
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::active_tape_index() const
+ TapedDrivers<
+ ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::active_tape_index() const
{
return active_tape;
}
bool
TapedDrivers<ADNumberType,
double,
- typename std::enable_if<
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::keep_independent_values()
- const
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
+ keep_independent_values() const
{
return keep_values;
}
template <typename ADNumberType>
bool
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
is_registered_tape(
const typename Types<ADNumberType>::tape_index tape_index) const
{
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
set_tape_buffer_sizes(
const typename Types<ADNumberType>::tape_buffer_sizes in_obufsize,
const typename Types<ADNumberType>::tape_buffer_sizes in_lbufsize,
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
start_taping(const typename Types<ADNumberType>::tape_index tape_index,
const bool keep_independent_values)
{
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
stop_taping(
const typename Types<ADNumberType>::tape_index active_tape_index,
const bool write_tapes_to_file)
template <typename ADNumberType>
std::vector<typename Types<ADNumberType>::tape_index>
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
get_registered_tape_indices() const
{
// We've chosen to use unsigned shorts for the tape
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
activate_tape(const typename Types<ADNumberType>::tape_index tape_index)
{
active_tape = tape_index;
template <typename ADNumberType>
bool
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
requires_retaping(
const typename Types<ADNumberType>::tape_index tape_index) const
{
template <typename ADNumberType>
bool
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
last_action_requires_retaping() const
{
return requires_retaping(active_tape);
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
remove_tape(const typename Types<ADNumberType>::tape_index tape_index)
{
Assert(is_registered_tape(tape_index),
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
reset(const bool clear_registered_tapes)
{
active_tape = Numbers<ADNumberType>::invalid_tape_index;
void
TapedDrivers<ADNumberType,
double,
- typename std::enable_if<
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::print(std::ostream &stream)
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::print(std::ostream
+ &stream)
const
{
const std::vector<typename Types<ADNumberType>::tape_index>
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
print_tape_stats(
const typename Types<ADNumberType>::tape_index tape_index,
std::ostream & stream) const
typename TapedDrivers<
ADNumberType,
double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::scalar_type
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::scalar_type
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
value(const typename Types<ADNumberType>::tape_index active_tape_index,
const std::vector<scalar_type> &independent_variables) const
{
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
gradient(const typename Types<ADNumberType>::tape_index active_tape_index,
const std::vector<scalar_type> &independent_variables,
Vector<scalar_type> & gradient) const
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
hessian(const typename Types<ADNumberType>::tape_index active_tape_index,
const std::vector<scalar_type> &independent_variables,
FullMatrix<scalar_type> & hessian) const
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
values(const typename Types<ADNumberType>::tape_index active_tape_index,
const unsigned int n_dependent_variables,
const std::vector<scalar_type> &independent_variables,
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
jacobian(const typename Types<ADNumberType>::tape_index active_tape_index,
const unsigned int n_dependent_variables,
const std::vector<scalar_type> &independent_variables,
template <typename ADNumberType>
bool
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::is_recording()
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::is_recording()
const
{
AssertThrow(false, ExcRequiresADOLC());
template <typename ADNumberType>
typename Types<ADNumberType>::tape_index
- TapedDrivers<ADNumberType,
- double,
- typename std::enable_if<
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::active_tape_index() const
+ TapedDrivers<
+ ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::active_tape_index() const
{
AssertThrow(false, ExcRequiresADOLC());
return Numbers<ADNumberType>::invalid_tape_index;
bool
TapedDrivers<ADNumberType,
double,
- typename std::enable_if<
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::keep_independent_values()
- const
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
+ keep_independent_values() const
{
AssertThrow(false, ExcRequiresADOLC());
return false;
template <typename ADNumberType>
bool
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
is_registered_tape(const typename Types<ADNumberType>::tape_index) const
{
AssertThrow(false, ExcRequiresADOLC());
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
set_tape_buffer_sizes(
const typename Types<ADNumberType>::tape_buffer_sizes,
const typename Types<ADNumberType>::tape_buffer_sizes,
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
start_taping(const typename Types<ADNumberType>::tape_index, const bool)
{
AssertThrow(false, ExcRequiresADOLC());
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
stop_taping(const typename Types<ADNumberType>::tape_index, const bool)
{
AssertThrow(false, ExcRequiresADOLC());
template <typename ADNumberType>
std::vector<typename Types<ADNumberType>::tape_index>
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
get_registered_tape_indices() const
{
AssertThrow(false, ExcRequiresADOLC());
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
activate_tape(const typename Types<ADNumberType>::tape_index)
{
AssertThrow(false, ExcRequiresADOLC());
template <typename ADNumberType>
bool
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
requires_retaping(const typename Types<ADNumberType>::tape_index) const
{
AssertThrow(false, ExcRequiresADOLC());
template <typename ADNumberType>
bool
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
last_action_requires_retaping() const
{
AssertThrow(false, ExcRequiresADOLC());
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
remove_tape(const typename Types<ADNumberType>::tape_index)
{
AssertThrow(false, ExcRequiresADOLC());
void
TapedDrivers<ADNumberType,
double,
- typename std::enable_if<
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::reset(const bool)
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::reset(const bool)
{
AssertThrow(false, ExcRequiresADOLC());
}
void
TapedDrivers<ADNumberType,
double,
- typename std::enable_if<
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::print(std::ostream &) const
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::print(std::ostream
+ &) const
{
AssertThrow(false, ExcRequiresADOLC());
}
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
print_tape_stats(const typename Types<ADNumberType>::tape_index,
std::ostream &) const
{
typename TapedDrivers<
ADNumberType,
double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::scalar_type
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::scalar_type
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
value(const typename Types<ADNumberType>::tape_index,
const std::vector<scalar_type> &) const
{
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
gradient(const typename Types<ADNumberType>::tape_index,
const std::vector<scalar_type> &,
Vector<scalar_type> &) const
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
hessian(const typename Types<ADNumberType>::tape_index,
const std::vector<scalar_type> &,
FullMatrix<scalar_type> &) const
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
values(const typename Types<ADNumberType>::tape_index,
const unsigned int,
const std::vector<scalar_type> &,
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- double,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ double,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
jacobian(const typename Types<ADNumberType>::tape_index,
const unsigned int,
const std::vector<scalar_type> &,
template <typename ADNumberType>
bool
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::is_recording()
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::is_recording()
const
{
// ADOL-C only supports 'double', not 'float', so we can forward to
template <typename ADNumberType>
typename Types<ADNumberType>::tape_index
- TapedDrivers<ADNumberType,
- float,
- typename std::enable_if<
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::active_tape_index() const
+ TapedDrivers<
+ ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::active_tape_index() const
{
// ADOL-C only supports 'double', not 'float', so we can forward to
// the 'double' implementation of this function
bool
TapedDrivers<ADNumberType,
float,
- typename std::enable_if<
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::keep_independent_values()
- const
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
+ keep_independent_values() const
{
return taped_driver.keep_independent_values();
}
template <typename ADNumberType>
bool
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
is_registered_tape(
const typename Types<ADNumberType>::tape_index tape_index) const
{
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
set_tape_buffer_sizes(
const typename Types<ADNumberType>::tape_buffer_sizes obufsize,
const typename Types<ADNumberType>::tape_buffer_sizes lbufsize,
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
start_taping(const typename Types<ADNumberType>::tape_index tape_index,
const bool keep_independent_values)
{
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
stop_taping(
const typename Types<ADNumberType>::tape_index active_tape_index,
const bool write_tapes_to_file)
template <typename ADNumberType>
std::vector<typename Types<ADNumberType>::tape_index>
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
get_registered_tape_indices() const
{
return taped_driver.get_registered_tape_indices();
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
activate_tape(const typename Types<ADNumberType>::tape_index tape_index)
{
taped_driver.activate_tape(tape_index);
template <typename ADNumberType>
bool
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
requires_retaping(
const typename Types<ADNumberType>::tape_index tape_index) const
{
template <typename ADNumberType>
bool
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
last_action_requires_retaping() const
{
return taped_driver.last_action_requires_retaping();
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
remove_tape(const typename Types<ADNumberType>::tape_index tape_index)
{
taped_driver.remove_tape(tape_index);
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
reset(const bool clear_registered_tapes)
{
taped_driver.reset(clear_registered_tapes);
void
TapedDrivers<ADNumberType,
float,
- typename std::enable_if<
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::print(std::ostream &stream)
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::print(std::ostream
+ &stream)
const
{
taped_driver.print(stream);
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
print_tape_stats(
const typename Types<ADNumberType>::tape_index tape_index,
std::ostream & stream) const
typename TapedDrivers<
ADNumberType,
float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::scalar_type
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::scalar_type
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
value(const typename Types<ADNumberType>::tape_index active_tape_index,
const std::vector<scalar_type> &independent_variables) const
{
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
gradient(const typename Types<ADNumberType>::tape_index active_tape_index,
const std::vector<scalar_type> &independent_variables,
Vector<scalar_type> & gradient) const
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
hessian(const typename Types<ADNumberType>::tape_index active_tape_index,
const std::vector<scalar_type> &independent_variables,
FullMatrix<scalar_type> & hessian) const
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
values(const typename Types<ADNumberType>::tape_index active_tape_index,
const unsigned int n_dependent_variables,
const std::vector<scalar_type> &independent_variables,
template <typename ADNumberType>
void
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
jacobian(const typename Types<ADNumberType>::tape_index active_tape_index,
const unsigned int n_dependent_variables,
const std::vector<scalar_type> &independent_variables,
# ifndef DOXYGEN
template <typename ADNumberType>
std::vector<double>
- TapedDrivers<
- ADNumberType,
- float,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_taped>::type>::
+ TapedDrivers<ADNumberType,
+ float,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_taped>>::
vector_float_to_double(const std::vector<float> &in) const
{
std::vector<double> out(in.size());
* reverse-mode AD.
*/
template <typename ADNumberType>
- typename std::enable_if<!(ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad_dfad)>::type
+ std::enable_if_t<!(ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad_dfad)>
reverse_mode_dependent_variable_activation(ADNumberType &)
{}
* to. This function broadcasts this information.
*/
template <typename ADNumberType>
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad_dfad>::type
+ std::enable_if_t<
+ ADNumberTraits<ADNumberType>::type_code == NumberTypes::sacado_rad ||
+ ADNumberTraits<ADNumberType>::type_code == NumberTypes::sacado_rad_dfad>
reverse_mode_dependent_variable_activation(
ADNumberType &dependent_variable)
{
* auto-differentiable numbers.
*/
template <typename ADNumberType>
- typename std::enable_if<!(ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless)>::type
+ std::enable_if_t<!(ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless)>
configure_tapeless_mode(const unsigned int)
{}
* If not then it throws an error.
*/
template <typename ADNumberType>
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless>::type
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless>
configure_tapeless_mode(const unsigned int n_directional_derivatives)
{
# ifdef DEAL_II_ADOLC_WITH_TAPELESS_REFCOUNTING
# else // DEAL_II_WITH_ADOLC
template <typename ADNumberType>
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless>::type
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless>
configure_tapeless_mode(const unsigned int /*n_directional_derivatives*/)
{
AssertThrow(false, ExcRequiresADOLC());
TapelessDrivers<
ADNumberType,
ScalarType,
- typename std::enable_if<
- ADNumberTraits<ADNumberType>::type_code == NumberTypes::sacado_rad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad_dfad>::type>::TapelessDrivers()
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad_dfad>>::TapelessDrivers()
: dependent_variable_marking_safe(false)
{}
# endif
template <typename ADNumberType, typename ScalarType>
void
- TapelessDrivers<
- ADNumberType,
- ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad_dfad>::type>::
+ TapelessDrivers<ADNumberType,
+ ScalarType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad_dfad>>::
initialize_global_environment(const unsigned int n_independent_variables)
{
internal::configure_tapeless_mode<ADNumberType>(n_independent_variables);
TapelessDrivers<
ADNumberType,
ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad_dfad>::type>::
- allow_dependent_variable_marking()
+ std::enable_if_t<
+ ADNumberTraits<ADNumberType>::type_code == NumberTypes::sacado_rad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad_dfad>>::allow_dependent_variable_marking()
{
dependent_variable_marking_safe = true;
}
TapelessDrivers<
ADNumberType,
ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad_dfad>::type>::
- prevent_dependent_variable_marking()
+ std::enable_if_t<
+ ADNumberTraits<ADNumberType>::type_code == NumberTypes::sacado_rad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad_dfad>>::prevent_dependent_variable_marking()
{
dependent_variable_marking_safe = false;
}
template <typename ADNumberType, typename ScalarType>
bool
- TapelessDrivers<
- ADNumberType,
- ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad_dfad>::type>::
+ TapelessDrivers<ADNumberType,
+ ScalarType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad_dfad>>::
is_dependent_variable_marking_allowed() const
{
return dependent_variable_marking_safe;
template <typename ADNumberType, typename ScalarType>
ScalarType
- TapelessDrivers<
- ADNumberType,
- ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad_dfad>::type>::
+ TapelessDrivers<ADNumberType,
+ ScalarType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad_dfad>>::
value(const std::vector<ADNumberType> &dependent_variables) const
{
Assert(dependent_variables.size() == 1,
template <typename ADNumberType, typename ScalarType>
void
- TapelessDrivers<
- ADNumberType,
- ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad_dfad>::type>::
+ TapelessDrivers<ADNumberType,
+ ScalarType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad_dfad>>::
gradient(const std::vector<ADNumberType> &independent_variables,
const std::vector<ADNumberType> &dependent_variables,
Vector<ScalarType> & gradient) const
template <typename ADNumberType, typename ScalarType>
void
- TapelessDrivers<
- ADNumberType,
- ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad_dfad>::type>::
+ TapelessDrivers<ADNumberType,
+ ScalarType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad_dfad>>::
hessian(const std::vector<ADNumberType> &independent_variables,
const std::vector<ADNumberType> &dependent_variables,
FullMatrix<ScalarType> & hessian) const
template <typename ADNumberType, typename ScalarType>
void
- TapelessDrivers<
- ADNumberType,
- ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad_dfad>::type>::
+ TapelessDrivers<ADNumberType,
+ ScalarType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad_dfad>>::
values(const std::vector<ADNumberType> &dependent_variables,
Vector<ScalarType> & values) const
{
template <typename ADNumberType, typename ScalarType>
void
- TapelessDrivers<
- ADNumberType,
- ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_rad_dfad>::type>::
+ TapelessDrivers<ADNumberType,
+ ScalarType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_rad_dfad>>::
jacobian(const std::vector<ADNumberType> &independent_variables,
const std::vector<ADNumberType> &dependent_variables,
FullMatrix<ScalarType> & jacobian) const
TapelessDrivers<
ADNumberType,
ScalarType,
- typename std::enable_if<
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless ||
- ADNumberTraits<ADNumberType>::type_code == NumberTypes::sacado_dfad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad_dfad>::type>::TapelessDrivers()
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad_dfad>>::TapelessDrivers()
: dependent_variable_marking_safe(false)
{}
# endif
template <typename ADNumberType, typename ScalarType>
void
- TapelessDrivers<
- ADNumberType,
- ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad_dfad>::type>::
+ TapelessDrivers<ADNumberType,
+ ScalarType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad_dfad>>::
initialize_global_environment(const unsigned int n_independent_variables)
{
internal::configure_tapeless_mode<ADNumberType>(n_independent_variables);
TapelessDrivers<
ADNumberType,
ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad_dfad>::type>::
- allow_dependent_variable_marking()
+ std::enable_if_t<
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless ||
+ ADNumberTraits<ADNumberType>::type_code == NumberTypes::sacado_dfad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad_dfad>>::allow_dependent_variable_marking()
{
dependent_variable_marking_safe = true;
}
TapelessDrivers<
ADNumberType,
ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad_dfad>::type>::
- prevent_dependent_variable_marking()
+ std::enable_if_t<
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless ||
+ ADNumberTraits<ADNumberType>::type_code == NumberTypes::sacado_dfad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad_dfad>>::prevent_dependent_variable_marking()
{
dependent_variable_marking_safe = false;
}
template <typename ADNumberType, typename ScalarType>
bool
- TapelessDrivers<
- ADNumberType,
- ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad_dfad>::type>::
+ TapelessDrivers<ADNumberType,
+ ScalarType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad_dfad>>::
is_dependent_variable_marking_allowed() const
{
return dependent_variable_marking_safe;
template <typename ADNumberType, typename ScalarType>
ScalarType
- TapelessDrivers<
- ADNumberType,
- ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad_dfad>::type>::
+ TapelessDrivers<ADNumberType,
+ ScalarType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad_dfad>>::
value(const std::vector<ADNumberType> &dependent_variables) const
{
Assert(dependent_variables.size() == 1,
template <typename ADNumberType, typename ScalarType>
void
- TapelessDrivers<
- ADNumberType,
- ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad_dfad>::type>::
+ TapelessDrivers<ADNumberType,
+ ScalarType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad_dfad>>::
gradient(const std::vector<ADNumberType> &independent_variables,
const std::vector<ADNumberType> &dependent_variables,
Vector<ScalarType> & gradient) const
template <typename ADNumberType, typename ScalarType>
void
- TapelessDrivers<
- ADNumberType,
- ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad_dfad>::type>::
+ TapelessDrivers<ADNumberType,
+ ScalarType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad_dfad>>::
hessian(const std::vector<ADNumberType> &independent_variables,
const std::vector<ADNumberType> &dependent_variables,
FullMatrix<ScalarType> & hessian) const
template <typename ADNumberType, typename ScalarType>
void
- TapelessDrivers<
- ADNumberType,
- ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad_dfad>::type>::
+ TapelessDrivers<ADNumberType,
+ ScalarType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad_dfad>>::
values(const std::vector<ADNumberType> &dependent_variables,
Vector<ScalarType> & values) const
{
template <typename ADNumberType, typename ScalarType>
void
- TapelessDrivers<
- ADNumberType,
- ScalarType,
- typename std::enable_if<ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::adolc_tapeless ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad ||
- ADNumberTraits<ADNumberType>::type_code ==
- NumberTypes::sacado_dfad_dfad>::type>::
+ TapelessDrivers<ADNumberType,
+ ScalarType,
+ std::enable_if_t<ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::adolc_tapeless ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad ||
+ ADNumberTraits<ADNumberType>::type_code ==
+ NumberTypes::sacado_dfad_dfad>>::
jacobian(const std::vector<ADNumberType> &independent_variables,
const std::vector<ADNumberType> &dependent_variables,
FullMatrix<ScalarType> & jacobian) const
constexpr bool has_set_ghost_state =
is_supported_operation<set_ghost_state_t, T>;
- template <typename VectorType,
- typename std::enable_if<has_set_ghost_state<VectorType>,
- VectorType>::type * = nullptr>
+ template <
+ typename VectorType,
+ std::enable_if_t<has_set_ghost_state<VectorType>, VectorType> * = nullptr>
void
set_ghost_state(VectorType &vector, const bool ghosted)
{
vector.set_ghost_state(ghosted);
}
- template <typename VectorType,
- typename std::enable_if<!has_set_ghost_state<VectorType>,
- VectorType>::type * = nullptr>
+ template <
+ typename VectorType,
+ std::enable_if_t<!has_set_ghost_state<VectorType>, VectorType> * = nullptr>
void
set_ghost_state(VectorType &, const bool)
{
template <typename Number>
struct CheckForZero<
Number,
- typename std::enable_if<
- Differentiation::AD::is_ad_number<Number>::value>::type>
+ std::enable_if_t<Differentiation::AD::is_ad_number<Number>::value>>
{
static bool
value(const Number & /*value*/)
* Return true if a grid was actually generated, false otherwise.
*/
template <int dim, int spacedim>
- typename std::enable_if<dim != spacedim, bool>::type
+ std::enable_if_t<dim != spacedim, bool>
generate_codimension_zero_grid(const std::string &,
const std::string &,
Triangulation<dim, spacedim> &)
* Return true if a grid was actually generated, false otherwise.
*/
template <int dim, int spacedim>
- typename std::enable_if<dim != spacedim - 1, bool>::type
+ std::enable_if_t<dim != spacedim - 1, bool>
generate_codimension_one_grid(const std::string &,
const std::string &,
Triangulation<dim, spacedim> &)
template <typename SparsityPatternType>
- inline typename std::enable_if<
- !std::is_same<SparsityPatternType,
- dealii::SparseMatrix<double>>::value>::type
+ inline std::enable_if_t<
+ !std::is_same<SparsityPatternType, dealii::SparseMatrix<double>>::value>
SparseMatrix::reinit(const IndexSet & row_parallel_partitioning,
const IndexSet & col_parallel_partitioning,
const SparsityPatternType &sparsity_pattern,
template <typename VectorType>
- typename std::enable_if<
- std::is_same<typename VectorType::value_type, TrilinosScalar>::value>::type
+ std::enable_if_t<
+ std::is_same<typename VectorType::value_type, TrilinosScalar>::value>
SparseMatrix::vmult(VectorType &dst, const VectorType &src) const
{
Assert(&src != &dst, ExcSourceEqualsDestination());
template <typename VectorType>
- typename std::enable_if<
- !std::is_same<typename VectorType::value_type, TrilinosScalar>::value>::type
+ std::enable_if_t<
+ !std::is_same<typename VectorType::value_type, TrilinosScalar>::value>
SparseMatrix::vmult(VectorType & /*dst*/, const VectorType & /*src*/) const
{
AssertThrow(false, ExcNotImplemented());
template <typename VectorType>
- typename std::enable_if<
- std::is_same<typename VectorType::value_type, TrilinosScalar>::value>::type
+ std::enable_if_t<
+ std::is_same<typename VectorType::value_type, TrilinosScalar>::value>
SparseMatrix::Tvmult(VectorType &dst, const VectorType &src) const
{
Assert(&src != &dst, ExcSourceEqualsDestination());
template <typename VectorType>
- typename std::enable_if<
- !std::is_same<typename VectorType::value_type, TrilinosScalar>::value>::type
+ std::enable_if_t<
+ !std::is_same<typename VectorType::value_type, TrilinosScalar>::value>
SparseMatrix::Tvmult(VectorType & /*dst*/, const VectorType & /*src*/) const
{
AssertThrow(false, ExcNotImplemented());
// This function initializes a container of Number type
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, std::vector<Number>>::value,
- Container<Number>>::type
+std::enable_if_t<std::is_same<Container<Number>, std::vector<Number>>::value,
+ Container<Number>>
initialize_container(std::vector<hsize_t> dimensions)
{
return Container<Number>(std::accumulate(
}
template <template <class...> class Container, typename Number>
-typename std::enable_if<std::is_same<Container<Number>, Vector<Number>>::value,
- Container<Number>>::type
+std::enable_if_t<std::is_same<Container<Number>, Vector<Number>>::value,
+ Container<Number>>
initialize_container(std::vector<hsize_t> dimensions)
{
return Container<Number>(std::accumulate(
}
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, FullMatrix<Number>>::value,
- Container<Number>>::type
+std::enable_if_t<std::is_same<Container<Number>, FullMatrix<Number>>::value,
+ Container<Number>>
initialize_container(std::vector<hsize_t> dimensions)
{
return FullMatrix<Number>(dimensions[0], dimensions[1]);
// This function calculates the sum of the elements in a container
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, std::vector<Number>>::value,
- Number>::type
+std::enable_if_t<std::is_same<Container<Number>, std::vector<Number>>::value,
+ Number>
container_sum(Container<Number> data)
{
return std::accumulate(data.begin(), data.end(), static_cast<Number>(0));
}
template <template <class...> class Container, typename Number>
-typename std::enable_if<std::is_same<Container<Number>, Vector<Number>>::value,
- Number>::type
+std::enable_if_t<std::is_same<Container<Number>, Vector<Number>>::value, Number>
container_sum(Container<Number> data)
{
return std::accumulate(data.begin(), data.end(), static_cast<Number>(0));
}
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, FullMatrix<Number>>::value,
- Number>::type
+std::enable_if_t<std::is_same<Container<Number>, FullMatrix<Number>>::value,
+ Number>
container_sum(Container<Number> data)
{
Number sum = 0;
// If Number is scalar the function returns 1
// If Number is complex the function returns 1 + 1j
template <typename Number>
-typename std::enable_if<!boost::is_complex<Number>::value, Number>::type
+std::enable_if_t<!boost::is_complex<Number>::value, Number>
get_factor()
{
return 1;
}
template <typename Number>
-typename std::enable_if<boost::is_complex<Number>::value, Number>::type
+std::enable_if_t<boost::is_complex<Number>::value, Number>
get_factor()
{
return static_cast<Number>(std::complex<float>(1, 1));
// This function assigns data to the elements of the container
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, std::vector<Number>>::value,
- void>::type
+std::enable_if_t<std::is_same<Container<Number>, std::vector<Number>>::value,
+ void>
assign_data(Container<Number> &data)
{
for (unsigned int idx = 0; idx < data.size(); ++idx)
}
template <template <class...> class Container, typename Number>
-typename std::enable_if<std::is_same<Container<Number>, Vector<Number>>::value,
- void>::type
+std::enable_if_t<std::is_same<Container<Number>, Vector<Number>>::value, void>
assign_data(Container<Number> &data)
{
for (unsigned int idx = 0; idx < data.size(); ++idx)
}
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, FullMatrix<Number>>::value,
- void>::type
+std::enable_if_t<std::is_same<Container<Number>, FullMatrix<Number>>::value,
+ void>
assign_data(Container<Number> &data)
{
for (unsigned int row_idx = 0; row_idx < data.m(); ++row_idx)
// This function initializes a container of Number type
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, std::vector<Number>>::value,
- Container<Number>>::type
+std::enable_if_t<std::is_same<Container<Number>, std::vector<Number>>::value,
+ Container<Number>>
initialize_container(std::vector<hsize_t> dimensions)
{
return Container<Number>(std::accumulate(
}
template <template <class...> class Container, typename Number>
-typename std::enable_if<std::is_same<Container<Number>, Vector<Number>>::value,
- Container<Number>>::type
+std::enable_if_t<std::is_same<Container<Number>, Vector<Number>>::value,
+ Container<Number>>
initialize_container(std::vector<hsize_t> dimensions)
{
return Container<Number>(std::accumulate(
}
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, FullMatrix<Number>>::value,
- Container<Number>>::type
+std::enable_if_t<std::is_same<Container<Number>, FullMatrix<Number>>::value,
+ Container<Number>>
initialize_container(std::vector<hsize_t> dimensions)
{
return FullMatrix<Number>(dimensions[0], dimensions[1]);
// This function calculates the sum of the elements in a container
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, std::vector<Number>>::value,
- Number>::type
+std::enable_if_t<std::is_same<Container<Number>, std::vector<Number>>::value,
+ Number>
container_sum(Container<Number> data)
{
return std::accumulate(data.begin(), data.end(), static_cast<Number>(0));
}
template <template <class...> class Container, typename Number>
-typename std::enable_if<std::is_same<Container<Number>, Vector<Number>>::value,
- Number>::type
+std::enable_if_t<std::is_same<Container<Number>, Vector<Number>>::value, Number>
container_sum(Container<Number> data)
{
return std::accumulate(data.begin(), data.end(), static_cast<Number>(0));
}
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, FullMatrix<Number>>::value,
- Number>::type
+std::enable_if_t<std::is_same<Container<Number>, FullMatrix<Number>>::value,
+ Number>
container_sum(Container<Number> data)
{
Number sum = 0;
// If Number is scalar the function returns 1
// If Number is complex the function returns 1 + 1j
template <typename Number>
-typename std::enable_if<!boost::is_complex<Number>::value, Number>::type
+std::enable_if_t<!boost::is_complex<Number>::value, Number>
get_factor()
{
return 1;
}
template <typename Number>
-typename std::enable_if<boost::is_complex<Number>::value, Number>::type
+std::enable_if_t<boost::is_complex<Number>::value, Number>
get_factor()
{
return static_cast<Number>(std::complex<float>(1, 1));
// This function assigns data to the elements of the container
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, std::vector<Number>>::value,
- void>::type
+std::enable_if_t<std::is_same<Container<Number>, std::vector<Number>>::value,
+ void>
assign_data(Container<Number> &data)
{
for (unsigned int idx = 0; idx < data.size(); ++idx)
}
template <template <class...> class Container, typename Number>
-typename std::enable_if<std::is_same<Container<Number>, Vector<Number>>::value,
- void>::type
+std::enable_if_t<std::is_same<Container<Number>, Vector<Number>>::value, void>
assign_data(Container<Number> &data)
{
for (unsigned int idx = 0; idx < data.size(); ++idx)
}
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, FullMatrix<Number>>::value,
- void>::type
+std::enable_if_t<std::is_same<Container<Number>, FullMatrix<Number>>::value,
+ void>
assign_data(Container<Number> &data)
{
for (unsigned int row_idx = 0; row_idx < data.m(); ++row_idx)
// This function initializes a container of Number type
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, std::vector<Number>>::value,
- Container<Number>>::type
+std::enable_if_t<std::is_same<Container<Number>, std::vector<Number>>::value,
+ Container<Number>>
initialize_container(std::vector<hsize_t> dimensions)
{
return Container<Number>(std::accumulate(
template <template <class...> class Container, typename Number>
-typename std::enable_if<std::is_same<Container<Number>, Vector<Number>>::value,
- Container<Number>>::type
+std::enable_if_t<std::is_same<Container<Number>, Vector<Number>>::value,
+ Container<Number>>
initialize_container(std::vector<hsize_t> dimensions)
{
return Container<Number>(std::accumulate(
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, FullMatrix<Number>>::value,
- Container<Number>>::type
+std::enable_if_t<std::is_same<Container<Number>, FullMatrix<Number>>::value,
+ Container<Number>>
initialize_container(std::vector<hsize_t> dimensions)
{
return FullMatrix<Number>(dimensions[0], dimensions[1]);
// This function assigns data to the elements of the container
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, std::vector<Number>>::value,
- void>::type
+std::enable_if_t<std::is_same<Container<Number>, std::vector<Number>>::value,
+ void>
assign_data(Container<Number> &data)
{
for (unsigned int idx = 0; idx < data.size(); ++idx)
template <template <class...> class Container, typename Number>
-typename std::enable_if<std::is_same<Container<Number>, Vector<Number>>::value,
- void>::type
+std::enable_if_t<std::is_same<Container<Number>, Vector<Number>>::value, void>
assign_data(Container<Number> &data)
{
for (unsigned int idx = 0; idx < data.size(); ++idx)
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, FullMatrix<Number>>::value,
- void>::type
+std::enable_if_t<std::is_same<Container<Number>, FullMatrix<Number>>::value,
+ void>
assign_data(Container<Number> &data)
{
for (unsigned int row_idx = 0; row_idx < data.m(); ++row_idx)
// This function initializes a container of Number type
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, std::vector<Number>>::value,
- Container<Number>>::type
+std::enable_if_t<std::is_same<Container<Number>, std::vector<Number>>::value,
+ Container<Number>>
initialize_container(std::vector<hsize_t> dimensions)
{
return Container<Number>(std::accumulate(
template <template <class...> class Container, typename Number>
-typename std::enable_if<std::is_same<Container<Number>, Vector<Number>>::value,
- Container<Number>>::type
+std::enable_if_t<std::is_same<Container<Number>, Vector<Number>>::value,
+ Container<Number>>
initialize_container(std::vector<hsize_t> dimensions)
{
return Container<Number>(std::accumulate(
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, FullMatrix<Number>>::value,
- Container<Number>>::type
+std::enable_if_t<std::is_same<Container<Number>, FullMatrix<Number>>::value,
+ Container<Number>>
initialize_container(std::vector<hsize_t> dimensions)
{
return FullMatrix<Number>(dimensions[0], dimensions[1]);
// This function assigns data to the elements of the container
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, std::vector<Number>>::value,
- void>::type
+std::enable_if_t<std::is_same<Container<Number>, std::vector<Number>>::value,
+ void>
assign_data(Container<Number> &data)
{
for (unsigned int idx = 0; idx < data.size(); ++idx)
template <template <class...> class Container, typename Number>
-typename std::enable_if<std::is_same<Container<Number>, Vector<Number>>::value,
- void>::type
+std::enable_if_t<std::is_same<Container<Number>, Vector<Number>>::value, void>
assign_data(Container<Number> &data)
{
for (unsigned int idx = 0; idx < data.size(); ++idx)
template <template <class...> class Container, typename Number>
-typename std::enable_if<
- std::is_same<Container<Number>, FullMatrix<Number>>::value,
- void>::type
+std::enable_if_t<std::is_same<Container<Number>, FullMatrix<Number>>::value,
+ void>
assign_data(Container<Number> &data)
{
for (unsigned int row_idx = 0; row_idx < data.m(); ++row_idx)
template <typename VectorType>
-typename std::enable_if<!IsBlockVector<VectorType>::value, VectorType>::type
+std::enable_if_t<!IsBlockVector<VectorType>::value, VectorType>
build_ghosted(const IndexSet &owned_indices, const IndexSet &ghosted_indices)
{
return VectorType(owned_indices, ghosted_indices, MPI_COMM_WORLD);
}
template <typename VectorType>
-typename std::enable_if<IsBlockVector<VectorType>::value, VectorType>::type
+std::enable_if_t<IsBlockVector<VectorType>::value, VectorType>
build_ghosted(const IndexSet &owned_indices, const IndexSet &ghosted_indices)
{
std::vector<IndexSet> owned_indices_vector(1, owned_indices);
template <typename VectorType>
-typename std::enable_if<!IsBlockVector<VectorType>::value, VectorType>::type
+std::enable_if_t<!IsBlockVector<VectorType>::value, VectorType>
build_distributed(const IndexSet &owned_indices)
{
return VectorType(owned_indices, MPI_COMM_WORLD);
}
template <typename VectorType>
-typename std::enable_if<IsBlockVector<VectorType>::value, VectorType>::type
+std::enable_if_t<IsBlockVector<VectorType>::value, VectorType>
build_distributed(const IndexSet &owned_indices)
{
std::vector<IndexSet> owned_indices_vector(1, owned_indices);
class TensorType,
typename NumberType1,
typename NumberType2>
-typename std::enable_if<!std::is_constructible<NumberType1, NumberType2>::value,
- void>::type
+std::enable_if_t<!std::is_constructible<NumberType1, NumberType2>::value, void>
test_tensor_constructor(const std::string &, const std::string &)
{}
class TensorType,
typename NumberType1,
typename NumberType2>
-typename std::enable_if<std::is_constructible<NumberType1, NumberType2>::value,
- void>::type
+std::enable_if_t<std::is_constructible<NumberType1, NumberType2>::value, void>
test_tensor_constructor(const std::string &type1, const std::string &type2)
{
deallog << "Rank " << rank << ", "
template <int, int, typename>
class TensorType2,
typename NumberType2>
-typename std::enable_if<AreSame<TensorType1, TensorType2>::value>::type
+std::enable_if_t<AreSame<TensorType1, TensorType2>::value>
test_two()
{
const unsigned int dim = 2;
template <int, int, typename>
class TensorType2,
typename NumberType2>
-typename std::enable_if<!AreSame<TensorType1, TensorType2>::value>::type
+std::enable_if_t<!AreSame<TensorType1, TensorType2>::value>
test_two()
{}
template <int, int, typename>
class TensorType2,
typename NumberType2>
-typename std::enable_if<(AreSame<TensorType1, SymmetricTensor>::value &&
- AreSame<TensorType2, SymmetricTensor>::value)>::type
+std::enable_if_t<(AreSame<TensorType1, SymmetricTensor>::value &&
+ AreSame<TensorType2, SymmetricTensor>::value)>
test_three()
{
const unsigned int dim = 2;
template <int, int, typename>
class TensorType2,
typename NumberType2>
-typename std::enable_if<!(AreSame<TensorType1, SymmetricTensor>::value &&
- AreSame<TensorType2, SymmetricTensor>::value)>::type
+std::enable_if_t<!(AreSame<TensorType1, SymmetricTensor>::value &&
+ AreSame<TensorType2, SymmetricTensor>::value)>
test_three()
{}