param_checks.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_CORE_UTIL_PARAM_CHECKS_HPP
15 #define MLPACK_CORE_UTIL_PARAM_CHECKS_HPP
16 
17 #include <mlpack/prereqs.hpp>
18 
19 namespace mlpack {
20 namespace util {
21 
48  const std::vector<std::string>& constraints,
49  const bool fatal = true,
50  const std::string& customErrorMessage = "");
51 
81  const std::vector<std::string>& constraints,
82  const bool fatal = true,
83  const std::string& customErrorMessage = "");
84 
111  const std::vector<std::string>& constraints,
112  const bool fatal = true,
113  const std::string& customErrorMessage = "");
114 
138 template<typename T>
139 void RequireParamInSet(const std::string& paramName,
140  const std::vector<T>& set,
141  const bool fatal,
142  const std::string& errorMessage);
143 
167 template<typename T>
168 void RequireParamValue(const std::string& paramName,
169  const std::function<bool(T)>& conditional,
170  const bool fatal,
171  const std::string& errorMessage);
172 
183 void ReportIgnoredParam(
184  const std::vector<std::pair<std::string, bool>>& constraints,
185  const std::string& paramName);
186 
203 void ReportIgnoredParam(const std::string& paramName,
204  const std::string& reason);
205 
206 } // namespace util
207 } // namespace mlpack
208 
209 // Include implementation.
210 #include "param_checks_impl.hpp"
211 
212 #endif
strip_type.hpp
Definition: add_to_po.hpp:21
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; ot...
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...
The core includes that mlpack expects; standard C++ includes and Armadillo.
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.
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...
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.
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.