mlpack  3.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
print_input_param.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_BINDINGS_JULIA_PRINT_INPUT_PARAM_HPP
14 #define MLPACK_BINDINGS_JULIA_PRINT_INPUT_PARAM_HPP
15 
16 #include "get_julia_type.hpp"
17 
18 namespace mlpack {
19 namespace bindings {
20 namespace julia {
21 
26 template<typename T>
28  const void* /* input */,
29  void* /* output */)
30 {
31  // "type" is a reserved keyword or function.
32  const std::string juliaName = (d.name == "type") ? "type_" : d.name;
33 
34  std::cout << juliaName;
35 
36  if (!arma::is_arma_type<T>::value)
37  {
38  std::cout << "::";
39  // If it's required, then we need the type.
40  if (d.required)
41  {
42  std::cout << GetJuliaType<typename std::remove_pointer<T>::type>(d);
43  }
44  else
45  {
46  std::cout << "Union{"
47  << GetJuliaType<typename std::remove_pointer<T>::type>(d)
48  << ", Missing} = missing";
49  }
50  }
51  else if (!d.required)
52  {
53  std::cout << " = missing";
54  }
55 }
56 
57 } // namespace julia
58 } // namespace bindings
59 } // namespace mlpack
60 
61 #endif
void PrintInputParam(util::ParamData &d, const void *, void *)
Print the declaration of an input parameter as part of a line in a Julia function definition...
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:52
if(NOT PYTHON_EXECUTABLE OR NOT PY_DISTUTILS OR NOT PY_CYTHON OR NOT PY_NUMPY OR NOT PY_PANDAS) if(NOT PYTHON_EXECUTABLE OR NOT PY_DISTUTILS OR NOT PY_CYTHON OR NOT PY_NUMPY OR NOT PY_PANDAS) set(BINDING_SOURCES default_param.hpp default_param_impl.hpp generate_pyx.hpp generate_pyx.cpp get_arma_type.hpp get_cython_type.hpp get_numpy_type.hpp get_numpy_type_char.hpp get_param.hpp get_printable_param.hpp get_python_type.hpp import_decl.hpp print_class_defn.hpp print_defn.hpp print_doc.hpp print_doc_functions.hpp print_doc_functions_impl.hpp print_input_processing.hpp print_output_processing.hpp print_pyx.hpp print_pyx.cpp print_type_doc.hpp print_type_doc_impl.hpp py_option.hpp strip_type.hpp mlpack/arma_util.hpp setup.cfg copy_artifacts.py) set(CYTHON_SOURCES mlpack/arma_numpy.pxd mlpack/arma_numpy.pyx mlpack/arma.pxd mlpack/arma_util.hpp mlpack/io.pxd mlpack/io_util.hpp mlpack/matrix_utils.py mlpack/serialization.hpp mlpack/serialization.pxd) set(TEST_SOURCES tests/dataset_info_test.py tests/test_python_binding.py) get_property(CYTHON_INCLUDE_DIRECTORIES DIRECTORY $
Definition: CMakeLists.txt:43
std::string name
Name of this parameter.
Definition: param_data.hpp:56
bool required
True if this option is required.
Definition: param_data.hpp:71
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:56
julia
Definition: CMakeLists.txt:61