mlpack 3.4.2
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
19namespace mlpack {
20namespace 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
138template<typename T>
139void RequireParamInSet(const std::string& paramName,
140 const std::vector<T>& set,
141 const bool fatal,
142 const std::string& errorMessage);
143
167template<typename T>
168void RequireParamValue(const std::string& paramName,
169 const std::function<bool(T)>& conditional,
170 const bool fatal,
171 const std::string& errorMessage);
172
184 const std::vector<std::pair<std::string, bool>>& constraints,
185 const std::string& paramName);
186
203void 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
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) set(DIR_SRCS) foreach(file $
Definition: CMakeLists.txt:3
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 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 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 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 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;...
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.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.