mlpack::bindings::go Namespace Reference

Classes

class  GoOption
 The Go option class. More...

 

Functions

std::string CamelCase (std::string s)
 Given an snake_case like, e.g., "logistic_regression", return CamelCase(e.g. More...

 
template
<
typename
T
>
void DefaultParam (const util::ParamData &data, const void *, void *output)
 Return the default value of an option. More...

 
template
<
typename
T
>
std::string DefaultParamImpl (const util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::string >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *=0)
 Return the default value of an option. More...

 
template
<
typename
T
>
std::string DefaultParamImpl (const util::ParamData &data, const typename boost::enable_if< util::IsStdVector< T >>::type *=0)
 Return the default value of a vector option. More...

 
template
<
typename
T
>
std::string DefaultParamImpl (const util::ParamData &data, const typename boost::enable_if< std::is_same< T, std::string >>::type *=0)
 Return the default value of a string option. More...

 
template
<
typename
T
>
std::string DefaultParamImpl (const util::ParamData &data, const typename boost::enable_if_c< arma::is_arma_type< T >::value||std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>::value >::type *=0)
 Return the default value of a matrix option, a tuple option, a serializable option, or a string option (this returns the default filename, or '' if the default is no file). More...

 
template
<
typename
T
>
std::string DefaultParamImpl (const util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Return the default value of a model option (this returns the default filename, or '' if the default is no file). More...

 
std::string GetBindingName (const std::string &bindingName)
 Given the name of a binding, print its Go name. More...

 
template
<
typename
T
>
std::string GetGoType (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 
template
<
typename
T
>
std::string GetGoType (const util::ParamData &d, const typename boost::enable_if< util::IsStdVector< T >>::type *=0)
 
template
<
typename
T
>
std::string GetGoType (const util::ParamData &, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 
template
<
typename
T
>
std::string GetGoType (const util::ParamData &, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 
template
<
typename
T
>
std::string GetGoType (const util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 
template
<
>
std::string GetGoType< bool > (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< bool >>::type *, const typename boost::disable_if< data::HasSerialize< bool >>::type *, const typename boost::disable_if< arma::is_arma_type< bool >>::type *, const typename boost::disable_if< std::is_same< bool, std::tuple< data::DatasetInfo, arma::mat >>>::type *)
 
template
<
>
std::string GetGoType< double > (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< double >>::type *, const typename boost::disable_if< data::HasSerialize< double >>::type *, const typename boost::disable_if< arma::is_arma_type< double >>::type *, const typename boost::disable_if< std::is_same< double, std::tuple< data::DatasetInfo, arma::mat >>>::type *)
 
template
<
>
std::string GetGoType< float > (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< float >>::type *, const typename boost::disable_if< data::HasSerialize< float >>::type *, const typename boost::disable_if< arma::is_arma_type< float >>::type *, const typename boost::disable_if< std::is_same< float, std::tuple< data::DatasetInfo, arma::mat >>>::type *)
 
template
<
>
std::string GetGoType< int > (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< int >>::type *, const typename boost::disable_if< data::HasSerialize< int >>::type *, const typename boost::disable_if< arma::is_arma_type< int >>::type *, const typename boost::disable_if< std::is_same< int, std::tuple< data::DatasetInfo, arma::mat >>>::type *)
 
template
<
>
std::string GetGoType< std::string > (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< std::string >>::type *, const typename boost::disable_if< data::HasSerialize< std::string >>::type *, const typename boost::disable_if< arma::is_arma_type< std::string >>::type *, const typename boost::disable_if< std::is_same< std::string, std::tuple< data::DatasetInfo, arma::mat >>>::type *)
 
void GetOptions (std::vector< std::tuple< std::string, std::string >> &)
 
template<typename T , typename... Args>
void GetOptions (std::vector< std::tuple< std::string, std::string >> &results, const std::string &paramName, const T &value, Args... args)
 Assemble a vector of string tuples indicating parameter names and what should be printed for them. More...

 
template
<
typename
T
>
void GetParam (const util::ParamData &d, const void *, void *output)
 All Go binding types are exactly what is held in the ParamData, so no special handling is necessary. More...

 
template
<
typename
T
>
std::string GetPrintableParam (const util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Print an option of a simple type. More...

 
template
<
typename
T
>
std::string GetPrintableParam (const util::ParamData &data, const typename boost::enable_if< util::IsStdVector< T >>::type *=0)
 Print a vector option, with spaces between it. More...

 
template
<
typename
T
>
std::string GetPrintableParam (const util::ParamData &data, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 Print a matrix option (this prints its size). More...

 
template
<
typename
T
>
std::string GetPrintableParam (const util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Print a serializable class option (this prints the class name). More...

 
template
<
typename
T
>
std::string GetPrintableParam (const util::ParamData &data, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Print a combination DatasetInfo/matrix parameter. More...

 
template
<
typename
T
>
void GetPrintableParam (const util::ParamData &data, const void *, void *output)
 Print an option into a std::string. More...

 
template
<
typename
T
>
std::string GetPrintableType (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 
template
<
typename
T
>
std::string GetPrintableType (const util::ParamData &d, const typename boost::enable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 
template
<
typename
T
>
std::string GetPrintableType (const util::ParamData &, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 
template
<
typename
T
>
std::string GetPrintableType (const util::ParamData &, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 
template
<
typename
T
>
std::string GetPrintableType (const util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 
template
<
typename
T
>
void GetPrintableType (const util::ParamData &d, const void *, void *output)
 
template
<
>
std::string GetPrintableType< bool > (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< bool >>::type *, const typename boost::disable_if< data::HasSerialize< bool >>::type *, const typename boost::disable_if< arma::is_arma_type< bool >>::type *, const typename boost::disable_if< std::is_same< bool, std::tuple< data::DatasetInfo, arma::mat >>>::type *)
 
template
<
>
std::string GetPrintableType< double > (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< double >>::type *, const typename boost::disable_if< data::HasSerialize< double >>::type *, const typename boost::disable_if< arma::is_arma_type< double >>::type *, const typename boost::disable_if< std::is_same< double, std::tuple< data::DatasetInfo, arma::mat >>>::type *)
 
template
<
>
std::string GetPrintableType< int > (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< int >>::type *, const typename boost::disable_if< data::HasSerialize< int >>::type *, const typename boost::disable_if< arma::is_arma_type< int >>::type *, const typename boost::disable_if< std::is_same< int, std::tuple< data::DatasetInfo, arma::mat >>>::type *)
 
template
<
>
std::string GetPrintableType< std::string > (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< std::string >>::type *, const typename boost::disable_if< data::HasSerialize< std::string >>::type *, const typename boost::disable_if< arma::is_arma_type< std::string >>::type *, const typename boost::disable_if< std::is_same< std::string, std::tuple< data::DatasetInfo, arma::mat >>>::type *)
 
template
<
typename
T
>
std::string GetType (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0)
 
template
<
typename
T
>
std::string GetType (const util::ParamData &d, const typename boost::enable_if< util::IsStdVector< T >>::type *=0)
 
template
<
typename
T
>
std::string GetType (const util::ParamData &, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 
template
<
typename
T
>
std::string GetType (const util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 
template
<
typename
T
>
void GetType (const util::ParamData &d, const void *, void *output)
 Function is used to generate the type names that are used in calls to functions like gonumToArma<type>() or setParam<type>(), and therefore what's returned isn't exactly the Go native type used for that parameter type. More...

 
template
<
>
std::string GetType< bool > (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< bool >>::type *, const typename boost::disable_if< data::HasSerialize< bool >>::type *, const typename boost::disable_if< arma::is_arma_type< bool >>::type *)
 
template
<
>
std::string GetType< double > (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< double >>::type *, const typename boost::disable_if< data::HasSerialize< double >>::type *, const typename boost::disable_if< arma::is_arma_type< double >>::type *)
 
template
<
>
std::string GetType< float > (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< float >>::type *, const typename boost::disable_if< data::HasSerialize< float >>::type *, const typename boost::disable_if< arma::is_arma_type< float >>::type *)
 
template
<
>
std::string GetType< int > (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< int >>::type *, const typename boost::disable_if< data::HasSerialize< int >>::type *, const typename boost::disable_if< arma::is_arma_type< int >>::type *)
 
template
<
>
std::string GetType< std::string > (const util::ParamData &, const typename boost::disable_if< util::IsStdVector< std::string >>::type *, const typename boost::disable_if< data::HasSerialize< std::string >>::type *, const typename boost::disable_if< arma::is_arma_type< std::string >>::type *)
 
bool IgnoreCheck (const std::string &paramName)
 Print whether or not we should ignore a check on the given parameter. More...

 
bool IgnoreCheck (const std::vector< std::string > &constraints)
 Print whether or not we should ignore a check on the given set of constraints. More...

 
bool IgnoreCheck (const std::vector< std::pair< std::string, bool >> &constraints, const std::string &paramName)
 Print whether or not we should ignore a check on the given set of constraints. More...

 
template
<
typename
T
>
void ImportDecl (const util::ParamData &, const size_t indent, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 For a serializable type, print a cppclass definition. More...

 
template
<
typename
T
>
void ImportDecl (const util::ParamData &, const size_t, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0)
 For a non-serializable type, print nothing. More...

 
template
<
typename
T
>
void ImportDecl (const util::ParamData &, const size_t, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 For a matrix type, print nothing. More...

 
template
<
typename
T
>
void ImportDecl (const util::ParamData &d, const void *indent, void *)
 Print the cppclass definition for a serializable model; print nothing for a non-serializable type. More...

 
std::string ParamString (const std::string &paramName)
 Given the parameter name, determine what it would actually be when passed to the command line. More...

 
void PrintCPP (const util::ProgramDoc &programInfo, const std::string &mainFilename, const std::string &functionName)
 Given a list of parameter definition and program documentation, print a generated .cpp file to stdout. More...

 
std::string PrintDataset (const std::string &datasetName)
 Given the name of a matrix, print it. More...

 
std::string PrintDefault (const std::string &paramName)
 Given a parameter name, print its corresponding default value. More...

 
template
<
typename
T
>
void PrintDefnInput (const util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Print input in method definition for a regular parameter type. More...

 
template
<
typename
T
>
void PrintDefnInput (const util::ParamData &d, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 Print input in method definition for a matrix type. More...

 
template
<
typename
T
>
void PrintDefnInput (const util::ParamData &d, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Print input in method definition for a matrix with info type. More...

 
template
<
typename
T
>
void PrintDefnInput (const util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Print input in method definition for a serializable model. More...

 
template
<
typename
T
>
void PrintDefnInput (const util::ParamData &d, const void *, void *)
 Given parameter information and the current number of spaces for indentation, print the code to process the output to cout. More...

 
template
<
typename
T
>
void PrintDefnOutput (const util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Print output for a regular parameter type. More...

 
template
<
typename
T
>
void PrintDefnOutput (const util::ParamData &d, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 Print output for a matrix type. More...

 
template
<
typename
T
>
void PrintDefnOutput (const util::ParamData &d, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Print output for a matrix with info type. More...

 
template
<
typename
T
>
void PrintDefnOutput (const util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Print output for a serializable model. More...

 
template
<
typename
T
>
void PrintDefnOutput (const util::ParamData &d, const void *, void *)
 Given parameter information and the current number of spaces for indentation, print the code to process the output to cout. More...

 
template
<
typename
T
>
void PrintDoc (const util::ParamData &d, const void *input, void *)
 Print the docstring documentation for a given parameter. More...

 
void PrintGo (const util::ProgramDoc &programInfo, const std::string &functionName)
 Given a list of parameter definition and program documentation, print a generated .go file to stdout. More...

 
void PrintH (const util::ProgramDoc &programInfo, const std::string &functionName)
 Given a list of parameter definition and program documentation, print a generated .h file to stdout. More...

 
std::string PrintImport ()
 Print any import information for the Go binding. More...

 
std::string PrintInputOptions ()
 
template<typename T , typename... Args>
std::string PrintInputOptions (const std::string &paramName, const T &value, Args... args)
 Print an input option. More...

 
template
<
typename
T
>
void PrintInputProcessing (const util::ParamData &d, const size_t indent, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Print input processing for a standard option type. More...

 
template
<
typename
T
>
void PrintInputProcessing (const util::ParamData &d, const size_t indent, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 Print input processing for a matrix type. More...

 
template
<
typename
T
>
void PrintInputProcessing (const util::ParamData &d, const size_t indent, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Print input processing for a matrix with info type. More...

 
template
<
typename
T
>
void PrintInputProcessing (const util::ParamData &d, const size_t indent, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Print input processing for a serializable type. More...

 
template
<
typename
T
>
void PrintInputProcessing (const util::ParamData &d, const void *input, void *)
 Given parameter information and the current number of spaces for indentation, print the code to process the input to cout. More...

 
template
<
typename
T
>
void PrintMethodConfig (const util::ParamData &d, const size_t indent, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Print param in configuration struct for a standard option type. More...

 
template
<
typename
T
>
void PrintMethodConfig (const util::ParamData &d, const size_t indent, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 Print param in configuration struct for a matrix type. More...

 
template
<
typename
T
>
void PrintMethodConfig (const util::ParamData &d, const size_t indent, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Print param in configuration struct for a matrix with info type. More...

 
template
<
typename
T
>
void PrintMethodConfig (const util::ParamData &d, const size_t indent, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Print param in method configuration struct for a serializable type. More...

 
template
<
typename
T
>
void PrintMethodConfig (const util::ParamData &d, const void *input, void *)
 Given parameter information and the current number of spaces for indentation, print the code to process the input to cout. More...

 
template
<
typename
T
>
void PrintMethodInit (const util::ParamData &d, const size_t indent, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Print parameter with it's default value for a standard option type. More...

 
template
<
typename
T
>
void PrintMethodInit (const util::ParamData &d, const size_t indent, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 Print parameter with its default value for a matrix type. More...

 
template
<
typename
T
>
void PrintMethodInit (const util::ParamData &d, const size_t indent, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Print parameter with its default value for a matrix with info type. More...

 
template
<
typename
T
>
void PrintMethodInit (const util::ParamData &d, const size_t indent, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Print parameter with its default value for a serializable type. More...

 
template
<
typename
T
>
void PrintMethodInit (const util::ParamData &d, const void *input, void *)
 Given parameter information and the current number of spaces for indentation, print the code to process the input to cout. More...

 
std::string PrintModel (const std::string &modelName)
 Given the name of a model, print it. More...

 
template
<
typename
T
>
void PrintModelUtilCPP (const util::ParamData &, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Non-serializable models don't require any special definitions, so this prints nothing. More...

 
template
<
typename
T
>
void PrintModelUtilCPP (const util::ParamData &, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 Matrices don't require any special definitions, so this prints nothing. More...

 
template
<
typename
T
>
void PrintModelUtilCPP (const util::ParamData &, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Matrices with Info don't require any special definitions, so this prints nothing. More...

 
template
<
typename
T
>
void PrintModelUtilCPP (const util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Serializable models require a special class definition. More...

 
template
<
typename
T
>
void PrintModelUtilCPP (const util::ParamData &d, const void *, void *)
 Print the function to set and get serialization models from Go to mlpack. More...

 
template
<
typename
T
>
void PrintModelUtilGo (const util::ParamData &, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Non-serializable models don't require any special definitions, so this prints nothing. More...

 
template
<
typename
T
>
void PrintModelUtilGo (const util::ParamData &, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 Matrices don't require any special definitions, so this prints nothing. More...

 
template
<
typename
T
>
void PrintModelUtilGo (const util::ParamData &, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Matrices with Info don't require any special definitions, so this prints nothing. More...

 
template
<
typename
T
>
void PrintModelUtilGo (const util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Serializable models require a special class definition. More...

 
template
<
typename
T
>
void PrintModelUtilGo (const util::ParamData &d, const void *, void *)
 Print the Go struct for Go serialization model and their associated set and get methods. More...

 
template
<
typename
T
>
void PrintModelUtilH (const util::ParamData &, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Non-serializable models don't require any special definitions, so this prints nothing. More...

 
template
<
typename
T
>
void PrintModelUtilH (const util::ParamData &, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 Matrices don't require any special definitions, so this prints nothing. More...

 
template
<
typename
T
>
void PrintModelUtilH (const util::ParamData &, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Matrices with Info don't require any special definitions, so this prints nothing. More...

 
template
<
typename
T
>
void PrintModelUtilH (const util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Serializable models require a special class definition. More...

 
template
<
typename
T
>
void PrintModelUtilH (const util::ParamData &d, const void *, void *)
 Print the function to set and get serialization models from Go to mlpack. More...

 
std::string PrintOptionalInputs ()
 
template<typename T , typename... Args>
std::string PrintOptionalInputs (const std::string &paramName, const T &value, Args... args)
 Print an input option. More...

 
std::string PrintOutputOptionInfo ()
 Print any special information about output options. More...

 
std::string PrintOutputOptions ()
 
template<typename... Args>
std::string PrintOutputOptions (Args... args)
 
template
<
typename
T
>
void PrintOutputProcessing (const util::ParamData &d, const size_t indent, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Print output processing for a regular parameter type. More...

 
template
<
typename
T
>
void PrintOutputProcessing (const util::ParamData &d, const size_t indent, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0, const typename std::enable_if<!std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *=0)
 Print output processing for a matrix type. More...

 
template
<
typename
T
>
void PrintOutputProcessing (const util::ParamData &d, const size_t indent, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Print output processing for a matrix with info type. More...

 
template
<
typename
T
>
void PrintOutputProcessing (const util::ParamData &d, const size_t indent, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Print output processing for a serializable model. More...

 
template
<
typename
T
>
void PrintOutputProcessing (const util::ParamData &d, const void *, void *)
 
template
<
typename
T
>
std::string PrintTypeDoc (const util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Return a string representing the command-line type of an option. More...

 
template
<
typename
T
>
std::string PrintTypeDoc (const util::ParamData &data, const typename std::enable_if< util::IsStdVector< T >::value >::type *=0)
 Return a string representing the command-line type of a vector. More...

 
template
<
typename
T
>
std::string PrintTypeDoc (const util::ParamData &data, const typename std::enable_if< arma::is_arma_type< T >::value >::type *=0)
 Return a string representing the command-line type of a matrix option. More...

 
template
<
typename
T
>
std::string PrintTypeDoc (const util::ParamData &data, const typename std::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *=0)
 Return a string representing the command-line type of a matrix tuple option. More...

 
template
<
typename
T
>
std::string PrintTypeDoc (const util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Return a string representing the command-line type of a model. More...

 
template
<
typename
T
>
void PrintTypeDoc (const util::ParamData &data, const void *, void *output)
 Print the command-line type of an option into a string. More...

 
template
<
typename
T
>
std::string PrintValue (const T &value, bool quotes)
 Given a parameter type, print the corresponding value. More...

 
template
<
>
std::string PrintValue (const bool &value, bool quotes)
 
template<typename... Args>
std::string ProgramCall (const std::string &programName, Args... args)
 Given a name of a binding and a variable number of arguments (and their contents), print the corresponding function call. More...

 
void StripType (const std::string &inputType, std::string &goStrippedType, std::string &strippedType, std::string &printedType, std::string &defaultsType)
 Given an input type like, e.g., "LogisticRegression<>", return four types that can be used in Go code. More...

 

Variables

std::string programName
 

Function Documentation

◆ CamelCase()

std::string mlpack::bindings::go::CamelCase ( std::string  s)
inline

Given an snake_case like, e.g., "logistic_regression", return CamelCase(e.g.

"LogisticRegression") that can be used in Go code.

Definition at line 24 of file camel_case.hpp.

Referenced by PrintDefnInput(), PrintDoc(), PrintInputProcessing(), PrintMethodConfig(), PrintMethodInit(), and PrintOutputProcessing().

◆ DefaultParam()

void mlpack::bindings::go::DefaultParam ( const util::ParamData data,
const void *  ,
void *  output 
)

Return the default value of an option.

This is the function that will be placed into the CLI functionMap.

Definition at line 80 of file default_param.hpp.

◆ DefaultParamImpl() [1/5]

std::string mlpack::bindings::go::DefaultParamImpl ( const util::ParamData data,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< util::IsStdVector< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::string >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Return the default value of an option.

This is for regular types.

◆ DefaultParamImpl() [2/5]

std::string mlpack::bindings::go::DefaultParamImpl ( const util::ParamData data,
const typename boost::enable_if< util::IsStdVector< T >>::type *  = 0 
)

Return the default value of a vector option.

◆ DefaultParamImpl() [3/5]

std::string mlpack::bindings::go::DefaultParamImpl ( const util::ParamData data,
const typename boost::enable_if< std::is_same< T, std::string >>::type *  = 0 
)

Return the default value of a string option.

◆ DefaultParamImpl() [4/5]

std::string mlpack::bindings::go::DefaultParamImpl ( const util::ParamData data,
const typename boost::enable_if_c< arma::is_arma_type< T >::value||std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>::value >::type *  = 0 
)

Return the default value of a matrix option, a tuple option, a serializable option, or a string option (this returns the default filename, or '' if the default is no file).

◆ DefaultParamImpl() [5/5]

std::string mlpack::bindings::go::DefaultParamImpl ( const util::ParamData data,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Return the default value of a model option (this returns the default filename, or '' if the default is no file).

◆ GetBindingName()

std::string mlpack::bindings::go::GetBindingName ( const std::string &  bindingName)
inline

Given the name of a binding, print its Go name.

◆ GetGoType() [1/5]

std::string mlpack::bindings::go::GetGoType ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)
inline

Definition at line 26 of file get_go_type.hpp.

◆ GetGoType() [2/5]

std::string mlpack::bindings::go::GetGoType ( const util::ParamData d,
const typename boost::enable_if< util::IsStdVector< T >>::type *  = 0 
)
inline

Definition at line 98 of file get_go_type.hpp.

◆ GetGoType() [3/5]

std::string mlpack::bindings::go::GetGoType ( const util::ParamData ,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)
inline

Definition at line 106 of file get_go_type.hpp.

◆ GetGoType() [4/5]

std::string mlpack::bindings::go::GetGoType ( const util::ParamData ,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)
inline

Definition at line 116 of file get_go_type.hpp.

◆ GetGoType() [5/5]

std::string mlpack::bindings::go::GetGoType ( const util::ParamData d,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)
inline

Definition at line 125 of file get_go_type.hpp.

References ParamData::cppType, and StripType().

◆ GetGoType< bool >()

std::string mlpack::bindings::go::GetGoType< bool > ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< bool >>::type *  ,
const typename boost::disable_if< data::HasSerialize< bool >>::type *  ,
const typename boost::disable_if< arma::is_arma_type< bool >>::type *  ,
const typename boost::disable_if< std::is_same< bool, std::tuple< data::DatasetInfo, arma::mat >>>::type *   
)
inline

Definition at line 86 of file get_go_type.hpp.

◆ GetGoType< double >()

std::string mlpack::bindings::go::GetGoType< double > ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< double >>::type *  ,
const typename boost::disable_if< data::HasSerialize< double >>::type *  ,
const typename boost::disable_if< arma::is_arma_type< double >>::type *  ,
const typename boost::disable_if< std::is_same< double, std::tuple< data::DatasetInfo, arma::mat >>>::type *   
)
inline

Definition at line 62 of file get_go_type.hpp.

◆ GetGoType< float >()

std::string mlpack::bindings::go::GetGoType< float > ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< float >>::type *  ,
const typename boost::disable_if< data::HasSerialize< float >>::type *  ,
const typename boost::disable_if< arma::is_arma_type< float >>::type *  ,
const typename boost::disable_if< std::is_same< float, std::tuple< data::DatasetInfo, arma::mat >>>::type *   
)
inline

Definition at line 50 of file get_go_type.hpp.

◆ GetGoType< int >()

std::string mlpack::bindings::go::GetGoType< int > ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< int >>::type *  ,
const typename boost::disable_if< data::HasSerialize< int >>::type *  ,
const typename boost::disable_if< arma::is_arma_type< int >>::type *  ,
const typename boost::disable_if< std::is_same< int, std::tuple< data::DatasetInfo, arma::mat >>>::type *   
)
inline

Definition at line 38 of file get_go_type.hpp.

◆ GetGoType< std::string >()

std::string mlpack::bindings::go::GetGoType< std::string > ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< std::string >>::type *  ,
const typename boost::disable_if< data::HasSerialize< std::string >>::type *  ,
const typename boost::disable_if< arma::is_arma_type< std::string >>::type *  ,
const typename boost::disable_if< std::is_same< std::string, std::tuple< data::DatasetInfo, arma::mat >>>::type *   
)
inline

Definition at line 74 of file get_go_type.hpp.

◆ GetOptions() [1/2]

void mlpack::bindings::go::GetOptions ( std::vector< std::tuple< std::string, std::string >> &  )
inline

◆ GetOptions() [2/2]

void mlpack::bindings::go::GetOptions ( std::vector< std::tuple< std::string, std::string >> &  results,
const std::string &  paramName,
const T &  value,
Args...  args 
)

Assemble a vector of string tuples indicating parameter names and what should be printed for them.

(For output parameters, we just need to print the value.)

◆ GetParam()

void mlpack::bindings::go::GetParam ( const util::ParamData d,
const void *  ,
void *  output 
)

All Go binding types are exactly what is held in the ParamData, so no special handling is necessary.

Definition at line 26 of file get_param.hpp.

References ParamData::value.

◆ GetPrintableParam() [1/6]

std::string mlpack::bindings::go::GetPrintableParam ( const util::ParamData data,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< util::IsStdVector< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Print an option of a simple type.

Print an option.

Definition at line 26 of file get_printable_param.hpp.

◆ GetPrintableParam() [2/6]

std::string mlpack::bindings::go::GetPrintableParam ( const util::ParamData data,
const typename boost::enable_if< util::IsStdVector< T >>::type *  = 0 
)

Print a vector option, with spaces between it.

Definition at line 43 of file get_printable_param.hpp.

◆ GetPrintableParam() [3/6]

std::string mlpack::bindings::go::GetPrintableParam ( const util::ParamData data,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Print a matrix option (this prints its size).

Print a matrix option (this just prints the filename).

Definition at line 59 of file get_printable_param.hpp.

◆ GetPrintableParam() [4/6]

std::string mlpack::bindings::go::GetPrintableParam ( const util::ParamData data,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Print a serializable class option (this prints the class name).

Print a serializable class option (this just prints the filename).

Print a model option (this just prints the filename).

Definition at line 75 of file get_printable_param.hpp.

◆ GetPrintableParam() [5/6]

std::string mlpack::bindings::go::GetPrintableParam ( const util::ParamData data,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Print a combination DatasetInfo/matrix parameter.

Print a mapped matrix option (this just prints the filename).

Definition at line 89 of file get_printable_param.hpp.

◆ GetPrintableParam() [6/6]

void mlpack::bindings::go::GetPrintableParam ( const util::ParamData data,
const void *  ,
void *  output 
)

Print an option into a std::string.

This should print a short, one-line representation of the object. The string will be stored in the output pointer.

Parameters
dataParameter data struct.
inputUnused parameter.
outputOutput storage for the string.

Definition at line 114 of file get_printable_param.hpp.

◆ GetPrintableType() [1/6]

std::string mlpack::bindings::go::GetPrintableType ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)
inline

◆ GetPrintableType() [2/6]

std::string mlpack::bindings::go::GetPrintableType ( const util::ParamData d,
const typename boost::enable_if< util::IsStdVector< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)
inline

◆ GetPrintableType() [3/6]

std::string mlpack::bindings::go::GetPrintableType ( const util::ParamData ,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)
inline

◆ GetPrintableType() [4/6]

std::string mlpack::bindings::go::GetPrintableType ( const util::ParamData ,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)
inline

◆ GetPrintableType() [5/6]

std::string mlpack::bindings::go::GetPrintableType ( const util::ParamData d,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)
inline

◆ GetPrintableType() [6/6]

void mlpack::bindings::go::GetPrintableType ( const util::ParamData d,
const void *  ,
void *  output 
)

Definition at line 97 of file get_printable_type.hpp.

◆ GetPrintableType< bool >()

std::string mlpack::bindings::go::GetPrintableType< bool > ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< bool >>::type *  ,
const typename boost::disable_if< data::HasSerialize< bool >>::type *  ,
const typename boost::disable_if< arma::is_arma_type< bool >>::type *  ,
const typename boost::disable_if< std::is_same< bool, std::tuple< data::DatasetInfo, arma::mat >>>::type *   
)
inline

◆ GetPrintableType< double >()

std::string mlpack::bindings::go::GetPrintableType< double > ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< double >>::type *  ,
const typename boost::disable_if< data::HasSerialize< double >>::type *  ,
const typename boost::disable_if< arma::is_arma_type< double >>::type *  ,
const typename boost::disable_if< std::is_same< double, std::tuple< data::DatasetInfo, arma::mat >>>::type *   
)
inline

◆ GetPrintableType< int >()

std::string mlpack::bindings::go::GetPrintableType< int > ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< int >>::type *  ,
const typename boost::disable_if< data::HasSerialize< int >>::type *  ,
const typename boost::disable_if< arma::is_arma_type< int >>::type *  ,
const typename boost::disable_if< std::is_same< int, std::tuple< data::DatasetInfo, arma::mat >>>::type *   
)
inline

◆ GetPrintableType< std::string >()

std::string mlpack::bindings::go::GetPrintableType< std::string > ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< std::string >>::type *  ,
const typename boost::disable_if< data::HasSerialize< std::string >>::type *  ,
const typename boost::disable_if< arma::is_arma_type< std::string >>::type *  ,
const typename boost::disable_if< std::is_same< std::string, std::tuple< data::DatasetInfo, arma::mat >>>::type *   
)
inline

◆ GetType() [1/5]

std::string mlpack::bindings::go::GetType ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0 
)
inline

Definition at line 25 of file get_type.hpp.

◆ GetType() [2/5]

std::string mlpack::bindings::go::GetType ( const util::ParamData d,
const typename boost::enable_if< util::IsStdVector< T >>::type *  = 0 
)
inline

Definition at line 85 of file get_type.hpp.

◆ GetType() [3/5]

std::string mlpack::bindings::go::GetType ( const util::ParamData ,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)
inline

Definition at line 93 of file get_type.hpp.

◆ GetType() [4/5]

std::string mlpack::bindings::go::GetType ( const util::ParamData d,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)
inline

Definition at line 121 of file get_type.hpp.

References ParamData::cppType.

◆ GetType() [5/5]

void mlpack::bindings::go::GetType ( const util::ParamData d,
const void *  ,
void *  output 
)

Function is used to generate the type names that are used in calls to functions like gonumToArma<type>() or setParam<type>(), and therefore what's returned isn't exactly the Go native type used for that parameter type.

Parameters
dataParameter data struct.
inputUnused parameter.
outputOutput storage for the string.

Definition at line 140 of file get_type.hpp.

◆ GetType< bool >()

std::string mlpack::bindings::go::GetType< bool > ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< bool >>::type *  ,
const typename boost::disable_if< data::HasSerialize< bool >>::type *  ,
const typename boost::disable_if< arma::is_arma_type< bool >>::type *   
)
inline

Definition at line 75 of file get_type.hpp.

◆ GetType< double >()

std::string mlpack::bindings::go::GetType< double > ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< double >>::type *  ,
const typename boost::disable_if< data::HasSerialize< double >>::type *  ,
const typename boost::disable_if< arma::is_arma_type< double >>::type *   
)
inline

Definition at line 55 of file get_type.hpp.

◆ GetType< float >()

std::string mlpack::bindings::go::GetType< float > ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< float >>::type *  ,
const typename boost::disable_if< data::HasSerialize< float >>::type *  ,
const typename boost::disable_if< arma::is_arma_type< float >>::type *   
)
inline

Definition at line 45 of file get_type.hpp.

◆ GetType< int >()

std::string mlpack::bindings::go::GetType< int > ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< int >>::type *  ,
const typename boost::disable_if< data::HasSerialize< int >>::type *  ,
const typename boost::disable_if< arma::is_arma_type< int >>::type *   
)
inline

Definition at line 35 of file get_type.hpp.

◆ GetType< std::string >()

std::string mlpack::bindings::go::GetType< std::string > ( const util::ParamData ,
const typename boost::disable_if< util::IsStdVector< std::string >>::type *  ,
const typename boost::disable_if< data::HasSerialize< std::string >>::type *  ,
const typename boost::disable_if< arma::is_arma_type< std::string >>::type *   
)
inline

Definition at line 65 of file get_type.hpp.

◆ IgnoreCheck() [1/3]

bool mlpack::bindings::go::IgnoreCheck ( const std::string &  paramName)
inline

Print whether or not we should ignore a check on the given parameter.

◆ IgnoreCheck() [2/3]

bool mlpack::bindings::go::IgnoreCheck ( const std::vector< std::string > &  constraints)
inline

Print whether or not we should ignore a check on the given set of constraints.

◆ IgnoreCheck() [3/3]

bool mlpack::bindings::go::IgnoreCheck ( const std::vector< std::pair< std::string, bool >> &  constraints,
const std::string &  paramName 
)
inline

Print whether or not we should ignore a check on the given set of constraints.

◆ ImportDecl() [1/4]

void mlpack::bindings::go::ImportDecl ( const util::ParamData ,
const size_t  indent,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

For a serializable type, print a cppclass definition.

This will give output of the form:

Definition at line 25 of file print_import_decl.hpp.

◆ ImportDecl() [2/4]

void mlpack::bindings::go::ImportDecl ( const util::ParamData ,
const size_t  ,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0 
)

For a non-serializable type, print nothing.

Definition at line 45 of file print_import_decl.hpp.

◆ ImportDecl() [3/4]

void mlpack::bindings::go::ImportDecl ( const util::ParamData ,
const size_t  ,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

For a matrix type, print nothing.

Definition at line 58 of file print_import_decl.hpp.

◆ ImportDecl() [4/4]

void mlpack::bindings::go::ImportDecl ( const util::ParamData d,
const void *  indent,
void *   
)

Print the cppclass definition for a serializable model; print nothing for a non-serializable type.

Parameters
dParameter info struct.
inputPointer to size_t indicating indent.
outputUnused parameter.

Definition at line 75 of file print_import_decl.hpp.

◆ ParamString()

std::string mlpack::bindings::go::ParamString ( const std::string &  paramName)
inline

Given the parameter name, determine what it would actually be when passed to the command line.

◆ PrintCPP()

void mlpack::bindings::go::PrintCPP ( const util::ProgramDoc programInfo,
const std::string &  mainFilename,
const std::string &  functionName 
)

Given a list of parameter definition and program documentation, print a generated .cpp file to stdout.

Parameters
parametersList of parameters the program will use (from CLI).
programInfoDocumentation for the program.
functionNameName of the function (i.e. "pca").

◆ PrintDataset()

std::string mlpack::bindings::go::PrintDataset ( const std::string &  datasetName)
inline

Given the name of a matrix, print it.

Here we do not need to modify anything.

◆ PrintDefault()

std::string mlpack::bindings::go::PrintDefault ( const std::string &  paramName)
inline

Given a parameter name, print its corresponding default value.

◆ PrintDefnInput() [1/5]

void mlpack::bindings::go::PrintDefnInput ( const util::ParamData d,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Print input in method definition for a regular parameter type.

Definition at line 29 of file print_defn_input.hpp.

References CamelCase(), ParamData::name, and ParamData::required.

◆ PrintDefnInput() [2/5]

void mlpack::bindings::go::PrintDefnInput ( const util::ParamData d,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Print input in method definition for a matrix type.

Definition at line 47 of file print_defn_input.hpp.

References CamelCase(), ParamData::name, and ParamData::required.

◆ PrintDefnInput() [3/5]

void mlpack::bindings::go::PrintDefnInput ( const util::ParamData d,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Print input in method definition for a matrix with info type.

Definition at line 63 of file print_defn_input.hpp.

References CamelCase(), ParamData::name, and ParamData::required.

◆ PrintDefnInput() [4/5]

void mlpack::bindings::go::PrintDefnInput ( const util::ParamData d,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Print input in method definition for a serializable model.

Definition at line 80 of file print_defn_input.hpp.

References CamelCase(), ParamData::cppType, ParamData::name, ParamData::required, and StripType().

◆ PrintDefnInput() [5/5]

void mlpack::bindings::go::PrintDefnInput ( const util::ParamData d,
const void *  ,
void *   
)

Given parameter information and the current number of spaces for indentation, print the code to process the output to cout.

This code assumes that data.input is false, and should not be called when data.input is true. If this is the only output, the results will be different.

The input pointer should be a pointer to a std::tuple<size_t, bool> where the first element is the indentation and the second element is a boolean representing whether or not this is the only output parameter.

Parameters
dParameter data struct.
inputPointer to size_t holding the indentation.
outputUnused parameter.

Definition at line 112 of file print_defn_input.hpp.

◆ PrintDefnOutput() [1/5]

void mlpack::bindings::go::PrintDefnOutput ( const util::ParamData d,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Print output for a regular parameter type.

Definition at line 28 of file print_defn_output.hpp.

◆ PrintDefnOutput() [2/5]

void mlpack::bindings::go::PrintDefnOutput ( const util::ParamData d,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Print output for a matrix type.

Definition at line 42 of file print_defn_output.hpp.

◆ PrintDefnOutput() [3/5]

void mlpack::bindings::go::PrintDefnOutput ( const util::ParamData d,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Print output for a matrix with info type.

Definition at line 54 of file print_defn_output.hpp.

◆ PrintDefnOutput() [4/5]

void mlpack::bindings::go::PrintDefnOutput ( const util::ParamData d,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Print output for a serializable model.

Definition at line 67 of file print_defn_output.hpp.

References ParamData::cppType, and StripType().

◆ PrintDefnOutput() [5/5]

void mlpack::bindings::go::PrintDefnOutput ( const util::ParamData d,
const void *  ,
void *   
)

Given parameter information and the current number of spaces for indentation, print the code to process the output to cout.

This code assumes that data.input is false, and should not be called when data.input is true. If this is the only output, the results will be different.

The input pointer should be a pointer to a std::tuple<size_t, bool> where the first element is the indentation and the second element is a boolean representing whether or not this is the only output parameter.

Parameters
dParameter data struct.
inputPointer to size_t holding the indentation.
outputUnused parameter.

Definition at line 93 of file print_defn_output.hpp.

◆ PrintDoc()

void mlpack::bindings::go::PrintDoc ( const util::ParamData d,
const void *  input,
void *   
)

Print the docstring documentation for a given parameter.

You are responsible for setting up the line—this does not handle indentation or anything. This is meant to produce a line of documentation describing a single parameter.

The indent parameter (void* input, which should be a pointer to a size_t) should be passed to know how much to indent for a new line.

Parameters
dParameter data struct.
inputPointer to size_t containing indent.
outputUnused parameter.

Definition at line 38 of file print_doc.hpp.

References CamelCase(), ParamData::cppType, ParamData::desc, mlpack::util::HyphenateString(), if(), ParamData::name, ParamData::required, and ParamData::value.

◆ PrintGo()

void mlpack::bindings::go::PrintGo ( const util::ProgramDoc programInfo,
const std::string &  functionName 
)

Given a list of parameter definition and program documentation, print a generated .go file to stdout.

Parameters
parametersList of parameters the program will use (from CLI).
programInfoDocumentation for the program.
functionNameName of the function (i.e. "pca").

◆ PrintH()

void mlpack::bindings::go::PrintH ( const util::ProgramDoc programInfo,
const std::string &  functionName 
)

Given a list of parameter definition and program documentation, print a generated .h file to stdout.

Parameters
parametersList of parameters the program will use (from CLI).
programInfoDocumentation for the program.
functionNameName of the function (i.e. "pca").

◆ PrintImport()

std::string mlpack::bindings::go::PrintImport ( )
inline

Print any import information for the Go binding.

◆ PrintInputOptions() [1/2]

std::string mlpack::bindings::go::PrintInputOptions ( )
inline

◆ PrintInputOptions() [2/2]

std::string mlpack::bindings::go::PrintInputOptions ( const std::string &  paramName,
const T &  value,
Args...  args 
)

Print an input option.

This will throw an exception if the parameter does not exist in CLI.

◆ PrintInputProcessing() [1/5]

void mlpack::bindings::go::PrintInputProcessing ( const util::ParamData d,
const size_t  indent,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Print input processing for a standard option type.

This gives us code like:

// Detect if the parameter was passed; set if so. if param.Name != nil { setParam<d.cppType>("paramName", param.Name) setPassed("paramName") }

Definition at line 29 of file print_input_processing.hpp.

References CamelCase(), ParamData::cppType, if(), ParamData::name, ParamData::required, and ParamData::value.

◆ PrintInputProcessing() [2/5]

void mlpack::bindings::go::PrintInputProcessing ( const util::ParamData d,
const size_t  indent,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Print input processing for a matrix type.

This gives us code like:

// Detect if the parameter was passed; set if so. if param.Name != nil { gonumToArma<type>("paramName", param.Name) setPassed("paramName") }

Definition at line 128 of file print_input_processing.hpp.

References CamelCase(), ParamData::name, and ParamData::required.

◆ PrintInputProcessing() [3/5]

void mlpack::bindings::go::PrintInputProcessing ( const util::ParamData d,
const size_t  indent,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Print input processing for a matrix with info type.

This gives us code like:

// Detect if the parameter was passed; set if so. if param.Name != nil { gonumToArmaMatWithInfo<type>("paramName", param.Name) setPassed("paramName") }

Definition at line 187 of file print_input_processing.hpp.

References CamelCase(), ParamData::name, and ParamData::required.

◆ PrintInputProcessing() [4/5]

void mlpack::bindings::go::PrintInputProcessing ( const util::ParamData d,
const size_t  indent,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Print input processing for a serializable type.

This gives us code like:

// Detect if the parameter was passed; set if so. if param.Name != nil { set<ModelType>("paramName", param.Name) setPassed("paramName") }

Definition at line 247 of file print_input_processing.hpp.

References CamelCase(), ParamData::cppType, ParamData::name, ParamData::required, and StripType().

◆ PrintInputProcessing() [5/5]

void mlpack::bindings::go::PrintInputProcessing ( const util::ParamData d,
const void *  input,
void *   
)

Given parameter information and the current number of spaces for indentation, print the code to process the input to cout.

This code assumes that data.input is true, and should not be called when data.input is false.

The number of spaces to indent should be passed through the input pointer.

Parameters
dParameter data struct.
inputPointer to size_t holding the indentation.
outputUnused parameter.

Definition at line 316 of file print_input_processing.hpp.

◆ PrintMethodConfig() [1/5]

void mlpack::bindings::go::PrintMethodConfig ( const util::ParamData d,
const size_t  indent,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Print param in configuration struct for a standard option type.

Definition at line 29 of file print_method_config.hpp.

References CamelCase(), ParamData::name, and ParamData::required.

◆ PrintMethodConfig() [2/5]

void mlpack::bindings::go::PrintMethodConfig ( const util::ParamData d,
const size_t  indent,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Print param in configuration struct for a matrix type.

Definition at line 64 of file print_method_config.hpp.

References CamelCase(), ParamData::name, and ParamData::required.

◆ PrintMethodConfig() [3/5]

void mlpack::bindings::go::PrintMethodConfig ( const util::ParamData d,
const size_t  indent,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Print param in configuration struct for a matrix with info type.

Definition at line 96 of file print_method_config.hpp.

References CamelCase(), ParamData::name, and ParamData::required.

◆ PrintMethodConfig() [4/5]

void mlpack::bindings::go::PrintMethodConfig ( const util::ParamData d,
const size_t  indent,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Print param in method configuration struct for a serializable type.

Definition at line 129 of file print_method_config.hpp.

References CamelCase(), ParamData::name, and ParamData::required.

◆ PrintMethodConfig() [5/5]

void mlpack::bindings::go::PrintMethodConfig ( const util::ParamData d,
const void *  input,
void *   
)

Given parameter information and the current number of spaces for indentation, print the code to process the input to cout.

This code assumes that data.input is true, and should not be called when data.input is false.

The number of spaces to indent should be passed through the input pointer.

Parameters
dParameter data struct.
inputPointer to size_t holding the indentation.
outputUnused parameter.

Definition at line 170 of file print_method_config.hpp.

◆ PrintMethodInit() [1/5]

void mlpack::bindings::go::PrintMethodInit ( const util::ParamData d,
const size_t  indent,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Print parameter with it's default value for a standard option type.

Definition at line 29 of file print_method_init.hpp.

References CamelCase(), ParamData::cppType, ParamData::name, ParamData::required, and ParamData::value.

◆ PrintMethodInit() [2/5]

void mlpack::bindings::go::PrintMethodInit ( const util::ParamData d,
const size_t  indent,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Print parameter with its default value for a matrix type.

Definition at line 86 of file print_method_init.hpp.

References CamelCase(), ParamData::name, and ParamData::required.

◆ PrintMethodInit() [3/5]

void mlpack::bindings::go::PrintMethodInit ( const util::ParamData d,
const size_t  indent,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Print parameter with its default value for a matrix with info type.

Definition at line 118 of file print_method_init.hpp.

References CamelCase(), ParamData::name, and ParamData::required.

◆ PrintMethodInit() [4/5]

void mlpack::bindings::go::PrintMethodInit ( const util::ParamData d,
const size_t  indent,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Print parameter with its default value for a serializable type.

Definition at line 151 of file print_method_init.hpp.

References CamelCase(), ParamData::name, and ParamData::required.

◆ PrintMethodInit() [5/5]

void mlpack::bindings::go::PrintMethodInit ( const util::ParamData d,
const void *  input,
void *   
)

Given parameter information and the current number of spaces for indentation, print the code to process the input to cout.

This code assumes that data.input is true, and should not be called when data.input is false.

The number of spaces to indent should be passed through the input pointer.

Parameters
dParameter data struct.
inputPointer to size_t holding the indentation.
outputUnused parameter.

Definition at line 192 of file print_method_init.hpp.

◆ PrintModel()

std::string mlpack::bindings::go::PrintModel ( const std::string &  modelName)
inline

Given the name of a model, print it.

Here we do not need to modify anything.

◆ PrintModelUtilCPP() [1/5]

void mlpack::bindings::go::PrintModelUtilCPP ( const util::ParamData ,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Non-serializable models don't require any special definitions, so this prints nothing.

Definition at line 27 of file print_model_util.hpp.

◆ PrintModelUtilCPP() [2/5]

void mlpack::bindings::go::PrintModelUtilCPP ( const util::ParamData ,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Matrices don't require any special definitions, so this prints nothing.

Definition at line 41 of file print_model_util.hpp.

◆ PrintModelUtilCPP() [3/5]

void mlpack::bindings::go::PrintModelUtilCPP ( const util::ParamData ,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Matrices with Info don't require any special definitions, so this prints nothing.

Definition at line 52 of file print_model_util.hpp.

◆ PrintModelUtilCPP() [4/5]

void mlpack::bindings::go::PrintModelUtilCPP ( const util::ParamData d,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Serializable models require a special class definition.

This gives us code like:

extern "C" void mlpackSet<Type>Ptr( const char* identifier, void value) { SetParamPtr<Type>(identifier, static_cast<Type<T>(value)); }

This gives us code like:

extern "C" void mlpackGet<Type>Ptr(const char identifier) { <Type> *modelptr = GetParamPtr<Type>(identifier); return modelptr; }

Definition at line 64 of file print_model_util.hpp.

References ParamData::cppType, and StripType().

◆ PrintModelUtilCPP() [5/5]

void mlpack::bindings::go::PrintModelUtilCPP ( const util::ParamData d,
const void *  ,
void *   
)

Print the function to set and get serialization models from Go to mlpack.

Parameters
dParameter data.
inputUnused parameter.
outputUnused parameter.

Definition at line 125 of file print_model_util.hpp.

◆ PrintModelUtilGo() [1/5]

void mlpack::bindings::go::PrintModelUtilGo ( const util::ParamData ,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Non-serializable models don't require any special definitions, so this prints nothing.

Definition at line 227 of file print_model_util.hpp.

◆ PrintModelUtilGo() [2/5]

void mlpack::bindings::go::PrintModelUtilGo ( const util::ParamData ,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Matrices don't require any special definitions, so this prints nothing.

Definition at line 241 of file print_model_util.hpp.

◆ PrintModelUtilGo() [3/5]

void mlpack::bindings::go::PrintModelUtilGo ( const util::ParamData ,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Matrices with Info don't require any special definitions, so this prints nothing.

Definition at line 252 of file print_model_util.hpp.

◆ PrintModelUtilGo() [4/5]

void mlpack::bindings::go::PrintModelUtilGo ( const util::ParamData d,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Serializable models require a special class definition.

This gives us code like:

type <Type> struct { mem unsafe.Pointer }

This gives us code like:

func (m *<Type>) alloc<Type>(identifier string) { m.mem = C.mlpackGet<Type>Ptr(C.CString(identifier)) runtime.KeepAlive(m) }

This gives us code like:

func (m *<Type>) get<Type>(identifier string) { m.alloc<Type>(identifier) }

Definition at line 264 of file print_model_util.hpp.

References ParamData::cppType, and StripType().

◆ PrintModelUtilGo() [5/5]

void mlpack::bindings::go::PrintModelUtilGo ( const util::ParamData d,
const void *  ,
void *   
)

Print the Go struct for Go serialization model and their associated set and get methods.

Parameters
dParameter data.
inputUnused parameter.
outputUnused parameter.

Definition at line 338 of file print_model_util.hpp.

◆ PrintModelUtilH() [1/5]

void mlpack::bindings::go::PrintModelUtilH ( const util::ParamData ,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Non-serializable models don't require any special definitions, so this prints nothing.

Definition at line 138 of file print_model_util.hpp.

◆ PrintModelUtilH() [2/5]

void mlpack::bindings::go::PrintModelUtilH ( const util::ParamData ,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Matrices don't require any special definitions, so this prints nothing.

Definition at line 153 of file print_model_util.hpp.

◆ PrintModelUtilH() [3/5]

void mlpack::bindings::go::PrintModelUtilH ( const util::ParamData ,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Matrices with Info don't require any special definitions, so this prints nothing.

Definition at line 164 of file print_model_util.hpp.

◆ PrintModelUtilH() [4/5]

void mlpack::bindings::go::PrintModelUtilH ( const util::ParamData d,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Serializable models require a special class definition.

This gives us code like:

extern void mlpackSet<Type>Ptr(const char identifier, void* value);

This gives us code like:

extern void mlpackGet<Type>Ptr(const char identifier);

Definition at line 176 of file print_model_util.hpp.

References ParamData::cppType, and StripType().

◆ PrintModelUtilH() [5/5]

void mlpack::bindings::go::PrintModelUtilH ( const util::ParamData d,
const void *  ,
void *   
)

Print the function to set and get serialization models from Go to mlpack.

Parameters
dParameter data.
inputUnused parameter.
outputUnused parameter.

Definition at line 215 of file print_model_util.hpp.

◆ PrintOptionalInputs() [1/2]

std::string mlpack::bindings::go::PrintOptionalInputs ( )
inline

◆ PrintOptionalInputs() [2/2]

std::string mlpack::bindings::go::PrintOptionalInputs ( const std::string &  paramName,
const T &  value,
Args...  args 
)

Print an input option.

This will throw an exception if the parameter does not exist in CLI.

◆ PrintOutputOptionInfo()

std::string mlpack::bindings::go::PrintOutputOptionInfo ( )
inline

Print any special information about output options.

◆ PrintOutputOptions() [1/2]

std::string mlpack::bindings::go::PrintOutputOptions ( )
inline

◆ PrintOutputOptions() [2/2]

std::string mlpack::bindings::go::PrintOutputOptions ( Args...  args)

◆ PrintOutputProcessing() [1/5]

void mlpack::bindings::go::PrintOutputProcessing ( const util::ParamData d,
const size_t  indent,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Print output processing for a regular parameter type.

This gives us code like:

<paramName> := GetParam<Type>("paramName")

Definition at line 29 of file print_output_processing.hpp.

References CamelCase(), and ParamData::name.

◆ PrintOutputProcessing() [2/5]

void mlpack::bindings::go::PrintOutputProcessing ( const util::ParamData d,
const size_t  indent,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0,
const typename std::enable_if<!std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *  = 0 
)

Print output processing for a matrix type.

This gives us code like:

var <paramName>Ptr mlpackArma <paramName> := <paramName>_ptr.ArmaToGonum_<Type>("paramName")

Definition at line 56 of file print_output_processing.hpp.

References CamelCase(), and ParamData::name.

◆ PrintOutputProcessing() [3/5]

void mlpack::bindings::go::PrintOutputProcessing ( const util::ParamData d,
const size_t  indent,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Print output processing for a matrix with info type.

This gives us code like:

var <paramName>_ptr mlpackArma <paramName> := <paramName>Ptr.ArmaToGonumWithInfo<Type>("paramName")

Definition at line 85 of file print_output_processing.hpp.

References CamelCase(), and ParamData::name.

◆ PrintOutputProcessing() [4/5]

void mlpack::bindings::go::PrintOutputProcessing ( const util::ParamData d,
const size_t  indent,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Print output processing for a serializable model.

This gives us code like:

var ModelOut <Type> ModelOut.get<Type>("paramName")

Definition at line 113 of file print_output_processing.hpp.

References CamelCase(), ParamData::cppType, ParamData::name, and StripType().

◆ PrintOutputProcessing() [5/5]

void mlpack::bindings::go::PrintOutputProcessing ( const util::ParamData d,
const void *  ,
void *   
)
Parameters
dParameter data struct.
inputUnused parameter.
outputUnused parameter.

Definition at line 146 of file print_output_processing.hpp.

◆ PrintTypeDoc() [1/6]

std::string mlpack::bindings::go::PrintTypeDoc ( const util::ParamData data,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< util::IsStdVector< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Return a string representing the command-line type of an option.

◆ PrintTypeDoc() [2/6]

std::string mlpack::bindings::go::PrintTypeDoc ( const util::ParamData data,
const typename std::enable_if< util::IsStdVector< T >::value >::type *  = 0 
)

Return a string representing the command-line type of a vector.

◆ PrintTypeDoc() [3/6]

std::string mlpack::bindings::go::PrintTypeDoc ( const util::ParamData data,
const typename std::enable_if< arma::is_arma_type< T >::value >::type *  = 0 
)

Return a string representing the command-line type of a matrix option.

◆ PrintTypeDoc() [4/6]

std::string mlpack::bindings::go::PrintTypeDoc ( const util::ParamData data,
const typename std::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *  = 0 
)

Return a string representing the command-line type of a matrix tuple option.

◆ PrintTypeDoc() [5/6]

std::string mlpack::bindings::go::PrintTypeDoc ( const util::ParamData data,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Return a string representing the command-line type of a model.

◆ PrintTypeDoc() [6/6]

void mlpack::bindings::go::PrintTypeDoc ( const util::ParamData data,
const void *  ,
void *  output 
)

Print the command-line type of an option into a string.

Definition at line 67 of file print_type_doc.hpp.

◆ PrintValue() [1/2]

std::string mlpack::bindings::go::PrintValue ( const T &  value,
bool  quotes 
)
inline

Given a parameter type, print the corresponding value.

◆ PrintValue() [2/2]

std::string mlpack::bindings::go::PrintValue ( const bool &  value,
bool  quotes 
)
inline

◆ ProgramCall()

std::string mlpack::bindings::go::ProgramCall ( const std::string &  programName,
Args...  args 
)

Given a name of a binding and a variable number of arguments (and their contents), print the corresponding function call.

◆ StripType()

void mlpack::bindings::go::StripType ( const std::string &  inputType,
std::string &  goStrippedType,
std::string &  strippedType,
std::string &  printedType,
std::string &  defaultsType 
)
inline

Given an input type like, e.g., "LogisticRegression<>", return four types that can be used in Go code.

goStrippedType will be a type with lower first letter of parameter name so it is of unexported type in GoDoc (e.g. "logisticRegression"), strippedType will be a type with no template parameters (e.g. "LogisticRegression"), printedType will be a printable type with the template parameters (e.g. "LogisticRegression<>"), and defaultsType will be a printable type with a default template parameter (e.g. "LogisticRegression<T>") that can be used for class definitions.

Definition at line 30 of file strip_type.hpp.

Referenced by GetGoType(), PrintDefnInput(), PrintDefnOutput(), PrintInputProcessing(), PrintModelUtilCPP(), PrintModelUtilGo(), PrintModelUtilH(), and PrintOutputProcessing().

Variable Documentation

◆ programName

std::string programName