mlpack  master
Public Attributes | List of all members
mlpack::util::ParamData Struct Reference

This structure holds all of the information about a single parameter, including its value (which is set when ParseCommandLine() is called). More...

Public Attributes

char alias
 Alias for this parameter. More...
 
std::string boostName
 The name of the parameter, as seen by boost::program_options. More...
 
std::string(* defaultFunction )(const ParamData &)
 When the CLI object is asked to print help, output the default value. More...
 
std::string desc
 Description of this parameter, if any. More...
 
bool input
 True if this option is an input option (otherwise, it is output). More...
 
bool isFlag
 True if the wasPassed value should not be ignored. More...
 
bool isMappedString
 If this is a matrix or model parameter, then boost::program_options will actually represent this as a string. More...
 
bool loaded
 If this is an input parameter that needs extra loading, this indicates whether or not it has been loaded. More...
 
boost::any mappedValue
 The value that the user interacts with, if the type is different than the type of the parameter. More...
 
std::string name
 Name of this parameter. More...
 
bool noTranspose
 True if this is a matrix that should not be transposed. More...
 
void(* outputFunction )(const ParamData &)
 When the CLI object is destructed, output options must be output. More...
 
void(* printFunction )(const ParamData &)
 When the CLI object is destructed, output a string representation of the parameter. More...
 
bool required
 True if this option is required. More...
 
std::string(* stringTypeFunction )()
 When the CLI object is asked to print parameter types, output a string version of this parameter's type. More...
 
std::string tname
 Type information of this parameter. More...
 
boost::any value
 The actual value that is held, as passed from the user (so the type could be different than the type of the parameter). More...
 

Detailed Description

This structure holds all of the information about a single parameter, including its value (which is set when ParseCommandLine() is called).

It does not hold any information about whether or not it was passed—that is handled elsewhere. A ParamData struct is only useful in order to get "static" information about a parameter. Note that some parameter types have internal types but also different types that are used by boost::program_options (specifically, matrix and model types map to strings).

This structure is somewhat unwieldy and is likely to be refactored at some point in the future, but for now it does the job fine.

Definition at line 90 of file param_data.hpp.

Member Data Documentation

char mlpack::util::ParamData::alias

Alias for this parameter.

Definition at line 101 of file param_data.hpp.

std::string mlpack::util::ParamData::boostName

The name of the parameter, as seen by boost::program_options.

Definition at line 125 of file param_data.hpp.

std::string(* mlpack::util::ParamData::defaultFunction) (const ParamData &)

When the CLI object is asked to print help, output the default value.

Definition at line 134 of file param_data.hpp.

std::string mlpack::util::ParamData::desc

Description of this parameter, if any.

Definition at line 96 of file param_data.hpp.

bool mlpack::util::ParamData::input

True if this option is an input option (otherwise, it is output).

Definition at line 110 of file param_data.hpp.

bool mlpack::util::ParamData::isFlag

True if the wasPassed value should not be ignored.

Definition at line 103 of file param_data.hpp.

bool mlpack::util::ParamData::isMappedString

If this is a matrix or model parameter, then boost::program_options will actually represent this as a string.

Definition at line 116 of file param_data.hpp.

bool mlpack::util::ParamData::loaded

If this is an input parameter that needs extra loading, this indicates whether or not it has been loaded.

Definition at line 113 of file param_data.hpp.

boost::any mlpack::util::ParamData::mappedValue

The value that the user interacts with, if the type is different than the type of the parameter.

This is used to store matrices, for instance, because 'value' must hold the string name that the user passed.

Definition at line 123 of file param_data.hpp.

Referenced by mlpack::util::HandleRawParameter().

std::string mlpack::util::ParamData::name

Name of this parameter.

This is the name used for HasParam() and GetParam().

Definition at line 94 of file param_data.hpp.

bool mlpack::util::ParamData::noTranspose

True if this is a matrix that should not be transposed.

Ignored if the parameter is not a matrix.

Definition at line 106 of file param_data.hpp.

void(* mlpack::util::ParamData::outputFunction) (const ParamData &)

When the CLI object is destructed, output options must be output.

If 'input' is false, then this function pointer should point to a function that outputs the parameter.

Definition at line 129 of file param_data.hpp.

void(* mlpack::util::ParamData::printFunction) (const ParamData &)

When the CLI object is destructed, output a string representation of the parameter.

Definition at line 132 of file param_data.hpp.

bool mlpack::util::ParamData::required

True if this option is required.

Definition at line 108 of file param_data.hpp.

std::string(* mlpack::util::ParamData::stringTypeFunction) ()

When the CLI object is asked to print parameter types, output a string version of this parameter's type.

Definition at line 137 of file param_data.hpp.

std::string mlpack::util::ParamData::tname

Type information of this parameter.

Note that this is TYPENAME() of the user-visible parameter type, not whatever is given by ParameterType<>.

Definition at line 99 of file param_data.hpp.

boost::any mlpack::util::ParamData::value

The actual value that is held, as passed from the user (so the type could be different than the type of the parameter).

Definition at line 119 of file param_data.hpp.


The documentation for this struct was generated from the following file: