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
 
Linear algebra utility functions, generally performed on matrices or vectors.
 
 mlpack::util
 

Functions

void ReportIgnoredParam (util::Params &params, 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 (util::Params &params, 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 IO object; otherwise, issue a warning or fatal error, optionally with the given custom error message. More...

 
void RequireNoneOrAllPassed (util::Params &params, 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 IO object; otherwise, issue a warning or fatal error, optionally with the given custom error message. More...

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

 
template
<
typename
T
>
void RequireParamInSet (util::Params &params, 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 (util::Params &params, 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.