mlpack
3.4.2
mlpack-3.4.2
src
mlpack
bindings
julia
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>
27
void
PrintInputParam
(
util::ParamData
& d,
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
mlpack::bindings::julia::PrintInputParam
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.
Definition:
print_input_param.hpp:27
if
if(NOT BUILD_GO_SHLIB) macro(add_go_binding name) endmacro() return() endif() endmacro() macro(post_go_setup) if(BUILD_GO_BINDINGS) file(APPEND "$
Definition:
CMakeLists.txt:3
mlpack::util::ParamData
This structure holds all of the information about a single parameter, including its value (which is s...
Definition:
param_data.hpp:53
mlpack
Linear algebra utility functions, generally performed on matrices or vectors.
Definition:
add_to_cli11.hpp:21
julia
julia
Definition:
CMakeLists.txt:6
mlpack::util::ParamData::name
std::string name
Name of this parameter.
Definition:
param_data.hpp:56
mlpack::util::ParamData::required
bool required
True if this option is required.
Definition:
param_data.hpp:71
get_julia_type.hpp
Generated by
1.8.20