mlpack_main.hpp
Go to the documentation of this file.
1 
9 #ifndef MLPACK_BINDINGS_PYTHON_MLPACK_MAIN_HPP
10 #define MLPACK_BINDINGS_PYTHON_MLPACK_MAIN_HPP
11 
12 #ifndef BINDING_TYPE
13  #error "BINDING_TYPE not defined! Don't include this file directly!"
14 #endif
15 #if BINDING_TYPE != BINDING_TYPE_PYX
16  #error "BINDING_TYPE is not set to BINDING_TYPE_PYX!"
17 #endif
18 
19 // Matrices are transposed on load/save.
20 #define BINDING_MATRIX_TRANSPOSED true
21 
24 
29 #define PRINT_PARAM_STRING mlpack::bindings::python::ParamString
30 
35 #define PRINT_PARAM_VALUE mlpack::bindings::python::PrintValue
36 
41 #define PRINT_DATASET mlpack::bindings::python::PrintDataset
42 
47 #define PRINT_MODEL mlpack::bindings::python::PrintModel
48 
56 #define PRINT_CALL mlpack::bindings::python::ProgramCall
57 
62 #define BINDING_IGNORE_CHECK(x) mlpack::bindings::python::IgnoreCheck( \
63  STRINGIFY(BINDING_NAME), x)
64 
70 #define BINDING_MIN_LABEL 0
71 
72 namespace mlpack {
73 namespace util {
74 
75 template<typename T>
77 
78 }
79 }
80 
82 
83 // In Python, we want to call the binding function mlpack_<BINDING_NAME>()
84 // instead of just <BINDING_NAME>(), so we change the definition of
85 // BINDING_FUNCTION().
86 #undef BINDING_FUNCTION
87 #define BINDING_FUNCTION(...) JOIN(mlpack_, BINDING_NAME)(__VA_ARGS__)
88 
89 // Define parameters available in every Python binding.
90 PARAM_GLOBAL(bool, "verbose", "Display informational messages and the full "
91  "list of parameters and timers at the end of execution.", "v", "bool",
92  false, true, false, false);
93 PARAM_GLOBAL(bool, "copy_all_inputs", "If specified, all input parameters "
94  "will be deep copied before the method is run. This is useful for "
95  "debugging problems where the input parameters are being modified "
96  "by the algorithm, but can slow down the code.", "", "bool",
97  false, true, false, false);
98 PARAM_GLOBAL(bool, "check_input_matrices", "If specified, the input matrix "
99  "is checked for NaN and inf values; an exception is thrown if any are "
100  "found.", "", "bool", false, true, false, false);
101 
102 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
mlpack::bindings::cli::CLIOption< T > Option
Definition: mlpack_main.hpp:77
The Python option class.
Definition: py_option.hpp:34
PARAM_GLOBAL(bool, "help", "Default help info.", "h", "bool", false, true, false, false)