param_checks.hpp File Reference
Include dependency graph for param_checks.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 mlpack
 
.hpp
 
 mlpack::util
 

Functions

void ReportIgnoredParam (const std::vector< std::pair< std::string, bool >> &constraints, const std::string &paramName)
 Report that a parameter is ignored, if each of the constraints given are satisfied. More...

 
void ReportIgnoredParam (const std::string &paramName, const std::string &reason)
 If the given parameter is passed, report that it is ignored, supplying a custom reason. More...

 
void RequireAtLeastOnePassed (const std::vector< std::string > &constraints, const bool fatal=true, const std::string &customErrorMessage="")
 Require that at least one of the given parameters in the constraints set was passed to the CLI object; otherwise, issue a warning or fatal error, optionally with the given custom error message. More...

 
void RequireNoneOrAllPassed (const std::vector< std::string > &constraints, const bool fatal=true, const std::string &customErrorMessage="")
 Require that either none or all of the given parameters in the constraints set were passed to the CLI object; otherwise, issue a warning or fatal error, optionally with the given custom error message. More...

 
void RequireOnlyOnePassed (const std::vector< std::string > &constraints, const bool fatal=true, const std::string &customErrorMessage="")
 Require that only one of the given parameters in the constraints set was passed to the CLI object; otherwise, issue a warning or fatal error, optionally with the given custom error message. More...

 
template
<
typename
T
>
void RequireParamInSet (const std::string &paramName, const std::vector< T > &set, const bool fatal, const std::string &errorMessage)
 Require that a given parameter is in a set of allowable parameters. More...

 
template
<
typename
T
>
void RequireParamValue (const std::string &paramName, const std::function< bool(T)> &conditional, const bool fatal, const std::string &errorMessage)
 Require that a given parameter satisfies the given conditional function. More...

 

Detailed Description

Author
Ryan Curtin

A set of utility functions to check parameter values for mlpack programs. These are meant to be used as the first part of an mlpackMain() function, to validate parameters.

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