MCPcopy Create free account
hub / github.com/OSGeo/PROJ / complex_default_impl

Function complex_default_impl

src/transformations/horner.cpp:405–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405static PJ_UV complex_default_impl(PJ *P, const HORNER *transformation,
406 PJ_DIRECTION direction, PJ_UV position) {
407 /***********************************************************************
408
409 A reimplementation of a classic Engsager/Poder Horner complex
410 polynomial evaluation engine.
411
412 ***********************************************************************/
413 assert(direction == PJ_FWD || direction == PJ_INV);
414
415 double n, e;
416 if (direction == PJ_FWD) { /* forward */
417 e = position.u - transformation->fwd_origin->u;
418 n = position.v - transformation->fwd_origin->v;
419 } else { /* inverse */
420 e = position.u - transformation->inv_origin->u;
421 n = position.v - transformation->inv_origin->v;
422 }
423 if (transformation->uneg)
424 e = -e;
425 if (transformation->vneg)
426 n = -n;
427
428 if (coords_out_of_range(P, transformation, n, e)) {
429 return generate_error_coords();
430 }
431
432 // coefficient pointers
433 double *cb =
434 direction == PJ_FWD ? transformation->fwd_c : transformation->inv_c;
435 PJ_UV en = {e, n};
436 position = complex_horner_eval(transformation->order, cb, en);
437 return position;
438}
439
440static PJ_UV complex_iterative_inverse_impl(PJ *P, const HORNER *transformation,
441 PJ_UV position) {

Callers 2

Calls 3

coords_out_of_rangeFunction · 0.85
generate_error_coordsFunction · 0.85
complex_horner_evalFunction · 0.85

Tested by

no test coverage detected