52 #ifndef BGEOT_GEOTRANS_INV_H__
53 #define BGEOT_GEOTRANS_INV_H__
66 base_matrix G, pc, K, B, CS;
70 bool has_linearized_approx =
false;
71 base_matrix K_ref_B_transp_lin;
75 const base_matrix &get_G()
const {
return G; }
78 : N(0), P(0), pgt(0), EPS(e) {}
83 : N(0), P(0), pgt(0), EPS(e)
85 init(cv.points(), pgt_);
91 : N(0), P(0), pgt(0), EPS(e)
114 scalar_type IN_EPS=1e-12,
bool project_into_element=
false);
135 scalar_type IN_EPS=1e-12,
bool project_into_element=
false);
139 scalar_type IN_EPS,
bool &converged,
bool throw_except,
140 bool project_into_element);
142 void update_linearization();
144 friend class geotrans_inv_convex_bfgs;
149 bool geotrans_changed = (pgt != pgt_);
if (geotrans_changed) pgt = pgt_;
150 GMM_ASSERT3(!nodes.empty(),
"empty points!");
151 if (N != nodes[0].size())
152 { N = nodes[0].size(); geotrans_changed =
true; }
153 if (geotrans_changed) {
154 P = pgt->structure()->dim();
155 pc.resize(pgt->nb_points() , P);
156 K.resize(N,P); B.resize(N,P); CS.resize(P,P);
157 G.resize(N, pgt->nb_points());
159 vectors_to_base_matrix(G, nodes);
160 if (pgt->is_linear()) {
161 if (geotrans_changed) {
163 pgt->poly_vector_grad(Dummy, pc);
168 if (pgt->complexity() > 1)
169 update_linearization();
185 void clear(
void) { tree.
clear(); }
188 tree.reserve(std::distance(c.begin(),c.end()));
189 typename CONT::const_iterator it = c.begin(), ite = c.end();
190 for (; it != ite; ++it) tree.
add_point(*it);
204 tree.points_in_box(ipts, min, max);
230 template<
class TAB,
class CONT1,
class CONT2>
233 CONT1 &pftab, CONT2 &itab,
234 bool bruteforce=
false);
241 template<
class TAB,
class CONT1,
class CONT2>
244 CONT1 &pftab, CONT2 &itab,
249 bounding_box(min, max, cv.points(), pgt);
250 for (
size_type k=0; k < min.size(); ++k) { min[k] -= EPS; max[k] += EPS; }
251 gic.init(cv.points(),pgt);
254 else boxpts = tree.points();
257 for (
size_type l = 0; l < boxpts.size(); ++l) {
259 if (gic.
invert(boxpts[l].n, pftab[nbpt], EPS)) {
260 itab[nbpt++] = boxpts[l].i;