mlpack::bindings::r Namespace Reference

Classes

class  ROption
 The R option class. More...

 

Functions

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

 
template
<
typename
T
>
std::string DefaultParamImpl (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 (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 (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 (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 (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 R name. More...

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

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

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

 
template
<
>
std::string GetType< bool > (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 GetType< double > (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 GetType< float > (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 GetType< int > (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 GetType< std::string > (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 *)
 
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...

 
std::string ParamString (const std::string &paramName)
 Given the parameter name, determine what it would actually be when passed to the command line. 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 PrintDoc (util::ParamData &d, const void *, void *output)
 Print the docstring documentation for a given parameter. More...

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

 
std::string PrintInputOptionInfo ()
 Print any special information about input options. More...

 
std::string PrintInputOptions ()
 Recursion base case. More...

 
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 PrintInputParam (util::ParamData &d, const void *, void *)
 Print the declaration of an input parameter as part of a line in a R function definition. More...

 
template
<
typename
T
>
void PrintInputProcessing (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 processing for a standard option type. More...

 
template
<
typename
T
>
void PrintInputProcessing (util::ParamData &d, 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 (util::ParamData &d, 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 (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 processing for a serializable type. More...

 
template
<
typename
T
>
void PrintInputProcessing (util::ParamData &d, const void *, void *)
 
std::string PrintModel (const std::string &modelName)
 Given the name of a model, print it. More...

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

 
std::string PrintOutputOptions (const bool)
 Recursion base case. More...

 
template<typename T , typename... Args>
std::string PrintOutputOptions (const bool markdown, const std::string &paramName, const T &value, Args... args)
 
template
<
typename
T
>
void PrintOutputProcessing (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 processing for a regular parameter type. More...

 
template
<
typename
T
>
void PrintOutputProcessing (util::ParamData &d, 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 (util::ParamData &d, 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 (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 processing for a serializable model. More...

 
template
<
typename
T
>
void PrintOutputProcessing (util::ParamData &d, const void *, void *)
 
void PrintR (const util::BindingDetails &doc, const std::string &functionName)
 Print the code for a .R binding for an mlpack program to stdout. More...

 
template
<
typename
T
>
void PrintSerializeUtil (util::ParamData &, const typename std::enable_if<!arma::is_arma_type< T >::value >::type *=0, const typename std::enable_if<!data::HasSerialize< T >::value >::type *=0)
 If the type is not serializable, print nothing. More...

 
template
<
typename
T
>
void PrintSerializeUtil (util::ParamData &, const typename std::enable_if< arma::is_arma_type< T >::value >::type *=0)
 Matrices are serializable but here we also print nothing. More...

 
template
<
typename
T
>
void PrintSerializeUtil (util::ParamData &d, const typename std::enable_if<!arma::is_arma_type< T >::value >::type *=0, const typename std::enable_if< data::HasSerialize< T >::value >::type *=0)
 For non-matrix serializable types we need to print something. More...

 
template
<
typename
T
>
void PrintSerializeUtil (util::ParamData &d, const void *, void *)
 
template
<
typename
T
>
std::string PrintTypeDoc (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 (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 (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 (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 (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 (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)
 Special overload for booleans. More...

 
template<typename... Args>
std::string ProgramCall (const bool markdown, 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...

 
std::string ProgramCall (const std::string &programName)
 Given the name of a binding, print a program call assuming that all options are specified. More...

 

Function Documentation

◆ DefaultParam()

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

Return the default value of an option.

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

Definition at line 80 of file default_param.hpp.

◆ DefaultParamImpl() [1/5]

std::string mlpack::bindings::r::DefaultParamImpl ( 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::r::DefaultParamImpl ( 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::r::DefaultParamImpl ( 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::r::DefaultParamImpl ( 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::r::DefaultParamImpl ( 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::r::GetBindingName ( const std::string &  bindingName)
inline

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

◆ GetParam()

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

All R 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::r::GetPrintableParam ( 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.

References ParamData::value.

◆ GetPrintableParam() [2/6]

std::string mlpack::bindings::r::GetPrintableParam ( 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.

References ParamData::value.

◆ GetPrintableParam() [3/6]

std::string mlpack::bindings::r::GetPrintableParam ( 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.

References ParamData::value.

◆ GetPrintableParam() [4/6]

std::string mlpack::bindings::r::GetPrintableParam ( 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.

References ParamData::cppType, and ParamData::value.

◆ GetPrintableParam() [5/6]

std::string mlpack::bindings::r::GetPrintableParam ( 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.

References ParamData::value.

◆ GetPrintableParam() [6/6]

void mlpack::bindings::r::GetPrintableParam ( 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.
*(input) Unused parameter.
outputOutput storage for the string.

Definition at line 114 of file get_printable_param.hpp.

◆ GetPrintableType() [1/6]

std::string mlpack::bindings::r::GetPrintableType ( 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::r::GetPrintableType ( 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::r::GetPrintableType ( 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::r::GetPrintableType ( 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::r::GetPrintableType ( 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::r::GetPrintableType ( util::ParamData d,
const void *  ,
void *  output 
)

Definition at line 106 of file get_printable_type.hpp.

◆ GetPrintableType< bool >()

std::string mlpack::bindings::r::GetPrintableType< bool > ( 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::r::GetPrintableType< double > ( 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::r::GetPrintableType< int > ( 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< size_t >()

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

◆ GetPrintableType< std::string >()

std::string mlpack::bindings::r::GetPrintableType< std::string > ( 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

◆ GetRType() [1/5]

std::string mlpack::bindings::r::GetRType ( 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 24 of file get_r_type.hpp.

◆ GetRType() [2/5]

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

Definition at line 96 of file get_r_type.hpp.

◆ GetRType() [3/5]

std::string mlpack::bindings::r::GetRType ( util::ParamData d,
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 104 of file get_r_type.hpp.

◆ GetRType() [4/5]

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

Definition at line 121 of file get_r_type.hpp.

◆ GetRType() [5/5]

std::string mlpack::bindings::r::GetRType ( 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 130 of file get_r_type.hpp.

References ParamData::cppType, and mlpack::util::StripType().

◆ GetRType< bool >()

std::string mlpack::bindings::r::GetRType< bool > ( 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 36 of file get_r_type.hpp.

◆ GetRType< double >()

std::string mlpack::bindings::r::GetRType< double > ( 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 72 of file get_r_type.hpp.

◆ GetRType< int >()

std::string mlpack::bindings::r::GetRType< int > ( 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 48 of file get_r_type.hpp.

◆ GetRType< size_t >()

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

Definition at line 60 of file get_r_type.hpp.

◆ GetRType< std::string >()

std::string mlpack::bindings::r::GetRType< std::string > ( 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 84 of file get_r_type.hpp.

◆ GetType() [1/6]

std::string mlpack::bindings::r::GetType ( 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 25 of file get_type.hpp.

◆ GetType() [2/6]

std::string mlpack::bindings::r::GetType ( 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

Definition at line 97 of file get_type.hpp.

◆ GetType() [3/6]

std::string mlpack::bindings::r::GetType ( 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

Definition at line 107 of file get_type.hpp.

◆ GetType() [4/6]

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

Definition at line 137 of file get_type.hpp.

◆ GetType() [5/6]

std::string mlpack::bindings::r::GetType ( 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 146 of file get_type.hpp.

References ParamData::cppType.

◆ GetType() [6/6]

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

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

Parameters
dParameter data struct.
*(input) Unused parameter.
outputOutput storage for the string.

Definition at line 165 of file get_type.hpp.

◆ GetType< bool >()

std::string mlpack::bindings::r::GetType< bool > ( 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 85 of file get_type.hpp.

◆ GetType< double >()

std::string mlpack::bindings::r::GetType< double > ( 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 61 of file get_type.hpp.

◆ GetType< float >()

std::string mlpack::bindings::r::GetType< float > ( 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 49 of file get_type.hpp.

◆ GetType< int >()

std::string mlpack::bindings::r::GetType< int > ( 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 37 of file get_type.hpp.

◆ GetType< std::string >()

std::string mlpack::bindings::r::GetType< std::string > ( 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 73 of file get_type.hpp.

◆ IgnoreCheck() [1/3]

bool mlpack::bindings::r::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::r::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::r::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.

◆ ParamString()

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

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

◆ PrintDataset()

std::string mlpack::bindings::r::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::r::PrintDefault ( const std::string &  paramName)
inline

Given a parameter name, print its corresponding default value.

◆ PrintDoc()

void mlpack::bindings::r::PrintDoc ( util::ParamData d,
const void *  ,
void *  output 
)

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.
*(input) Pointer to size_t containing indent.
outputUnused parameter.

Definition at line 36 of file print_doc.hpp.

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

◆ PrintImport()

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

Print any import information for the R binding.

◆ PrintInputOptionInfo()

std::string mlpack::bindings::r::PrintInputOptionInfo ( )
inline

Print any special information about input options.

◆ PrintInputOptions() [1/2]

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

Recursion base case.

◆ PrintInputOptions() [2/2]

std::string mlpack::bindings::r::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 IO.

◆ PrintInputParam()

void mlpack::bindings::r::PrintInputParam ( util::ParamData d,
const void *  ,
void *   
)

Print the declaration of an input parameter as part of a line in a R function definition.

This doesn't include any commas or anything.

Definition at line 27 of file print_input_param.hpp.

References MLPACK_COUT_STREAM, ParamData::name, and ParamData::required.

◆ PrintInputProcessing() [1/5]

void mlpack::bindings::r::PrintInputProcessing ( 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 processing for a standard option type.

This gives us code like:

if (!identical(<param_name>, NA)) {
   IO_SetParam<type>("<param_name>", <param_name>)
}

This gives us code like:

IO_SetParam<type>("<param_name>", <param_name>)

Definition at line 27 of file print_input_processing.hpp.

References ParamData::cppType, MLPACK_COUT_STREAM, ParamData::name, and ParamData::required.

◆ PrintInputProcessing() [2/5]

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

Print input processing for a matrix type.

This gives us code like:

if (!identical(<param_name>, NA)) {
   IO_SetParam<type>("<param_name>", to_matrix(<param_name>))
}

This gives us code like:

IO_SetParam<type>("<param_name>", to_matrix(<param_name>))

Definition at line 73 of file print_input_processing.hpp.

References MLPACK_COUT_STREAM, ParamData::name, and ParamData::required.

◆ PrintInputProcessing() [3/5]

void mlpack::bindings::r::PrintInputProcessing ( util::ParamData d,
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:

if (!identical(<param_name>, NA)) {
   <param_name> = to_matrix_with_info(<param_name>)
   IO_SetParam<type>("<param_name>", <param_name>$info,
                       <param_name>$data)
}

This gives us code like:

<param_name> = to_matrix_with_info(<param_name>)
IO_SetParam<type>("<param_name>", <param_name>$info,
                    <param_name>$data)

Definition at line 109 of file print_input_processing.hpp.

References MLPACK_COUT_STREAM, ParamData::name, and ParamData::required.

◆ PrintInputProcessing() [4/5]

void mlpack::bindings::r::PrintInputProcessing ( 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 processing for a serializable type.

This gives us code like:

if (!identical(<param_name>, NA)) {
   IO_SetParam<ModelType>Ptr("<param_name>", <param_name>)
}

This gives us code like:

IO_SetParam<ModelType>Ptr("<param_name>", <param_name>)

Definition at line 156 of file print_input_processing.hpp.

References ParamData::cppType, MLPACK_COUT_STREAM, ParamData::name, ParamData::required, and mlpack::util::StripType().

◆ PrintInputProcessing() [5/5]

void mlpack::bindings::r::PrintInputProcessing ( util::ParamData d,
const void *  ,
void *   
)
Parameters
dParameter data struct.
*(input) Unused parameter.
*(output) Unused parameter.

Definition at line 195 of file print_input_processing.hpp.

◆ PrintModel()

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

Given the name of a model, print it.

Here we do not need to modify anything.

◆ PrintOutputOptionInfo()

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

Print any special information about output options.

◆ PrintOutputOptions() [1/2]

std::string mlpack::bindings::r::PrintOutputOptions ( const bool  )
inline

Recursion base case.

◆ PrintOutputOptions() [2/2]

std::string mlpack::bindings::r::PrintOutputOptions ( const bool  markdown,
const std::string &  paramName,
const T &  value,
Args...  args 
)

◆ PrintOutputProcessing() [1/5]

void mlpack::bindings::r::PrintOutputProcessing ( 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 processing for a regular parameter type.

This gives us code like:

"<param_name>" = IO_GetParam<Type>("param_name")

Definition at line 27 of file print_output_processing.hpp.

References MLPACK_COUT_STREAM, and ParamData::name.

◆ PrintOutputProcessing() [2/5]

void mlpack::bindings::r::PrintOutputProcessing ( util::ParamData d,
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:

"<param_name>" = IO_GetParam<Type>("param_name")

Definition at line 49 of file print_output_processing.hpp.

References MLPACK_COUT_STREAM, and ParamData::name.

◆ PrintOutputProcessing() [3/5]

void mlpack::bindings::r::PrintOutputProcessing ( util::ParamData d,
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:

"<param_name>" = IO_GetParam<Type>("param_name")

Definition at line 70 of file print_output_processing.hpp.

References MLPACK_COUT_STREAM, and ParamData::name.

◆ PrintOutputProcessing() [4/5]

void mlpack::bindings::r::PrintOutputProcessing ( 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 processing for a serializable model.

This gives us code like:

"<param_name>" = <param_name>

Definition at line 90 of file print_output_processing.hpp.

References MLPACK_COUT_STREAM, and ParamData::name.

◆ PrintOutputProcessing() [5/5]

void mlpack::bindings::r::PrintOutputProcessing ( util::ParamData d,
const void *  ,
void *   
)
Parameters
dParameter data struct.
*(input) Unused parameter.
*(output) Unused parameter.

Definition at line 111 of file print_output_processing.hpp.

◆ PrintR()

void mlpack::bindings::r::PrintR ( const util::BindingDetails doc,
const std::string &  functionName 
)

Print the code for a .R binding for an mlpack program to stdout.

Parameters
docDocumentation for the binding.
functionNameName of the function (i.e. "pca").

◆ PrintSerializeUtil() [1/4]

void mlpack::bindings::r::PrintSerializeUtil ( util::ParamData ,
const typename std::enable_if<!arma::is_arma_type< T >::value >::type *  = 0,
const typename std::enable_if<!data::HasSerialize< T >::value >::type *  = 0 
)

If the type is not serializable, print nothing.

Definition at line 26 of file print_serialize_util.hpp.

◆ PrintSerializeUtil() [2/4]

void mlpack::bindings::r::PrintSerializeUtil ( util::ParamData ,
const typename std::enable_if< arma::is_arma_type< T >::value >::type *  = 0 
)

Matrices are serializable but here we also print nothing.

Definition at line 38 of file print_serialize_util.hpp.

◆ PrintSerializeUtil() [3/4]

void mlpack::bindings::r::PrintSerializeUtil ( util::ParamData d,
const typename std::enable_if<!arma::is_arma_type< T >::value >::type *  = 0,
const typename std::enable_if< data::HasSerialize< T >::value >::type *  = 0 
)

For non-matrix serializable types we need to print something.

This gives us code like:

<param_name> <- IO_GetParam<ModelType>Ptr("<param_name>")
attr(<param_name>, "type") <- "<ModelType>"

Definition at line 49 of file print_serialize_util.hpp.

References ParamData::cppType, MLPACK_COUT_STREAM, ParamData::name, and mlpack::util::StripType().

◆ PrintSerializeUtil() [4/4]

void mlpack::bindings::r::PrintSerializeUtil ( util::ParamData d,
const void *  ,
void *   
)
Parameters
dParameter data struct.
*(input) Unused parameter.
*(output) Unused parameter.

Definition at line 75 of file print_serialize_util.hpp.

◆ PrintTypeDoc() [1/6]

std::string mlpack::bindings::r::PrintTypeDoc ( 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::r::PrintTypeDoc ( 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::r::PrintTypeDoc ( 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::r::PrintTypeDoc ( 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::r::PrintTypeDoc ( 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::r::PrintTypeDoc ( util::ParamData data,
const void *  ,
void *  output 
)

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

Definition at line 72 of file print_type_doc.hpp.

◆ PrintValue() [1/2]

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

Given a parameter type, print the corresponding value.

◆ PrintValue() [2/2]

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

Special overload for booleans.

◆ ProgramCall() [1/2]

std::string mlpack::bindings::r::ProgramCall ( const bool  markdown,
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.

◆ ProgramCall() [2/2]

std::string mlpack::bindings::r::ProgramCall ( const std::string &  programName)
inline

Given the name of a binding, print a program call assuming that all options are specified.