13 #ifndef MLPACK_CORE_DATA_BINARIZE_HPP 14 #define MLPACK_CORE_DATA_BINARIZE_HPP 43 const double threshold)
45 output.copy_size(input);
47 const T *inPtr = input.memptr();
48 T *outPtr = output.memptr();
50 #pragma omp parallel for 51 for (omp_size_t i = 0; i < (omp_size_t) input.n_elem; ++i)
52 outPtr[i] = inPtr[i] > threshold;
79 const double threshold,
80 const size_t dimension)
84 #pragma omp parallel for 85 for (omp_size_t i = 0; i < (omp_size_t) input.n_cols; ++i)
86 output(dimension, i) = input(dimension, i) > threshold;
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.
void Binarize(const arma::Mat< T > &input, arma::Mat< T > &output, const double threshold)
Given an input dataset and threshold, set values greater than threshold to 1 and values less than or ...
Definition: binarize.hpp:41