mlpack  3.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
print_defn.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_BINDINGS_PYTHON_PRINT_DEFN_HPP
13 #define MLPACK_BINDINGS_PYTHON_PRINT_DEFN_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace bindings {
19 namespace python {
20 
25 template<typename T>
27  const void* /* input */,
28  void* /* output */)
29 {
30  // Make sure that we don't use names that are Python keywords.
31  std::string name = (d.name == "lambda") ? "lambda_" : d.name;
32 
33  std::cout << name;
34  if (std::is_same<T, bool>::value)
35  std::cout << "=False";
36  else if (!d.required)
37  std::cout << "=None";
38 }
39 
40 } // namespace python
41 } // namespace bindings
42 } // namespace mlpack
43 
44 #endif
void PrintDefn(util::ParamData &d, const void *, void *)
Print the definition for a Python binding parameter to stdout.
Definition: print_defn.hpp:26
The core includes that mlpack expects; standard C++ includes and Armadillo.
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:52
python
Definition: CMakeLists.txt:61
std::string name
Name of this parameter.
Definition: param_data.hpp:56
if(NOT R_FOUND OR NOT R_RCPP OR NOT R_RCPPARMADILLO OR NOT R_RCPPENSMALLEN OR NOT R_BH OR NOT R_ROXYGEN2 OR NOT R_TESTTHAT) if(NOT R_FOUND OR NOT R_RCPP OR NOT R_RCPPARMADILLO OR NOT R_RCPPENSMALLEN OR NOT R_BH OR NOT R_ROXYGEN2 OR NOT R_TESTTHAT) file(READ"$
Definition: CMakeLists.txt:61
bool required
True if this option is required.
Definition: param_data.hpp:71
src mlpack core util version hpp VERSION_HPP_CONTENTS string(REGEX REPLACE".*#define MLPACK_VERSION_MAJOR ([0-9]+).*""\\1"MLPACK_VERSION_MAJOR"${VERSION_HPP_CONTENTS}") string(REGEX REPLACE".* MLPACK_VERSION_MINOR "$
Definition: CMakeLists.txt:79