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>
39 using TupleType = std::tuple<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;
100 using TupleType =
typename ResultHolder<>::TupleType;
108 template<
typename T,
typename... Args>
111 template<
typename... HPTypes>
115 ResultHolder<HPTypes...>::TupleType;
118 using TupleType =
typename ResultHolder<>::TupleType;
125 template<
typename... Args>
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
Definition: deduce_hp_types.hpp:37
A type function for deducing types of hyper-parameters from types of arguments in the Optimize method...
Definition: deduce_hp_types.hpp:34
A struct for marking arguments as ones that should be fixed (it can be useful for the Optimize method...
Definition: fixed.hpp:23
typename DeduceHyperParameterTypes< Args... >::TupleType TupleOfHyperParameters
A short alias for deducing types of hyper-parameters from types of arguments in the Optimize method i...
Definition: deduce_hp_types.hpp:127