facilities.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_CORE_CV_METRICS_FACILITIES_HPP
13 #define MLPACK_CORE_CV_METRICS_FACILITIES_HPP
14 
15 #include <mlpack/core.hpp>
16 
17 namespace mlpack {
18 namespace cv {
19 
28 template<typename DataType>
29 void AssertSizes(const DataType& data,
30  const arma::Row<size_t>& labels,
31  const std::string& callerDescription)
32 {
33  if (data.n_cols != labels.n_elem)
34  {
35  std::ostringstream oss;
36  oss << callerDescription << ": number of points (" << data.n_cols << ") "
37  << "does not match number of labels (" << labels.n_elem << ")!"
38  << std::endl;
39  throw std::invalid_argument(oss.str());
40  }
41 }
42 
43 } // namespace cv
44 } // namespace mlpack
45 
46 #endif
.hpp
Definition: add_to_po.hpp:21
void AssertSizes(const DataType &data, const arma::Row< size_t > &labels, const std::string &callerDescription)
Assert there is the same number of the given data points and labels.
Definition: facilities.hpp:29
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...