MCPcopy Create free account
hub / github.com/davisking/dlib / add

Method add

dlib/global_optimization/upper_bound_function.h:72–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 }
71
72 void add (
73 const function_evaluation& point
74 )
75 {
76 DLIB_CASSERT(point.x.size() != 0, "The vectors can't be empty.");
77 if (points.size() == 0)
78 {
79 points.push_back(point);
80 return;
81 }
82
83 DLIB_CASSERT(point.x.size() == dimensionality(), "All the vectors given to upper_bound_function must have the same dimensionality.");
84
85 if (points.size() < 4)
86 {
87 points.push_back(point);
88 *this = upper_bound_function(points, relative_noise_magnitude, solver_eps);
89 return;
90 }
91
92 points.push_back(point);
93 // add constraints between the new point and the old points
94 for (size_t i = 0; i < points.size()-1; ++i)
95 active_constraints.push_back(std::make_pair(i,points.size()-1));
96
97 learn_params();
98 }
99
100 long num_points(
101 ) const

Callers 15

find_max_globalFunction · 0.45
setMethod · 0.45
learn_paramsMethod · 0.45
base_windowMethod · 0.45
base_windowMethod · 0.45
find_connected_nodesFunction · 0.45
create_join_treeFunction · 0.45
validate_join_treeFunction · 0.45
enter_folderMethod · 0.45

Calls 3

sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected