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
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...

 
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 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 GetPrintableParamName (util::ParamData &data, 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)
 Get the parameter name for a type that has no special handling. More...

 
template
<
typename
T
>
std::string GetPrintableParamName (util::ParamData &data, const typename boost::enable_if< arma::is_arma_type< T >>::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 boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::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 boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::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 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)
 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 boost::enable_if< arma::is_arma_type< T >>::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 boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::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 boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::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...

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

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

 
template
<
typename
T
>
bool IsSerializable (const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 Return false, because even though the type is serializable, it is an Armadillo type not an mlpack model. More...

 
template
<
typename
T
>
bool IsSerializable (const typename boost::enable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< arma::is_arma_type< T >>::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 &paramName)
 Print what a user would type to invoke the given option name. More...

 
std::string ParamType (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 &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...

 

Function Documentation

◆ 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.

◆ 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 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::markdown::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::markdown::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::markdown::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::markdown::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::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 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 
)

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 boost::enable_if< arma::is_arma_type< T >>::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 boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::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 boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::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 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 
)

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 boost::enable_if< arma::is_arma_type< T >>::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 boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::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 boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::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.

◆ IgnoreCheck()

bool mlpack::bindings::markdown::IgnoreCheck ( const T &  )
inline

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

We don't ignore any runtime checks for CLI bindings, so this always returns false.

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

For test bindings, we do not ignore any checks, so this always returns false.

Definition at line 117 of file print_doc_functions.hpp.

◆ IsSerializable() [1/4]

bool mlpack::bindings::markdown::IsSerializable ( const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0)

Return false, because the type is not serializable.

Definition at line 25 of file is_serializable.hpp.

◆ IsSerializable() [2/4]

bool mlpack::bindings::markdown::IsSerializable ( const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0)

Return false, because even though the type is serializable, it is an Armadillo type not an mlpack model.

Definition at line 36 of file is_serializable.hpp.

◆ IsSerializable() [3/4]

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

Return true, because the type is serializable.

Definition at line 46 of file is_serializable.hpp.

◆ IsSerializable() [4/4]

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

Return whether or not the type is serializable.

Definition at line 57 of file is_serializable.hpp.

◆ ParamString()

std::string mlpack::bindings::markdown::ParamString ( 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::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 &  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.