mlpack::bindings::markdown Namespace Reference

Classes

class  BindingInfo
 The BindingInfo class is used by the Markdown documentation generator to store multiple documentation objects, indexed by both the binding name (i.e. More...

 
class  ExampleWrapper
 
class  LongDescriptionWrapper
 
class  MDOption
 The Markdown option class. More...

 
class  ProgramNameWrapper
 
class  SeeAlsoWrapper
 
class  ShortDescriptionWrapper
 

Functions

template<typename... Args>
std::string CallMethod (const std::string &bindingName, const std::string &objectName, const std::string &methodName, Args... args)
 Print the string that calls a method from the object created. More...

 
template<typename... Args>
std::string CreateObject (const std::string &bindingName, const std::string &objectName, const std::string &groupName, Args... args)
 Print the string that creates object of the given method with the given parameters. More...

 
std::string CreateObject (const std::string &bindingName, const std::string &objectName, const std::string &groupName)
 Print the string that creates object of the given method with default parameters. More...

 
template
<
typename
T
>
void DefaultParam (util::ParamData &data, const void *, void *output)
 Print the default value of a parameter into the output string. More...

 
std::string GetBindingName (const std::string &bindingName)
 Given the name of the binding, print the name for the current language (as given by BindingInfo). More...

 
std::string GetBindingName (const std::string &language, const std::string &name)
 Given a language name and a binding name, return the name of that binding for that language. More...

 
std::string GetDataset (const std::string &datasetName, const std::string &url)
 Print the string that reads dataset from an online source. More...

 
std::string GetMappedName (const std::string &methodName)
 Get the mapped name in the corresponding language. More...

 
template
<
typename
T
>
void GetParam (util::ParamData &d, const void *, void *output)
 All Markdown 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 std::enable_if<!arma::is_arma_type< T >::value >::type *=0, const typename std::enable_if<!util::IsStdVector< T >::value >::type *=0, const typename std::enable_if<!data::HasSerialize< T >::value >::type *=0, const typename std::enable_if<!std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *=0)
 Print an option of a simple type. More...

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

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

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

 
template
<
typename
T
>
std::string GetPrintableParam (util::ParamData &data, const typename std::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::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 GetPrintableParamName (util::ParamData &data, const typename std::enable_if<!arma::is_arma_type< T >::value >::type *=0, const typename std::enable_if<!data::HasSerialize< T >::value >::type *=0, const typename std::enable_if<!std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *=0)
 Get the parameter name for a type that has no special handling. More...

 
template
<
typename
T
>
std::string GetPrintableParamName (util::ParamData &data, const typename std::enable_if< arma::is_arma_type< T >::value >::type *=0)
 Get the parameter name for a matrix type (where the user has to pass the file that holds the matrix). More...

 
template
<
typename
T
>
std::string GetPrintableParamName (util::ParamData &data, const typename std::enable_if<!arma::is_arma_type< T >::value >::type *=0, const typename std::enable_if< data::HasSerialize< T >::value >::type *=0)
 Get the parameter name for a serializable model type (where the user has to pass the file that holds the matrix). More...

 
template
<
typename
T
>
std::string GetPrintableParamName (util::ParamData &data, const typename std::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *=0)
 Get the parameter name for a mapped matrix type (where the user has to pass the file that holds the matrix). More...

 
template
<
typename
T
>
void GetPrintableParamName (util::ParamData &d, const void *, void *output)
 Get the parameter's name as seen by the user. More...

 
template
<
typename
T
>
std::string GetPrintableParamValue (util::ParamData &data, const std::string &value, const typename std::enable_if<!arma::is_arma_type< T >::value >::type *=0, const typename std::enable_if<!data::HasSerialize< T >::value >::type *=0, const typename std::enable_if<!std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *=0)
 Get the parameter name for a type that has no special handling. More...

 
template
<
typename
T
>
std::string GetPrintableParamValue (util::ParamData &data, const std::string &value, const typename std::enable_if< arma::is_arma_type< T >::value >::type *=0)
 Get the parameter name for a matrix type (where the user has to pass the file that holds the matrix). More...

 
template
<
typename
T
>
std::string GetPrintableParamValue (util::ParamData &data, const std::string &value, const typename std::enable_if<!arma::is_arma_type< T >::value >::type *=0, const typename std::enable_if< data::HasSerialize< T >::value >::type *=0)
 Get the parameter name for a serializable model type (where the user has to pass the file that holds the matrix). More...

 
template
<
typename
T
>
std::string GetPrintableParamValue (util::ParamData &data, const std::string &value, const typename std::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *=0)
 Get the parameter name for a mapped matrix type (where the user has to pass the file that holds the matrix). More...

 
template
<
typename
T
>
void GetPrintableParamValue (util::ParamData &d, const void *input, void *output)
 Get the parameter's name as seen by the user. More...

 
template
<
typename
T
>
void GetPrintableType (util::ParamData &data, const void *, void *output)
 Print the type of a parameter into the output string. More...

 
template
<
typename
T
>
std::string GetPrintableType (util::ParamData &data)
 Print the type of a parameter. More...

 
std::string GetWrapperLink (const std::string &bindingName)
 
std::string GetWrapperName (const std::string &bindingName)
 Given the name of the binding, print the name for the wrapper for current language. More...

 
template
<
typename
T
>
bool IgnoreCheck (const std::string &bindingName, const T &t)
 Return whether or not a runtime check on parameters should be ignored. More...

 
std::string ImportExtLib ()
 Print the import string that imports any external libs. More...

 
std::string ImportSplit ()
 Print the import string that imports mlpack's preprocess_split method. More...

 
std::string ImportThis (const std::string &groupName)
 Import the current method. More...

 
template
<
typename
T
>
bool IsSerializable (const typename std::enable_if<!data::HasSerialize< T >::value >::type *=0)
 Return false, because the type is not serializable. More...

 
template
<
typename
T
>
bool IsSerializable (const typename std::enable_if< data::HasSerialize< T >::value >::type *=0, const typename std::enable_if<!arma::is_arma_type< T >::value >::type *=0)
 Return true, because the type is serializable. More...

 
template
<
typename
T
>
void IsSerializable (util::ParamData &, const void *, void *output)
 Return whether or not the type is serializable. More...

 
std::string ParamString (const std::string &bindingName, const std::string &paramName)
 Print what a user would type to invoke the given option name. More...

 
std::string ParamType (util::Params &p, util::ParamData &d)
 Print the user-encountered type of an option. More...

 
std::string PrintDataset (const std::string &dataset)
 Print a dataset type parameter (add .csv and return). More...

 
std::string PrintDefault (const std::string &bindingName, const std::string &paramName)
 Print the default value of an option, unless it is required (in which case Markdown italicized '–' is printed). More...

 
std::string PrintImport (const std::string &bindingName)
 Print any imports that need to be done before using the binding. More...

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

 
std::string PrintLanguage (const std::string &language)
 Print the name of the given language. More...

 
std::string PrintModel (const std::string &model)
 Print a model type parameter (add .bin and return). More...

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

 
template
<
typename
T
>
std::string PrintTypeDoc (util::ParamData &data)
 Print the type of a parameter into the output string. More...

 
std::string PrintTypeDocs ()
 Print details about the different types for a language. More...

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

 
template<typename... Args>
std::string ProgramCall (const std::string &programName, Args... args)
 Given a program name and arguments for it, print what its invocation would be. More...

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

 
std::string SplitTrainTest (const std::string &datasetName, const std::string &labelName, const std::string &trainDataset, const std::string &trainLabels, const std::string &testDataset, const std::string &testLabels, const std::string &splitRatio)
 Print the string that splits dataset into training and testing. More...

 

Function Documentation

◆ CallMethod()

std::string mlpack::bindings::markdown::CallMethod ( const std::string &  bindingName,
const std::string &  objectName,
const std::string &  methodName,
Args...  args 
)

Print the string that calls a method from the object created.

◆ CreateObject() [1/2]

std::string mlpack::bindings::markdown::CreateObject ( const std::string &  bindingName,
const std::string &  objectName,
const std::string &  groupName,
Args...  args 
)

Print the string that creates object of the given method with the given parameters.

◆ CreateObject() [2/2]

std::string mlpack::bindings::markdown::CreateObject ( const std::string &  bindingName,
const std::string &  objectName,
const std::string &  groupName 
)
inline

Print the string that creates object of the given method with default parameters.

◆ DefaultParam()

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

Print the default value of a parameter into the output string.

The type printed depends on the current setting of BindingInfo::Language().

Definition at line 34 of file default_param.hpp.

References BindingInfo::Language().

◆ GetBindingName() [1/2]

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

Given the name of the binding, print the name for the current language (as given by BindingInfo).

◆ GetBindingName() [2/2]

std::string mlpack::bindings::markdown::GetBindingName ( const std::string &  language,
const std::string &  name 
)

Given a language name and a binding name, return the name of that binding for that language.

Note that if a new language is added to the mlpack bindings, this method will need to be updated so that documentation can be successfully generated for that language.

◆ GetDataset()

std::string mlpack::bindings::markdown::GetDataset ( const std::string &  datasetName,
const std::string &  url 
)
inline

Print the string that reads dataset from an online source.

◆ GetMappedName()

std::string mlpack::bindings::markdown::GetMappedName ( const std::string &  methodName)
inline

Get the mapped name in the corresponding language.

◆ GetParam()

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

All Markdown 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::markdown::GetPrintableParam ( util::ParamData data,
const typename std::enable_if<!arma::is_arma_type< T >::value >::type *  = 0,
const typename std::enable_if<!util::IsStdVector< T >::value >::type *  = 0,
const typename std::enable_if<!data::HasSerialize< T >::value >::type *  = 0,
const typename std::enable_if<!std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::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::markdown::GetPrintableParam ( util::ParamData data,
const typename std::enable_if< util::IsStdVector< T >::value >::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::markdown::GetPrintableParam ( util::ParamData data,
const typename std::enable_if< arma::is_arma_type< T >::value >::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::markdown::GetPrintableParam ( util::ParamData data,
const typename std::enable_if<!arma::is_arma_type< T >::value >::type *  = 0,
const typename std::enable_if< data::HasSerialize< T >::value >::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::markdown::GetPrintableParam ( util::ParamData data,
const typename std::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::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::markdown::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.

◆ GetPrintableParamName() [1/5]

std::string mlpack::bindings::markdown::GetPrintableParamName ( util::ParamData data,
const typename std::enable_if<!arma::is_arma_type< T >::value >::type *  = 0,
const typename std::enable_if<!data::HasSerialize< T >::value >::type *  = 0,
const typename std::enable_if<!std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *  = 0 
)

Get the parameter name for a type that has no special handling.

◆ GetPrintableParamName() [2/5]

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

Get the parameter name for a matrix type (where the user has to pass the file that holds the matrix).

◆ GetPrintableParamName() [3/5]

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

Get the parameter name for a serializable model type (where the user has to pass the file that holds the matrix).

◆ GetPrintableParamName() [4/5]

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

Get the parameter name for a mapped matrix type (where the user has to pass the file that holds the matrix).

◆ GetPrintableParamName() [5/5]

void mlpack::bindings::markdown::GetPrintableParamName ( util::ParamData d,
const void *  ,
void *  output 
)

Get the parameter's name as seen by the user.

Definition at line 67 of file get_printable_param_name.hpp.

◆ GetPrintableParamValue() [1/5]

std::string mlpack::bindings::markdown::GetPrintableParamValue ( util::ParamData data,
const std::string &  value,
const typename std::enable_if<!arma::is_arma_type< T >::value >::type *  = 0,
const typename std::enable_if<!data::HasSerialize< T >::value >::type *  = 0,
const typename std::enable_if<!std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *  = 0 
)

Get the parameter name for a type that has no special handling.

◆ GetPrintableParamValue() [2/5]

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

Get the parameter name for a matrix type (where the user has to pass the file that holds the matrix).

◆ GetPrintableParamValue() [3/5]

std::string mlpack::bindings::markdown::GetPrintableParamValue ( util::ParamData data,
const std::string &  value,
const typename std::enable_if<!arma::is_arma_type< T >::value >::type *  = 0,
const typename std::enable_if< data::HasSerialize< T >::value >::type *  = 0 
)

Get the parameter name for a serializable model type (where the user has to pass the file that holds the matrix).

◆ GetPrintableParamValue() [4/5]

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

Get the parameter name for a mapped matrix type (where the user has to pass the file that holds the matrix).

◆ GetPrintableParamValue() [5/5]

void mlpack::bindings::markdown::GetPrintableParamValue ( util::ParamData d,
const void *  input,
void *  output 
)

Get the parameter's name as seen by the user.

Definition at line 71 of file get_printable_param_value.hpp.

◆ GetPrintableType() [1/2]

void mlpack::bindings::markdown::GetPrintableType ( util::ParamData data,
const void *  ,
void *  output 
)

Print the type of a parameter into the output string.

The type printed depends on the current setting of BindingInfo::Language().

Definition at line 33 of file get_printable_type.hpp.

References BindingInfo::Language().

◆ GetPrintableType() [2/2]

std::string mlpack::bindings::markdown::GetPrintableType ( util::ParamData data)

Print the type of a parameter.

The type printed depends on the current setting of BindingInfo::Language().

Definition at line 74 of file get_printable_type.hpp.

◆ GetWrapperLink()

std::string mlpack::bindings::markdown::GetWrapperLink ( const std::string &  bindingName)
inline

◆ GetWrapperName()

std::string mlpack::bindings::markdown::GetWrapperName ( const std::string &  bindingName)
inline

Given the name of the binding, print the name for the wrapper for current language.

◆ IgnoreCheck()

bool mlpack::bindings::markdown::IgnoreCheck ( const std::string &  bindingName,
const T &  t 
)
inline

Return whether or not a runtime check on parameters should be ignored.

◆ ImportExtLib()

std::string mlpack::bindings::markdown::ImportExtLib ( )
inline

Print the import string that imports any external libs.

◆ ImportSplit()

std::string mlpack::bindings::markdown::ImportSplit ( )
inline

Print the import string that imports mlpack's preprocess_split method.

◆ ImportThis()

std::string mlpack::bindings::markdown::ImportThis ( const std::string &  groupName)
inline

Import the current method.

◆ IsSerializable() [1/3]

bool mlpack::bindings::markdown::IsSerializable ( const typename std::enable_if<!data::HasSerialize< T >::value >::type *  = 0)

Return false, because the type is not serializable.

This includes Armadillo types, which we say aren't serializable (in this context) because they aren't mlpack models.

Definition at line 27 of file is_serializable.hpp.

◆ IsSerializable() [2/3]

bool mlpack::bindings::markdown::IsSerializable ( const typename std::enable_if< data::HasSerialize< T >::value >::type *  = 0,
const typename std::enable_if<!arma::is_arma_type< T >::value >::type *  = 0 
)

Return true, because the type is serializable.

Definition at line 37 of file is_serializable.hpp.

◆ IsSerializable() [3/3]

void mlpack::bindings::markdown::IsSerializable ( util::ParamData ,
const void *  ,
void *  output 
)

Return whether or not the type is serializable.

Definition at line 48 of file is_serializable.hpp.

◆ ParamString()

std::string mlpack::bindings::markdown::ParamString ( const std::string &  bindingName,
const std::string &  paramName 
)
inline

Print what a user would type to invoke the given option name.

Note that the name must exist in the IO module. (Note that because of the way BINDING_LONG_DESC() and BINDING_EXAMPLE() is structured, this doesn't mean that all of the PARAM_*() declarataions need to come before BINDING_LONG_DESC() and BINDING_EXAMPLE() declaration.)

◆ ParamType()

std::string mlpack::bindings::markdown::ParamType ( util::Params p,
util::ParamData d 
)
inline

Print the user-encountered type of an option.

◆ PrintDataset()

std::string mlpack::bindings::markdown::PrintDataset ( const std::string &  dataset)
inline

Print a dataset type parameter (add .csv and return).

◆ PrintDefault()

std::string mlpack::bindings::markdown::PrintDefault ( const std::string &  bindingName,
const std::string &  paramName 
)
inline

Print the default value of an option, unless it is required (in which case Markdown italicized '–' is printed).

◆ PrintImport()

std::string mlpack::bindings::markdown::PrintImport ( const std::string &  bindingName)
inline

Print any imports that need to be done before using the binding.

◆ PrintInputOptionInfo()

std::string mlpack::bindings::markdown::PrintInputOptionInfo ( const std::string &  language)
inline

Print any special information about input options.

◆ PrintLanguage()

std::string mlpack::bindings::markdown::PrintLanguage ( const std::string &  language)
inline

Print the name of the given language.

◆ PrintModel()

std::string mlpack::bindings::markdown::PrintModel ( const std::string &  model)
inline

Print a model type parameter (add .bin and return).

◆ PrintOutputOptionInfo()

std::string mlpack::bindings::markdown::PrintOutputOptionInfo ( const std::string &  language)
inline

Print any special information about output options.

◆ PrintTypeDoc()

std::string mlpack::bindings::markdown::PrintTypeDoc ( util::ParamData data)

Print the type of a parameter into the output string.

The type printed depends on the current setting of BindingInfo::Language().

Definition at line 33 of file print_type_doc.hpp.

References BindingInfo::Language().

◆ PrintTypeDocs()

std::string mlpack::bindings::markdown::PrintTypeDocs ( )
inline

Print details about the different types for a language.

◆ PrintValue()

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

Given a parameter type, print the corresponding value.

◆ ProgramCall() [1/2]

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

Given a program name and arguments for it, print what its invocation would be.

◆ ProgramCall() [2/2]

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

Given a program name, print a call assuming that all arguments are specified.

◆ SplitTrainTest()

std::string mlpack::bindings::markdown::SplitTrainTest ( const std::string &  datasetName,
const std::string &  labelName,
const std::string &  trainDataset,
const std::string &  trainLabels,
const std::string &  testDataset,
const std::string &  testLabels,
const std::string &  splitRatio 
)
inline

Print the string that splits dataset into training and testing.