MCPcopy Create free account
hub / github.com/abess-team/abess / testMinimize1

Method testMinimize1

python/include/unsupported/test/BVH.cpp:120–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118 }
119
120 void testMinimize1()
121 {
122 BallTypeList b;
123 for(int i = 0; i < 500; ++i) {
124 b.push_back(BallType(VectorType::Random(), 0.01 * internal::random(0., 1.)));
125 }
126 KdBVH<double, Dim, BallType> tree(b.begin(), b.end());
127
128 VectorType pt = VectorType::Random();
129 BallPointStuff<Dim> i1(pt), i2(pt);
130
131 double m1 = (std::numeric_limits<double>::max)(), m2 = m1;
132
133 for(int i = 0; i < (int)b.size(); ++i)
134 m1 = (std::min)(m1, i1.minimumOnObject(b[i]));
135
136 m2 = BVMinimize(tree, i2);
137
138 VERIFY_IS_APPROX(m1, m2);
139 }
140
141 void testIntersect2()
142 {

Callers 1

test_BVHFunction · 0.80

Calls 7

BVMinimizeFunction · 0.85
beginMethod · 0.80
endMethod · 0.80
randomFunction · 0.50
push_backMethod · 0.45
sizeMethod · 0.45
minimumOnObjectMethod · 0.45

Tested by

no test coverage detected