MLPACK
1.0.10
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
mlpack
methods
nystroem_method
random_selection.hpp
Go to the documentation of this file.
1
24
#ifndef __MLPACK_METHODS_NYSTROEM_METHOD_RANDOM_SELECTION_HPP
25
#define __MLPACK_METHODS_NYSTROEM_METHOD_RANDOM_SELECTION_HPP
26
27
#include <
mlpack/core.hpp
>
28
29
namespace
mlpack {
30
namespace
kernel {
31
32
class
RandomSelection
33
{
34
public
:
42
const
static
arma::Col<size_t>
Select
(
const
arma::mat& data,
const
size_t
m)
43
{
44
arma::Col<size_t> selectedPoints(m);
45
for
(
size_t
i = 0; i < m; ++i)
46
selectedPoints(i) =
math::RandInt
(0, data.n_cols);
47
48
return
selectedPoints;
49
}
50
};
51
52
};
// namespace kernel
53
};
// namespace mlpack
54
55
#endif
Generated by
1.8.3.1