param.hpp File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  DatasetMapper< PolicyType, InputType >
 Auxiliary information for a dataset, including mappings to/from strings (or other types) and the datatype of each dimension. More...

 

Namespaces

 mlpack
 
Linear algebra utility functions, generally performed on matrices or vectors.
 
 mlpack::data
 
Functions to load and save matrices and models.
 

Macros

#define BINDING_EXAMPLE(EXAMPLE)
 Specify the example of a binding. More...

 
#define BINDING_FUNCTION(...)   BINDING_NAME(__VA_ARGS__)
 Define the function to be called for a given binding. More...

 
#define BINDING_LONG_DESC(LONG_DESC)
 Specify the long description of a binding. More...

 
#define BINDING_SEE_ALSO(DESCRIPTION, LINK)
 Specify the see-also of a binding. More...

 
#define BINDING_SHORT_DESC(SHORT_DESC)
 Specify the short description of a binding. More...

 
#define BINDING_USER_NAME(NAME)
 Specify the user-friendly name of a binding. More...

 
#define PARAM(T, ID, DESC, ALIAS, NAME, REQ, IN, TRANS, DEF)
 Define the PARAM(), PARAM_MODEL() macro. More...

 
#define PARAM_COL(ID, DESC, ALIAS, REQ, TRANS, IN)
 
#define PARAM_COL_IN(ID, DESC, ALIAS)   PARAM_COL(ID, DESC, ALIAS, false, true, true)
 Define a vector input parameter (type arma::vec). More...

 
#define PARAM_COL_IN_REQ(ID, DESC, ALIAS)   PARAM_COL(ID, DESC, ALIAS, true, true, true)
 Define a required vector input parameter (type arma::vec). More...

 
#define PARAM_COL_OUT(ID, DESC, ALIAS)   PARAM_COL(ID, DESC, ALIAS, false, true, false)
 Define a vector output parameter (type arma::vec). More...

 
#define PARAM_DOUBLE_IN(ID, DESC, ALIAS, DEF)   PARAM_IN(double, ID, DESC, ALIAS, DEF, false)
 Define a double input parameter. More...

 
#define PARAM_DOUBLE_IN_REQ(ID, DESC, ALIAS)   PARAM_IN(double, ID, DESC, ALIAS, 0.0, true)
 Define a required double parameter. More...

 
#define PARAM_DOUBLE_OUT(ID, DESC)   PARAM_OUT(double, ID, DESC, "", 0.0, false)
 Define a double output parameter. More...

 
#define PARAM_FLAG(ID, DESC, ALIAS)   PARAM_IN(bool, ID, DESC, ALIAS, false, false);
 Define a flag parameter. More...

 
#define PARAM_GLOBAL(T, ID, DESC, ALIAS, NAME, REQ, IN, TRANS, DEF)
 
#define PARAM_IN(T, ID, DESC, ALIAS, DEF, REQ)   PARAM(T, ID, DESC, ALIAS, #T, REQ, true, false, DEF);
 Defining useful macros using PARAM macro defined later. More...

 
#define PARAM_INT_IN(ID, DESC, ALIAS, DEF)   PARAM_IN(int, ID, DESC, ALIAS, DEF, false)
 Define an integer input parameter. More...

 
#define PARAM_INT_IN_REQ(ID, DESC, ALIAS)   PARAM_IN(int, ID, DESC, ALIAS, 0, true)
 Define a required integer input parameter. More...

 
#define PARAM_INT_OUT(ID, DESC)   PARAM_OUT(int, ID, DESC, "", 0, false)
 Define an integer output parameter. More...

 
#define PARAM_MATRIX(ID, DESC, ALIAS, REQ, TRANS, IN)
 
#define PARAM_MATRIX_AND_INFO_IN(ID, DESC, ALIAS)
 
#define PARAM_MATRIX_IN(ID, DESC, ALIAS)   PARAM_MATRIX(ID, DESC, ALIAS, false, true, true)
 Define a matrix input parameter. More...

 
#define PARAM_MATRIX_IN_REQ(ID, DESC, ALIAS)   PARAM_MATRIX(ID, DESC, ALIAS, true, true, true)
 Define a required matrix input parameter. More...

 
#define PARAM_MATRIX_OUT(ID, DESC, ALIAS)   PARAM_MATRIX(ID, DESC, ALIAS, false, true, false)
 Define a matrix output parameter. More...

 
#define PARAM_MODEL(TYPE, ID, DESC, ALIAS, REQ, IN)
 
#define PARAM_MODEL_IN(TYPE, ID, DESC, ALIAS)   PARAM_MODEL(TYPE, ID, DESC, ALIAS, false, true)
 Define an input model. More...

 
#define PARAM_MODEL_IN_REQ(TYPE, ID, DESC, ALIAS)   PARAM_MODEL(TYPE, ID, DESC, ALIAS, true, true)
 Define a required input model. More...

 
#define PARAM_MODEL_OUT(TYPE, ID, DESC, ALIAS)   PARAM_MODEL(TYPE, ID, DESC, ALIAS, false, false)
 Define an output model. More...

 
#define PARAM_OUT(T, ID, DESC, ALIAS, DEF, REQ)   PARAM(T, ID, DESC, ALIAS, #T, REQ, false, false, DEF);
 
#define PARAM_ROW(ID, DESC, ALIAS, REQ, TRANS, IN)
 
#define PARAM_ROW_IN(ID, DESC, ALIAS)   PARAM_ROW(ID, DESC, ALIAS, false, true, true)
 Define a row vector input parameter (type arma::rowvec). More...

 
#define PARAM_ROW_OUT(ID, DESC, ALIAS)   PARAM_ROW(ID, DESC, ALIAS, false, true, false)
 Define a row vector output parameter (type arma::rowvec). More...

 
#define PARAM_STRING_IN(ID, DESC, ALIAS, DEF)   PARAM_IN(std::string, ID, DESC, ALIAS, DEF, false)
 Define a string input parameter. More...

 
#define PARAM_STRING_IN_REQ(ID, DESC, ALIAS)   PARAM_IN(std::string, ID, DESC, ALIAS, "", true)
 Define a required string parameter. More...

 
#define PARAM_STRING_OUT(ID, DESC, ALIAS)   PARAM_OUT(std::string, ID, DESC, ALIAS, "", false)
 Define a string output parameter. More...

 
#define PARAM_TMATRIX_IN(ID, DESC, ALIAS)   PARAM_MATRIX(ID, DESC, ALIAS, false, false, true)
 Define a transposed matrix input parameter. More...

 
#define PARAM_TMATRIX_IN_REQ(ID, DESC, ALIAS)   PARAM_MATRIX(ID, DESC, ALIAS, true, false, true)
 Define a required transposed matrix input parameter. More...

 
#define PARAM_TMATRIX_OUT(ID, DESC, ALIAS)   PARAM_MATRIX(ID, DESC, ALIAS, false, false, false)
 Define a transposed matrix output parameter. More...

 
#define PARAM_UCOL(ID, DESC, ALIAS, REQ, TRANS, IN)
 
#define PARAM_UCOL_IN(ID, DESC, ALIAS)   PARAM_UCOL(ID, DESC, ALIAS, false, true, true)
 Define an unsigned vector input parameter (type arma::Col<size_t>). More...

 
#define PARAM_UCOL_OUT(ID, DESC, ALIAS)   PARAM_UCOL(ID, DESC, ALIAS, false, true, false)
 Define an unsigned vector output parameter (type arma::Col<size_t>). More...

 
#define PARAM_UMATRIX(ID, DESC, ALIAS, REQ, TRANS, IN)
 
#define PARAM_UMATRIX_IN(ID, DESC, ALIAS)   PARAM_UMATRIX(ID, DESC, ALIAS, false, true, true)
 Define an unsigned matrix input parameter (arma::Mat<size_t>). More...

 
#define PARAM_UMATRIX_IN_REQ(ID, DESC, ALIAS)   PARAM_UMATRIX(ID, DESC, ALIAS, true, true, true)
 Define a required unsigned matrix input parameter (arma::Mat<size_t>). More...

 
#define PARAM_UMATRIX_OUT(ID, DESC, ALIAS)   PARAM_UMATRIX(ID, DESC, ALIAS, false, true, false)
 Define an unsigned matrix output parameter (arma::Mat<size_t>). More...

 
#define PARAM_UROW(ID, DESC, ALIAS, REQ, TRANS, IN)
 
#define PARAM_UROW_IN(ID, DESC, ALIAS)   PARAM_UROW(ID, DESC, ALIAS, false, true, true)
 Define an unsigned row vector input parameter (type arma::Row<size_t>). More...

 
#define PARAM_UROW_OUT(ID, DESC, ALIAS)   PARAM_UROW(ID, DESC, ALIAS, false, true, false)
 Define an unsigned row vector output parameter (type arma::Row<size_t>). More...

 
#define PARAM_VECTOR_IN(T, ID, DESC, ALIAS)   PARAM_IN(std::vector<T>, ID, DESC, ALIAS, std::vector<T>(), false)
 Define a std::vector input parameter. More...

 
#define PARAM_VECTOR_IN_REQ(T, ID, DESC, ALIAS)   PARAM_IN(std::vector<T>, ID, DESC, ALIAS, std::vector<T>(), true);
 Define a required vector parameter. More...

 
#define PARAM_VECTOR_OUT(T, ID, DESC, ALIAS)   PARAM_OUT(std::vector<T>, ID, DESC, ALIAS, std::vector<T>(), false)
 Define a vector output parameter. More...

 
#define TUPLE_TYPE   std::tuple<mlpack::data::DatasetInfo, arma::mat>
 Define an input DatasetInfo/matrix parameter. More...

 

Detailed Description

Author
Matthew Amidon
Ryan Curtin

Definition of PARAM_*_IN() and PARAM_*_OUT() macros, as well as the Documentation related macro, which are used to define input and output parameters of command-line programs and bindings to other languages.

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.

Definition in file param.hpp.

Macro Definition Documentation

◆ BINDING_EXAMPLE

#define BINDING_EXAMPLE (   EXAMPLE)
Value:
static \
mlpack::util::Example \
JOIN(JOIN(io_programexample_dummy_object_, __LINE__), opt) = \
mlpack::util::Example( \
STRINGIFY(BINDING_NAME), []() { return(std::string(EXAMPLE)); });

Specify the example of a binding.

Mutiple instance of this macro can be present in your program! Therefore, use it in the main.cpp (or corresponding binding) in your program.

See also
mlpack::IO, PARAM_FLAG(), PARAM_INT_IN(), PARAM_DOUBLE_IN(), PARAM_STRING_IN(), PARAM_VECTOR_IN(), PARAM_INT_OUT(), PARAM_DOUBLE_OUT(), PARAM_VECTOR_OUT(), PARAM_INT_IN_REQ(), PARAM_DOUBLE_IN_REQ(), PARAM_STRING_IN_REQ(), PARAM_VECTOR_IN_REQ(), PARAM_INT_OUT_REQ(), PARAM_DOUBLE_OUT_REQ(), PARAM_VECTOR_OUT_REQ(), PARAM_STRING_OUT_REQ().
Parameters
EXAMPLELong string describing a simple usage example.. Newlines should not be used here; this is taken care of by IO (however, you can explicitly specify newlines to denote new paragraphs). You can also use printing macros like PRINT_CALL(), PRINT_DATASET(), and others.

Definition at line 137 of file param.hpp.

◆ BINDING_FUNCTION

#define BINDING_FUNCTION (   ...)    BINDING_NAME(__VA_ARGS__)

Define the function to be called for a given binding.

BINDING_NAME should be set before calling this.

Definition at line 50 of file param.hpp.

◆ BINDING_LONG_DESC

#define BINDING_LONG_DESC (   LONG_DESC)
Value:
static \
mlpack::util::LongDescription \
io_programlong_desc_dummy_object = mlpack::util::LongDescription( \
STRINGIFY(BINDING_NAME), []() { return std::string(LONG_DESC); });

Specify the long description of a binding.

Only one instance of this macro present in your program! Therefore, use it in the main.cpp (or corresponding binding) in your program.

See also
mlpack::IO, PARAM_FLAG(), PARAM_INT_IN(), PARAM_DOUBLE_IN(), PARAM_STRING_IN(), PARAM_VECTOR_IN(), PARAM_INT_OUT(), PARAM_DOUBLE_OUT(), PARAM_VECTOR_OUT(), PARAM_INT_IN_REQ(), PARAM_DOUBLE_IN_REQ(), PARAM_STRING_IN_REQ(), PARAM_VECTOR_IN_REQ(), PARAM_INT_OUT_REQ(), PARAM_DOUBLE_OUT_REQ(), PARAM_VECTOR_OUT_REQ(), PARAM_STRING_OUT_REQ().
Parameters
LONG_DESCLong string describing what the program does. Newlines should not be used here; this is taken care of by IO (however, you can explicitly specify newlines to denote new paragraphs). You can also use printing macros like PRINT_PARAM_STRING(), PRINT_DATASET(), and others.

Definition at line 108 of file param.hpp.

◆ BINDING_SEE_ALSO

#define BINDING_SEE_ALSO (   DESCRIPTION,
  LINK 
)
Value:
static \
mlpack::util::SeeAlso \
JOIN(JOIN(io_programsee_also_dummy_object_, __LINE__), opt) = \
mlpack::util::SeeAlso(STRINGIFY(BINDING_NAME), DESCRIPTION, LINK);

Specify the see-also of a binding.

Mutiple instance of this macro can be present in your program! Therefore, use it in the main.cpp (or corresponding binding) in your program.

See also
mlpack::IO, PARAM_FLAG(), PARAM_INT_IN(), PARAM_DOUBLE_IN(), PARAM_STRING_IN(), PARAM_VECTOR_IN(), PARAM_INT_OUT(), PARAM_DOUBLE_OUT(), PARAM_VECTOR_OUT(), PARAM_INT_IN_REQ(), PARAM_DOUBLE_IN_REQ(), PARAM_STRING_IN_REQ(), PARAM_VECTOR_IN_REQ(), PARAM_INT_OUT_REQ(), PARAM_DOUBLE_OUT_REQ(), PARAM_VECTOR_OUT_REQ(), PARAM_STRING_OUT_REQ().

Provide a link for a binding's "see also" documentation section, which is primarily (but not necessarily exclusively) used by the Markdown bindings This link can be specified by calling SEE_ALSO("description", "link"), where "description" is the description of the link and "link" may be one of the following:

  • A direct URL, starting with http:// or https://.
  • A page anchor for documentation, referencing another binding by its CMake binding name, i.e. "#knn".
  • A link to a Doxygen page, using the mangled Doxygen name after a '@doxygen/', i.e., "@doxygen/mlpack1_1_adaboost1_1_AdaBoost".

Definition at line 173 of file param.hpp.

◆ BINDING_SHORT_DESC

#define BINDING_SHORT_DESC (   SHORT_DESC)
Value:
static \
mlpack::util::ShortDescription \
io_programshort_desc_dummy_object = mlpack::util::ShortDescription( \
STRINGIFY(BINDING_NAME), SHORT_DESC);

Specify the short description of a binding.

Only one instance of this macro should be present in your program! Therefore, use it in the main.cpp (or corresponding binding) in your program.

See also
mlpack::IO, PARAM_FLAG(), PARAM_INT_IN(), PARAM_DOUBLE_IN(), PARAM_STRING_IN(), PARAM_VECTOR_IN(), PARAM_INT_OUT(), PARAM_DOUBLE_OUT(), PARAM_VECTOR_OUT(), PARAM_INT_IN_REQ(), PARAM_DOUBLE_IN_REQ(), PARAM_STRING_IN_REQ(), PARAM_VECTOR_IN_REQ(), PARAM_INT_OUT_REQ(), PARAM_DOUBLE_OUT_REQ(), PARAM_VECTOR_OUT_REQ(), PARAM_STRING_OUT_REQ().
Parameters
SHORT_DESCShort two-sentence description of the program; it should describe what the program implements and does, and a quick overview of how it can be used and what it should be used for.

Definition at line 86 of file param.hpp.

◆ BINDING_USER_NAME

#define BINDING_USER_NAME (   NAME)
Value:
static \
mlpack::util::BindingName \
io_bindingname_dummy_object = mlpack::util::BindingName( \
STRINGIFY(BINDING_NAME), NAME);

Specify the user-friendly name of a binding.

Only one instance of this macro should be present per binding. BINDING_NAME should be set before calling this.

See also
mlpack::IO, PARAM_FLAG(), PARAM_INT_IN(), PARAM_DOUBLE_IN(), PARAM_STRING_IN(), PARAM_VECTOR_IN(), PARAM_INT_OUT(), PARAM_DOUBLE_OUT(), PARAM_VECTOR_OUT(), PARAM_INT_IN_REQ(), PARAM_DOUBLE_IN_REQ(), PARAM_STRING_IN_REQ(), PARAM_VECTOR_IN_REQ(), PARAM_INT_OUT_REQ(), PARAM_DOUBLE_OUT_REQ(), PARAM_VECTOR_OUT_REQ(), PARAM_STRING_OUT_REQ().
Parameters
NAMEUser-friendly name.

Definition at line 66 of file param.hpp.

◆ PARAM

#define PARAM (   T,
  ID,
  DESC,
  ALIAS,
  NAME,
  REQ,
  IN,
  TRANS,
  DEF 
)
Value:
JOIN(JOIN(io_option_dummy_object_in_, __LINE__), opt) \
(DEF, ID, DESC, ALIAS, NAME, REQ, IN, !TRANS, STRINGIFY(BINDING_NAME));
A static object whose constructor registers a parameter with the IO class.
Definition: cli_option.hpp:48

Define the PARAM(), PARAM_MODEL() macro.

Don't use this function; use the other ones above that call it. Note that we are using the LINE macro for naming these actual parameters when COUNTER does not exist, which is a bit of an ugly hack... but this is the preprocessor, after all. We don't have much choice other than ugliness.

Parameters
TType of the parameter.
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAlias for this parameter (one letter).
DEFDefault value of the parameter.
REQWhether or not parameter is required (boolean value).

Definition at line 1293 of file param.hpp.

◆ PARAM_COL

#define PARAM_COL (   ID,
  DESC,
  ALIAS,
  REQ,
  TRANS,
  IN 
)
Value:
PARAM(arma::vec, ID, DESC, ALIAS, "arma::vec", REQ, IN, TRANS, \
arma::vec());
#define PARAM(T, ID, DESC, ALIAS, NAME, REQ, IN, TRANS, DEF)
Define the PARAM(), PARAM_MODEL() macro.
Definition: param.hpp:1293

Definition at line 1238 of file param.hpp.

◆ PARAM_COL_IN

#define PARAM_COL_IN (   ID,
  DESC,
  ALIAS 
)    PARAM_COL(ID, DESC, ALIAS, false, true, true)

Define a vector input parameter (type arma::vec).

From the command line, the user can specify the file that holds the vector, using the name of the vector parameter with "_file" appended (and the same alias). So for instance, if the name of the vector parameter was "vec", the user could specify that the "vec" vector was held in vec.csv by giving the parameter:

--vec_file vector.csv
Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 680 of file param.hpp.

◆ PARAM_COL_IN_REQ

#define PARAM_COL_IN_REQ (   ID,
  DESC,
  ALIAS 
)    PARAM_COL(ID, DESC, ALIAS, true, true, true)

Define a required vector input parameter (type arma::vec).

From the command line, the user can specify the file that holds the vector, using the name of the vector parameter with "_file" appended (and the same alias). So for instance, if the name of the vector parameter was "vec", the user could specify that the "vec" vector was held in vec.csv by giving the parameter:

--vec_file vector.csv
Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 708 of file param.hpp.

◆ PARAM_COL_OUT

#define PARAM_COL_OUT (   ID,
  DESC,
  ALIAS 
)    PARAM_COL(ID, DESC, ALIAS, false, true, false)

Define a vector output parameter (type arma::vec).

When the program terminates, the vector will be saved to whatever it was set to during the program. From the command-line, the user may specify the file in which to save the output vector using a string option that is the name of the matrix parameter with "_file" appended. So, for instance, if the name of the output vector parameter was "vec", the user could specify that the "vec" vector should be saved in vector.csv by giving the parameter:

--vec_file vector.csv

The output vector will not be printed on stdout, like the other output option types.

Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 826 of file param.hpp.

◆ PARAM_DOUBLE_IN

#define PARAM_DOUBLE_IN (   ID,
  DESC,
  ALIAS,
  DEF 
)    PARAM_IN(double, ID, DESC, ALIAS, DEF, false)

Define a double input parameter.

The parameter can then be specified on the command line with –ID=value.

Parameters
IDName of the parameter.
DESCQuick description of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
DEFDefault value of the parameter.
See also
mlpack::IO, BINDING_USER_NAME(), BINDING_SHORT_DESC(), BINDING_LONG_DESC(), BINDING_EXAMPLE() and BINDING_SEE_ALSO().
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 285 of file param.hpp.

◆ PARAM_DOUBLE_IN_REQ

#define PARAM_DOUBLE_IN_REQ (   ID,
  DESC,
  ALIAS 
)    PARAM_IN(double, ID, DESC, ALIAS, 0.0, true)

Define a required double parameter.

The parameter must then be specified on the command line with –ID=value.

Parameters
IDName of the parameter.
DESCQuick description of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
See also
mlpack::IO, BINDING_USER_NAME(), BINDING_SHORT_DESC(), BINDING_LONG_DESC(), BINDING_EXAMPLE() and BINDING_SEE_ALSO().
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 1166 of file param.hpp.

◆ PARAM_DOUBLE_OUT

#define PARAM_DOUBLE_OUT (   ID,
  DESC 
)    PARAM_OUT(double, ID, DESC, "", 0.0, false)

Define a double output parameter.

This parameter will be printed on stdout at the end of the program; for instance, if the parameter name is "number" and the value is 5.012, the output on stdout would be of the following form:

number: 5.012

If the parameter is not set by the end of the program, a fatal runtime error will be issued.

Parameters
IDName of the parameter.
DESCQuick description of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
See also
mlpack::IO, BINDING_USER_NAME(), BINDING_SHORT_DESC(), BINDING_LONG_DESC(), BINDING_EXAMPLE() and BINDING_SEE_ALSO().
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 316 of file param.hpp.

◆ PARAM_FLAG

#define PARAM_FLAG (   ID,
  DESC,
  ALIAS 
)    PARAM_IN(bool, ID, DESC, ALIAS, false, false);

Define a flag parameter.

Parameters
IDName of the parameter.
DESCQuick description of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
See also
mlpack::IO, BINDING_USER_NAME(), BINDING_SHORT_DESC(), BINDING_LONG_DESC(), BINDING_EXAMPLE() and BINDING_SEE_ALSO().
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 199 of file param.hpp.

◆ PARAM_GLOBAL

#define PARAM_GLOBAL (   T,
  ID,
  DESC,
  ALIAS,
  NAME,
  REQ,
  IN,
  TRANS,
  DEF 
)
Value:
JOIN(JOIN(io_option_global_dummy_object_in_, __LINE__), opt) \
(DEF, ID, DESC, ALIAS, NAME, REQ, IN, !TRANS, "");
A static object whose constructor registers a parameter with the IO class.
Definition: cli_option.hpp:48

Definition at line 1298 of file param.hpp.

◆ PARAM_IN

#define PARAM_IN (   T,
  ID,
  DESC,
  ALIAS,
  DEF,
  REQ 
)    PARAM(T, ID, DESC, ALIAS, #T, REQ, true, false, DEF);

Defining useful macros using PARAM macro defined later.

Definition at line 1224 of file param.hpp.

◆ PARAM_INT_IN

#define PARAM_INT_IN (   ID,
  DESC,
  ALIAS,
  DEF 
)    PARAM_IN(int, ID, DESC, ALIAS, DEF, false)

Define an integer input parameter.

The parameter can then be specified on the command line with –ID=value.

Parameters
IDName of the parameter.
DESCQuick description of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
DEFDefault value of the parameter.
See also
mlpack::IO, BINDING_USER_NAME(), BINDING_SHORT_DESC(), BINDING_LONG_DESC(), BINDING_EXAMPLE() and BINDING_SEE_ALSO().
Bug:
Use a forward declaration of the class. The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 227 of file param.hpp.

◆ PARAM_INT_IN_REQ

#define PARAM_INT_IN_REQ (   ID,
  DESC,
  ALIAS 
)    PARAM_IN(int, ID, DESC, ALIAS, 0, true)

Define a required integer input parameter.

The parameter must then be specified on the command line with –ID=value.

Parameters
IDName of the parameter.
DESCQuick description of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
See also
mlpack::IO, BINDING_USER_NAME(), BINDING_SHORT_DESC(), BINDING_LONG_DESC(), BINDING_EXAMPLE() and BINDING_SEE_ALSO().
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 1141 of file param.hpp.

◆ PARAM_INT_OUT

#define PARAM_INT_OUT (   ID,
  DESC 
)    PARAM_OUT(int, ID, DESC, "", 0, false)

Define an integer output parameter.

This parameter will be printed on stdout at the end of the program; for instance, if the parameter name is "number" and the value is 5, the output on stdout would be of the following form:

number: 5

If the parameter is not set by the end of the program, a fatal runtime error will be issued.

Parameters
IDName of the parameter.
DESCQuick description of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
See also
mlpack::IO, BINDING_USER_NAME(), BINDING_SHORT_DESC(), BINDING_LONG_DESC(), BINDING_EXAMPLE() and BINDING_SEE_ALSO().
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 258 of file param.hpp.

◆ PARAM_MATRIX

#define PARAM_MATRIX (   ID,
  DESC,
  ALIAS,
  REQ,
  TRANS,
  IN 
)
Value:
PARAM(arma::mat, ID, DESC, ALIAS, "arma::mat", REQ, IN, \
TRANS, arma::mat());
#define PARAM(T, ID, DESC, ALIAS, NAME, REQ, IN, TRANS, DEF)
Define the PARAM(), PARAM_MODEL() macro.
Definition: param.hpp:1293

Definition at line 1230 of file param.hpp.

◆ PARAM_MATRIX_AND_INFO_IN

#define PARAM_MATRIX_AND_INFO_IN (   ID,
  DESC,
  ALIAS 
)
Value:
PARAM(TUPLE_TYPE, ID, DESC, ALIAS, \
"std::tuple<mlpack::data::DatasetInfo, arma::mat>", false, true, true, \
#define TUPLE_TYPE
Define an input DatasetInfo/matrix parameter.
Definition: param.hpp:1026
#define PARAM(T, ID, DESC, ALIAS, NAME, REQ, IN, TRANS, DEF)
Define the PARAM(), PARAM_MODEL() macro.
Definition: param.hpp:1293

Definition at line 1027 of file param.hpp.

◆ PARAM_MATRIX_IN

#define PARAM_MATRIX_IN (   ID,
  DESC,
  ALIAS 
)    PARAM_MATRIX(ID, DESC, ALIAS, false, true, true)

Define a matrix input parameter.

From the command line, the user can specify the file that holds the matrix, using the name of the matrix parameter with "_file" appended (and the same alias). So for instance, if the name of the matrix parameter was "mat", the user could specify that the "mat" matrix was held in matrix.csv by giving the parameter

--mat_file matrix.csv
Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 405 of file param.hpp.

◆ PARAM_MATRIX_IN_REQ

#define PARAM_MATRIX_IN_REQ (   ID,
  DESC,
  ALIAS 
)    PARAM_MATRIX(ID, DESC, ALIAS, true, true, true)

Define a required matrix input parameter.

From the command line, the user can specify the file that holds the matrix, using the name of the matrix parameter with "_file" appended (and the same alias). So for instance, if the name of the matrix parameter was "mat", the user could specify that the "mat" matrix was held in matrix.csv by giving the parameter

--mat_file matrix.csv
Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 433 of file param.hpp.

◆ PARAM_MATRIX_OUT

#define PARAM_MATRIX_OUT (   ID,
  DESC,
  ALIAS 
)    PARAM_MATRIX(ID, DESC, ALIAS, false, true, false)

Define a matrix output parameter.

When the program terminates, the matrix will be saved to whatever it was set to by IO::GetParam<arma::mat>(ID) during the program. From the command-line, the user may specify the file in which to save the output matrix using a string option that is the name of the matrix parameter with "_file" appended. So, for instance, if the name of the output matrix parameter was "mat", the user could speicfy that the "mat" matrix should be saved in matrix.csv by giving the parameter

--mat_file matrix.csv

The output matrix will not be printed on stdout, like the other output option types.

Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 466 of file param.hpp.

◆ PARAM_MODEL

#define PARAM_MODEL (   TYPE,
  ID,
  DESC,
  ALIAS,
  REQ,
  IN 
)
Value:
JOIN(JOIN(io_option_dummy_object_model_, __LINE__), opt) \
(nullptr, ID, DESC, ALIAS, #TYPE, REQ, IN, false, \
STRINGIFY(BINDING_NAME));
A static object whose constructor registers a parameter with the IO class.
Definition: cli_option.hpp:48

Definition at line 1303 of file param.hpp.

◆ PARAM_MODEL_IN

#define PARAM_MODEL_IN (   TYPE,
  ID,
  DESC,
  ALIAS 
)    PARAM_MODEL(TYPE, ID, DESC, ALIAS, false, true)

Define an input model.

From the command line, the user can specify the file that holds the model, using the name of the model parameter with "_file" appended (and the same alias). So for instance, if the name of the model parameter was "model", the user could specify that the "model" model was held in model.bin by giving the parameter

--model_file model.bin

Note that the first parameter of this model is the type (the class name) of the model to be loaded. This model type must have a serialize() function; a compilation error (a very long and complex one) will result if the model type does not have the following function:

template<typename Archive>
void serialize(Archive& ar, const uint32_t version);
Parameters
TYPEType of the model to be loaded.
IDName of the parameter.
DESCDescription of the parameter. Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).

Definition at line 1060 of file param.hpp.

◆ PARAM_MODEL_IN_REQ

#define PARAM_MODEL_IN_REQ (   TYPE,
  ID,
  DESC,
  ALIAS 
)    PARAM_MODEL(TYPE, ID, DESC, ALIAS, true, true)

Define a required input model.

From the command line, the user can specify the file that holds the model, using the name of the model parameter with "_file" appended (and the same alias). So for instance, if the name of the model parameter was "model", the user could specify that the "model" model was held in model.bin by giving the parameter

--model_file model.bin

Note that the first parameter of this model is the type (the class name) of the model to be loaded. This model type must have a serialize() function; a compilation error (a very long and complex one) will result if the model type does not have the following function:

template<typename Archive>
void serialize(Archive& ar, const uint32_t version);
Parameters
TYPEType of the model to be loaded.
IDName of the parameter.
DESCDescription of the parameter. Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).

Definition at line 1091 of file param.hpp.

◆ PARAM_MODEL_OUT

#define PARAM_MODEL_OUT (   TYPE,
  ID,
  DESC,
  ALIAS 
)    PARAM_MODEL(TYPE, ID, DESC, ALIAS, false, false)

Define an output model.

From the command line, the user can specify the file that should hold the model, using the name of the model parameter with "_file" appended (and the same alias). So for instance, if the user desires to save the model to model.bin and the parameter name is "model", they could specify

--model_file model.bin

The model will be saved at the termination of the program. If you use a parameter of this type, you must call IO::Destroy() at the end of your program.

Parameters
TYPEType of the model to be saved.
IDName of the parameter.
DESCDescription of the parameter. Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).

Definition at line 1116 of file param.hpp.

◆ PARAM_OUT

#define PARAM_OUT (   T,
  ID,
  DESC,
  ALIAS,
  DEF,
  REQ 
)    PARAM(T, ID, DESC, ALIAS, #T, REQ, false, false, DEF);

Definition at line 1227 of file param.hpp.

◆ PARAM_ROW

#define PARAM_ROW (   ID,
  DESC,
  ALIAS,
  REQ,
  TRANS,
  IN 
)
Value:
PARAM(arma::rowvec, ID, DESC, ALIAS, "arma::rowvec", REQ, IN, \
TRANS, arma::rowvec());
#define PARAM(T, ID, DESC, ALIAS, NAME, REQ, IN, TRANS, DEF)
Define the PARAM(), PARAM_MODEL() macro.
Definition: param.hpp:1293

Definition at line 1246 of file param.hpp.

◆ PARAM_ROW_IN

#define PARAM_ROW_IN (   ID,
  DESC,
  ALIAS 
)    PARAM_ROW(ID, DESC, ALIAS, false, true, true)

Define a row vector input parameter (type arma::rowvec).

From the command line, the user can specify the file that holds the vector, using the name of the vector parameter with "_file" appended (and the same alias). So for instance, if the name of the vector parameter was "vec", the user could specify that the "vec" vector was held in vec.csv by giving the parameter:

--vec_file vector.csv
Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 736 of file param.hpp.

◆ PARAM_ROW_OUT

#define PARAM_ROW_OUT (   ID,
  DESC,
  ALIAS 
)    PARAM_ROW(ID, DESC, ALIAS, false, true, false)

Define a row vector output parameter (type arma::rowvec).

When the program terminates, the vector will be saved to whatever it was set to during the program. From the command-line, the user may specify the file in which to save the output vector using a string option that is the name of the matrix parameter with "_file" appended. So, for instance, if the name of the output vector parameter was "vec", the user could specify that the "vec" vector should be saved in vector.csv by giving the parameter:

--vec_file vector.csv

The output vector will not be printed on stdout, like the other output option types.

Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 859 of file param.hpp.

◆ PARAM_STRING_IN

#define PARAM_STRING_IN (   ID,
  DESC,
  ALIAS,
  DEF 
)    PARAM_IN(std::string, ID, DESC, ALIAS, DEF, false)

Define a string input parameter.

The parameter can then be specified on the command line with –ID=value. If ALIAS is equal to DEF_MOD (which is set using the BINDING_LONG_DESC() macro), the parameter can be specified with just –ID=value.

Parameters
IDName of the parameter.
DESCQuick description of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
DEFDefault value of the parameter.
See also
mlpack::IO, BINDING_USER_NAME(), BINDING_SHORT_DESC(), BINDING_LONG_DESC(), BINDING_EXAMPLE() and BINDING_SEE_ALSO().
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 345 of file param.hpp.

◆ PARAM_STRING_IN_REQ

#define PARAM_STRING_IN_REQ (   ID,
  DESC,
  ALIAS 
)    PARAM_IN(std::string, ID, DESC, ALIAS, "", true)

Define a required string parameter.

The parameter must then be specified on the command line with –ID=value.

Parameters
IDName of the parameter.
DESCQuick description of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
See also
mlpack::IO, BINDING_USER_NAME(), BINDING_SHORT_DESC(), BINDING_LONG_DESC(), BINDING_EXAMPLE() and BINDING_SEE_ALSO().
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 1191 of file param.hpp.

◆ PARAM_STRING_OUT

#define PARAM_STRING_OUT (   ID,
  DESC,
  ALIAS 
)    PARAM_OUT(std::string, ID, DESC, ALIAS, "", false)

Define a string output parameter.

The string will be printed to stdout at the end of the program. For instance, if there was a string output parameter called "something" with value "hello", at the end of the program the output would be of the following form:

something: "hello"
Parameters
IDName of the parameter.
DESCQuick description of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
See also
mlpack::IO, BINDING_USER_NAME(), BINDING_SHORT_DESC(), BINDING_LONG_DESC(), BINDING_EXAMPLE() and BINDING_SEE_ALSO().
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 377 of file param.hpp.

◆ PARAM_TMATRIX_IN

#define PARAM_TMATRIX_IN (   ID,
  DESC,
  ALIAS 
)    PARAM_MATRIX(ID, DESC, ALIAS, false, false, true)

Define a transposed matrix input parameter.

This is useful when data is desired in row-major form instead of the usual column-major form. From the command line, the user can specify the file that holds the matrix, using the name of the matrix parameter with "_file" appended (and the same alias). So for instance, if the name of the matrix parameter was "mat", the user could specify that the "mat" matrix was held in matrix.csv by giving the parameter

--mat_file matrix.csv
Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 495 of file param.hpp.

◆ PARAM_TMATRIX_IN_REQ

#define PARAM_TMATRIX_IN_REQ (   ID,
  DESC,
  ALIAS 
)    PARAM_MATRIX(ID, DESC, ALIAS, true, false, true)

Define a required transposed matrix input parameter.

This is useful when data is desired in row-major form instead of the usual column-major form. From the command line, the user can specify the file that holds the matrix, using the name of the matrix parameter with "_file" appended (and the same alias). So for instance, if the name of the matrix parameter was "mat", the user could specify that the "mat" matrix was held in matrix.csv by giving the parameter

--mat_file matrix.csv
Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 525 of file param.hpp.

◆ PARAM_TMATRIX_OUT

#define PARAM_TMATRIX_OUT (   ID,
  DESC,
  ALIAS 
)    PARAM_MATRIX(ID, DESC, ALIAS, false, false, false)

Define a transposed matrix output parameter.

This is useful when data is stored in a row-major form instead of the usual column-major form. When the program terminates, the matrix will be saved to whatever it was set to by IO::GetParam<arma::mat>(ID) during the program. From the command-line, the user may specify the file in which to save the output matrix using a string option that is the name of the matrix parameter with "_file" appended. So, for instance, if the name of the output matrix parameter was "mat", the user could speicfy that the "mat" matrix should be saved in matrix.csv by giving the parameter

--mat_file matrix.csv

The output matrix will not be printed on stdout, like the other output option types.

Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 560 of file param.hpp.

◆ PARAM_UCOL

#define PARAM_UCOL (   ID,
  DESC,
  ALIAS,
  REQ,
  TRANS,
  IN 
)
Value:
PARAM(arma::Col<size_t>, ID, DESC, ALIAS, "arma::Col<size_t>", \
REQ, IN, TRANS, arma::Col<size_t>());
#define PARAM(T, ID, DESC, ALIAS, NAME, REQ, IN, TRANS, DEF)
Define the PARAM(), PARAM_MODEL() macro.
Definition: param.hpp:1293

Definition at line 1242 of file param.hpp.

◆ PARAM_UCOL_IN

#define PARAM_UCOL_IN (   ID,
  DESC,
  ALIAS 
)    PARAM_UCOL(ID, DESC, ALIAS, false, true, true)

Define an unsigned vector input parameter (type arma::Col<size_t>).

From the command line, the user can specify the file that holds the vector, using the name of the vector parameter with "_file" appended (and the same alias). So for instance, if the name of the vector parameter was "vec", the user could specify that the "vec" vector was held in vec.csv by giving the parameter:

--vec_file vector.csv
Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 764 of file param.hpp.

◆ PARAM_UCOL_OUT

#define PARAM_UCOL_OUT (   ID,
  DESC,
  ALIAS 
)    PARAM_UCOL(ID, DESC, ALIAS, false, true, false)

Define an unsigned vector output parameter (type arma::Col<size_t>).

When the program terminates, the vector will be saved to whatever it was set to during the program. From the command-line, the user may specify the file in which to save the output vector using a string option that is the name of the matrix parameter with "_file" appended. So, for instance, if the name of the output vector parameter was "vec", the user could specify that the "vec" vector should be saved in vector.csv by giving the parameter:

--vec_file vector.csv

The output vector will not be printed on stdout, like the other output option types.

Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 892 of file param.hpp.

◆ PARAM_UMATRIX

#define PARAM_UMATRIX (   ID,
  DESC,
  ALIAS,
  REQ,
  TRANS,
  IN 
)
Value:
PARAM(arma::Mat<size_t>, ID, DESC, ALIAS, "arma::Mat<size_t>", \
REQ, IN, TRANS, arma::Mat<size_t>());
#define PARAM(T, ID, DESC, ALIAS, NAME, REQ, IN, TRANS, DEF)
Define the PARAM(), PARAM_MODEL() macro.
Definition: param.hpp:1293

Definition at line 1234 of file param.hpp.

◆ PARAM_UMATRIX_IN

#define PARAM_UMATRIX_IN (   ID,
  DESC,
  ALIAS 
)    PARAM_UMATRIX(ID, DESC, ALIAS, false, true, true)

Define an unsigned matrix input parameter (arma::Mat<size_t>).

From the command line, the user can specify the file that holds the matrix, using the name of the matrix parameter with "_file" appended (and the same alias). So for instance, if the name of the matrix parameter was "mat", the user could specify that the "mat" matrix was held in matrix.csv by giving the parameter

--mat_file matrix.csv
Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 588 of file param.hpp.

◆ PARAM_UMATRIX_IN_REQ

#define PARAM_UMATRIX_IN_REQ (   ID,
  DESC,
  ALIAS 
)    PARAM_UMATRIX(ID, DESC, ALIAS, true, true, true)

Define a required unsigned matrix input parameter (arma::Mat<size_t>).

From the command line, the user can specify the file that holds the matrix, using the name of the matrix parameter with "_file" appended (and the same alias). So for instance, if the name of the matrix parameter was "mat", the user could specify that the "mat" matrix was held in matrix.csv by giving the parameter

--mat_file matrix.csv
Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 617 of file param.hpp.

◆ PARAM_UMATRIX_OUT

#define PARAM_UMATRIX_OUT (   ID,
  DESC,
  ALIAS 
)    PARAM_UMATRIX(ID, DESC, ALIAS, false, true, false)

Define an unsigned matrix output parameter (arma::Mat<size_t>).

When the program terminates, the matrix will be saved to whatever it was set to by IO::GetParam<arma::Mat<size_t>>(ID) during the program. From the command-line, the user may specify the file in which to save the output matrix using a string option that is the name of the matrix parameter with "_file" appended. So, for instance, if the name of the output matrix parameter was "mat", the user could speicfy that the "mat" matrix should be saved in matrix.csv by giving the parameter

--mat_file matrix.csv

The output matrix will not be printed on stdout, like the other output option types.

Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 651 of file param.hpp.

◆ PARAM_UROW

#define PARAM_UROW (   ID,
  DESC,
  ALIAS,
  REQ,
  TRANS,
  IN 
)
Value:
PARAM(arma::Row<size_t>, ID, DESC, ALIAS, "arma::Row<size_t>", \
REQ, IN, TRANS, arma::Row<size_t>());
#define PARAM(T, ID, DESC, ALIAS, NAME, REQ, IN, TRANS, DEF)
Define the PARAM(), PARAM_MODEL() macro.
Definition: param.hpp:1293

Definition at line 1250 of file param.hpp.

◆ PARAM_UROW_IN

#define PARAM_UROW_IN (   ID,
  DESC,
  ALIAS 
)    PARAM_UROW(ID, DESC, ALIAS, false, true, true)

Define an unsigned row vector input parameter (type arma::Row<size_t>).

From the command line, the user can specify the file that holds the vector, using the name of the vector parameter with "_file" appended (and the same alias). So for instance, if the name of the vector parameter was "vec", the user could specify that the "vec" vector was held in vec.csv by giving the parameter:

--vec_file vector.csv
Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 793 of file param.hpp.

◆ PARAM_UROW_OUT

#define PARAM_UROW_OUT (   ID,
  DESC,
  ALIAS 
)    PARAM_UROW(ID, DESC, ALIAS, false, true, false)

Define an unsigned row vector output parameter (type arma::Row<size_t>).

When the program terminates, the vector will be saved to whatever it was set to during the program. From the command-line, the user may specify the file in which to save the output vector using a string option that is the name of the matrix parameter with "_file" appended. So, for instance, if the name of the output vector parameter was "vec", the user could specify that the "vec" vector should be saved in vector.csv by giving the parameter:

--vec_file vector.csv

The output vector will not be printed on stdout, like the other output option types.

Parameters
IDName of the parameter.
DESCDescription of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 925 of file param.hpp.

◆ PARAM_VECTOR_IN

#define PARAM_VECTOR_IN (   T,
  ID,
  DESC,
  ALIAS 
)    PARAM_IN(std::vector<T>, ID, DESC, ALIAS, std::vector<T>(), false)

Define a std::vector input parameter.

The parameter can then be specified on the command line with –ID=value1,value2,value3.

Parameters
TType of the parameter.
IDName of the parameter.
DESCQuick description of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
See also
mlpack::IO, BINDING_USER_NAME(), BINDING_SHORT_DESC(), BINDING_LONG_DESC(), BINDING_EXAMPLE() and BINDING_SEE_ALSO().
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 952 of file param.hpp.

◆ PARAM_VECTOR_IN_REQ

#define PARAM_VECTOR_IN_REQ (   T,
  ID,
  DESC,
  ALIAS 
)    PARAM_IN(std::vector<T>, ID, DESC, ALIAS, std::vector<T>(), true);

Define a required vector parameter.

The parameter must then be specified on the command line with –ID=value1,value2,value3.

Parameters
TType of the parameter.
IDName of the parameter.
DESCQuick description of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
See also
mlpack::IO, BINDING_USER_NAME(), BINDING_SHORT_DESC(), BINDING_LONG_DESC(), BINDING_EXAMPLE() and BINDING_SEE_ALSO().
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 1218 of file param.hpp.

◆ PARAM_VECTOR_OUT

#define PARAM_VECTOR_OUT (   T,
  ID,
  DESC,
  ALIAS 
)    PARAM_OUT(std::vector<T>, ID, DESC, ALIAS, std::vector<T>(), false)

Define a vector output parameter.

This vector will be printed on stdout at the end of the program; for instance, if the parameter name is "vector" and the vector holds the array { 1, 2, 3, 4 }, the output on stdout would be of the following form:

vector: 1, 2, 3, 4

If the parameter is not set by the end of the program, a fatal runtime error will be issued.

Parameters
TType of the parameter.
IDName of the parameter.
DESCQuick description of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASAn alias for the parameter (one letter).
See also
mlpack::IO, BINDING_USER_NAME(), BINDING_SHORT_DESC(), BINDING_LONG_DESC(), BINDING_EXAMPLE() and BINDING_SEE_ALSO().
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 986 of file param.hpp.

◆ TUPLE_TYPE

#define TUPLE_TYPE   std::tuple<mlpack::data::DatasetInfo, arma::mat>

Define an input DatasetInfo/matrix parameter.

From the command line, the user can specify the file that holds the matrix, using the name of the matrix parameter with "_file" appended (and the same alias). So for instance, if the name of the matrix parameter was "matrix", the user could specify that the "matrix" matrix was held in file.csv by giving the parameter

--matrix_file file.csv

Then the DatasetInfo and matrix type could be accessed with

IO::GetParam<std::tuple<DatasetInfo, arma::mat>>("matrix").get<0>());
arma::mat m = std::move(
IO::GetParam<std::tuple<DatasetInfo, arma::mat>>("matrix").get<1>());
Parameters
IDName of the parameter.
DESCQuick description of the parameter (1-2 sentences). Don't use printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others here—it will cause problems.
ALIASOne-character string representing the alias of the parameter.
See also
mlpack::IO, BINDING_USER_NAME(), BINDING_SHORT_DESC(), BINDING_LONG_DESC(), BINDING_EXAMPLE() and BINDING_SEE_ALSO().
Bug:
The COUNTER variable is used in most cases to guarantee a unique global identifier for options declared using the PARAM_*() macros. However, not all compilers have this support–most notably, gcc < 4.3. In that case, the LINE macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See https://github.com/mlpack/mlpack/issues/100 for more information.

Definition at line 1026 of file param.hpp.