23 Derived<CosanModel> Model,
24 Derived<CosanMetric<NumericType>> Metric,
25 Derived<Splitter> Split>
33 const std::vector<NumericType> & paramGrid):
Search() {
34 NumericType minError = std::numeric_limits<NumericType>::infinity();
37 for (gsl::index i = 0; i < paramGrid.size(); ++i){
38 currParam = paramGrid[i];
39 estimator.SetParams(paramGrid[i]);
41 if (currError < minError)
66 Derived<CosanModel> Model,
67 Derived<CosanMetric<NumericType>> Metric,
68 Derived<Splitter> Split>
81 const std::vector<NumericType> & paramGrid,
int nthreads = -1):
Search() {
82 NumericType minError = std::numeric_limits<NumericType>::infinity();
83 std::vector<NumericType> allError(paramGrid.size());
85 omp_set_num_threads(omp_get_max_threads());
88 omp_set_num_threads(nthreads);
90 #pragma omp parallel for
91 for (gsl::index i = 0; i < paramGrid.size(); ++i){
92 estimator.SetParams(paramGrid[i]);
95 bestParam =paramGrid[std::distance(allError.begin(), std::min_element(allError.begin(), allError.end()))];
109 Derived<CosanModel> Model,
110 Derived<CosanMetric<NumericType>> Metric,
111 Derived<Splitter> Split>
124 const std::vector<std::vector<NumericType>> & paramGrid):
Search() {
125 NumericType minError = std::numeric_limits<NumericType>::infinity();
129 for (gsl::index i = 0; i < paramGrid.size(); ++i){
130 currParam = paramGrid[i];
131 estimator.SetParams(paramGrid[i]);
133 if (currError < minError)
135 minError = currError;
151 Derived<CosanModel> Model,
152 Derived<CosanMetric<NumericType>> Metric,
153 Derived<Splitter> Split>
166 const std::vector<std::vector<NumericType>> & paramGrid,
167 int nthreads = -1):
Search() {
168 NumericType minError = std::numeric_limits<NumericType>::infinity();
169 std::vector<NumericType> allError(paramGrid.size());
171 omp_set_num_threads(omp_get_max_threads());
174 omp_set_num_threads(nthreads);
176 #pragma omp parallel for
177 for (gsl::index i = 0; i < paramGrid.size(); ++i){
178 estimator.SetParams(paramGrid[i]);
181 bestParam =paramGrid[std::distance(allError.begin(), std::min_element(allError.begin(), allError.end()))];