mlpack  3.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
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 IO object; oth...
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 IO 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 IO ...
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.
src mlpack core util version hpp VERSION_HPP_CONTENTS string(REGEX REPLACE".*#define MLPACK_VERSION_MAJOR ([0-9]+).*""\\1"MLPACK_VERSION_MAJOR"${VERSION_HPP_CONTENTS}") string(REGEX REPLACE".* MLPACK_VERSION_MINOR "$
Definition: CMakeLists.txt:79
set(SOURCES add_to_cli11.hpp cli_option.hpp default_param.hpp default_param_impl.hpp delete_allocated_memory.hpp end_program.hpp get_allocated_memory.hpp get_param.hpp get_raw_param.hpp get_printable_param.hpp get_printable_param_impl.hpp get_printable_param_name.hpp get_printable_param_name_impl.hpp get_printable_param_value.hpp get_printable_param_value_impl.hpp in_place_copy.hpp map_parameter_name.hpp output_param.hpp output_param_impl.hpp parameter_type.hpp parse_command_line.hpp print_doc_functions.hpp print_doc_functions_impl.hpp print_help.hpp print_help.cpp print_type_doc.hpp print_type_doc_impl.hpp set_param.hpp string_type_param.hpp string_type_param_impl.hpp) add_executable(mlpack_ $
Definition: CMakeLists.txt:3