26 const double iter_tol,
27 const double inside_tol,
35 const double error_tol_sqr = iter_tol * iter_tol;
46 work, new_pos.
array() );
52 int dum, *tmp_inside = ( inside ? inside : &
dum );
56 while( res % res > error_tol_sqr )
61 *tmp_inside = ( *inside_f )( params, ndim, inside_tol );
62 if( !( *tmp_inside ) )
69 rval = ( *jacob )( cvparams->
array(), verts, nverts, ndim, work, J.
array() );
71 if( det < std::numeric_limits< double >::epsilon() )
73 *tmp_inside = ( *inside_f )( params, ndim, inside_tol );
74 if( !( *tmp_inside ) )
84 rval = ( *eval )( params, verts, ndim,
86 work, new_pos.
array() );
88 res = new_pos - *cvposn;
91 if( inside ) *inside = ( *inside_f )( params, ndim, inside_tol );
98 if( params[0] >= -1 - tol && params[0] <= 1 + tol &&
99 ( ndims < 2 || ( params[1] >= -1 - tol && params[1] <= 1 + tol ) ) &&
100 ( ndims < 3 || ( params[2] >= -1 - tol && params[2] <= 1 + tol ) ) )
139 const double iter_tol,
140 const double inside_tol,
143 unsigned int* num_evals )
147 unsigned int nevals = 0;
153 rval =
reverse_eval( point, iter_tol, inside_tol, params, &is_inside );
155 if( is_inside )
break;
157 containing_ent = ( i ==
entities.end() ? 0 : *i );
158 if( num_evals ) *num_evals += nevals;