mlpack  2.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Option< N > Class Template Reference

A static object whose constructor registers a parameter with the CLI class. More...

Public Member Functions

 Option (const bool ignoreTemplate, const N defaultValue, const std::string &identifier, const std::string &description, const std::string &alias, const bool required=false, const bool input=true)
 Construct an Option object. More...
 
 Option (const std::string &identifier, const std::string &description, const std::string &alias)
 Constructs an Option object. More...
 

Detailed Description

template<typename N>
class mlpack::util::Option< N >

A static object whose constructor registers a parameter with the CLI class.

This should not be used outside of CLI itself, and you should use the PARAM_FLAG(), PARAM_DOUBLE(), PARAM_INT(), PARAM_STRING(), or other similar macros to declare these objects instead of declaring them directly.

See Also
core/io/cli.hpp, mlpack::CLI

Definition at line 32 of file option.hpp.

Constructor & Destructor Documentation

Option ( const bool  ignoreTemplate,
const N  defaultValue,
const std::string &  identifier,
const std::string &  description,
const std::string &  alias,
const bool  required = false,
const bool  input = true 
)

Construct an Option object.

When constructed, it will register itself with CLI.

Parameters
ignoreTemplateWhether or not the template type matters for this option. Essentially differs options with no value (flags) from those that do, and thus require a type.
defaultValueDefault value this parameter will be initialized to.
identifierThe name of the option (no dashes in front; for –help, we would pass "help").
descriptionA short string describing the option.
aliasShort name of the parameter.
requiredWhether or not the option is required at runtime.
inputWhether or not the option is an input option.
Option ( const std::string &  identifier,
const std::string &  description,
const std::string &  alias 
)

Constructs an Option object.

When constructed, it will register a flag with CLI.

Parameters
identifierThe name of the option (no dashes in front); for –help we would pass "help".
descriptionA short string describing the option.
aliasShort name of the parameter.

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