13 #ifndef MLPACK_CORE_HPT_DEDUCE_HP_TYPES_HPP 14 #define MLPACK_CORE_HPT_DEDUCE_HP_TYPES_HPP 33 template<
typename... Args>
36 template<
typename... HPTypes>
48 template<
typename T,
typename... Args>
54 template<
typename ArgumentType,
55 bool IsArithmetic = std::is_arithmetic<ArgumentType>::value>
58 template<
typename ArithmeticType>
59 struct ResultHPType<ArithmeticType, true>
61 using Type = ArithmeticType;
68 template<
typename Type>
69 struct IsCollectionType
74 template<
typename TypeToCheck>
75 static Yes& Check(
typename TypeToCheck::value_type*);
77 static No& Check(...);
79 static const bool value =
80 sizeof(decltype(Check<Type>(0))) ==
sizeof(
Yes);
83 template<
typename CollectionType>
84 struct ResultHPType<CollectionType, false>
86 static_assert(IsCollectionType<CollectionType>::value,
87 "One of the passed arguments is neither of an arithmetic type, nor of " 88 "a collection type, nor fixed with the Fixed function.");
90 using Type =
typename CollectionType::value_type;
93 template<
typename... HPTypes>
97 ResultHolder<HPTypes...,
typename ResultHPType<T>::Type>
::TupleType;
108 template<
typename T,
typename... Args>
111 template<
typename... HPTypes>
125 template<
typename... Args>
Linear algebra utility functions, generally performed on matrices or vectors.
typename CollectionType::value_type Type
typename ResultHolder<>::TupleType TupleType
typename DeduceHyperParameterTypes< Args... >::TupleType TupleOfHyperParameters
A short alias for deducing types of hyper-parameters from types of arguments in the Optimize method i...
typename ResultHolder<>::TupleType TupleType
A type function for deducing types of hyper-parameters from types of arguments in the Optimize method...
typename DeduceHyperParameterTypes< Args... >::template ResultHolder< HPTypes... >::TupleType TupleType
std::tuple< HPTypes... > TupleType
typename DeduceHyperParameterTypes< Args... >::template ResultHolder< HPTypes..., typename ResultHPType< T >::Type >::TupleType TupleType
A struct for marking arguments as ones that should be fixed (it can be useful for the Optimize method...