mlpack  3.1.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
default_param.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_BINDINGS_MARKDOWN_DEFAULT_PARAM_HPP
15 #define MLPACK_BINDINGS_MARKDOWN_DEFAULT_PARAM_HPP
16 
17 #include "binding_info.hpp"
18 
22 
23 namespace mlpack {
24 namespace bindings {
25 namespace markdown {
26 
31 template<typename T>
32 void DefaultParam(const util::ParamData& data,
33  const void* /* input */,
34  void* output)
35 {
36  if (BindingInfo::Language() == "cli")
37  {
38  *((std::string*) output) =
39  cli::DefaultParamImpl<typename std::remove_pointer<T>::type>(data);
40  }
41  else if (BindingInfo::Language() == "python")
42  {
43  *((std::string*) output) =
44  python::DefaultParamImpl<typename std::remove_pointer<T>::type>(data);
45  }
46  else if (BindingInfo::Language() == "julia")
47  {
48  *((std::string*) output) =
49  julia::DefaultParamImpl<typename std::remove_pointer<T>::type>(data);
50  }
51  else
52  {
53  throw std::invalid_argument("DefaultParam(): unknown "
54  "BindingInfo::Language() " + BindingInfo::Language() + "!");
55  }
56 }
57 
58 } // namespace markdown
59 } // namespace bindings
60 } // namespace mlpack
61 
62 #endif
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:52
void DefaultParam(const util::ParamData &data, const void *, void *output)
Print the default value of a parameter into the output string.
static std::string & Language()
Get or modify the current language (don&#39;t set it to something invalid!).
string(REGEX REPLACE".*#define MLPACK_VERSION_MINOR ([0-9]+).*""\\1"MLPACK_VERSION_MINOR"${VERSION_HPP_CONTENTS}") string(REGEX REPLACE".* "\\1" MLPACK_VERSION_PATCH "$
Definition: CMakeLists.txt:35