20 std::vector<int>
convertVector(
const std::vector<std::string>& stringVector) {
22 for (
const std::string& binStr: stringVector) {
442 if((
x.value()&(1<<16))&&(
y.value()&(1<<16))){
443 if(std::abs(
y.to_float()) < std::abs(
x.to_float())) octant = 4;
445 }
else if(
x.value()&(1<<16)){
446 if(std::abs(
y.to_float()) < std::abs(
x.to_float())) octant = 3;
448 }
else if(
y.value()&(1<<16)){
449 if(std::abs(
y.to_float()) < std::abs(
x.to_float())) octant = 7;
452 if(std::abs(
y.to_float()) < std::abs(
x.to_float())) octant = 0;
458 if(octant==0||octant==3||octant==4||octant==7){
460 signed_x_f =
x.abs();
461 signed_y_f =
y.abs();
464 signed_x_f =
y.abs();
465 signed_y_f =
x.abs();
468 const std::vector<std::string> atan2_thresholds = {
476 unsigned int flag = 0;
477 for(
size_t j=0;j<atan2_thresholds.size(); ++j){
480 if(signed_x_f.to_float() >
yy.to_float())
flag = (
flag | (1<<j));
482 unsigned int octant_fine = 0;
483 if(
flag==0) octant_fine = 7;
484 else if(
flag==1) octant_fine = 6;
485 else if(
flag==3) octant_fine = 5;
486 else if(
flag==7) octant_fine = 4;
487 else if(
flag==15) octant_fine = 3;
488 else if(
flag==31) octant_fine = 2;
489 else if(
flag==63) octant_fine = 1;
490 else if(
flag==127) octant_fine = 0;
492 unsigned int octant_fine2 = 0;
493 if(
flag==0) octant_fine2 = 0;
494 else if(
flag==1) octant_fine2 = 1;
495 else if(
flag==3) octant_fine2 = 2;
496 else if(
flag==7) octant_fine2 = 3;
497 else if(
flag==15) octant_fine2 = 4;
498 else if(
flag==31) octant_fine2 = 5;
499 else if(
flag==63) octant_fine2 = 6;
500 else if(
flag==127) octant_fine2 = 7;
502 int intphi = octant << 3;
503 if(octant==0||octant==2||octant==4||octant==6){
504 intphi |= octant_fine;
506 intphi |= octant_fine2;
514 if((
x.value()&(1<<16))&&(
y.value()&(1<<16))){
515 if(std::abs(
y.to_float()) < std::abs(
x.to_float())) octant = 4;
517 }
else if(
x.value()&(1<<16)){
518 if(std::abs(
y.to_float()) < std::abs(
x.to_float())) octant = 3;
520 }
else if(
y.value()&(1<<16)){
521 if(std::abs(
y.to_float()) < std::abs(
x.to_float())) octant = 7;
524 if(std::abs(
y.to_float()) < std::abs(
x.to_float())) octant = 0;
530 if(octant==0||octant==3||octant==4||octant==7){
532 signed_x_f =
x.abs();
533 signed_y_f =
y.abs();
536 signed_x_f =
y.abs();
537 signed_y_f =
x.abs();
541 const std::vector<std::string> atan2_thresholds =
560 unsigned int thresholdsPassed = atan2_thresholds.size();
561 for(
size_t j=0;j<atan2_thresholds.size(); ++j){
564 if(! (signed_x_f.to_float() >
yy.to_float()) ) {
567 thresholdsPassed = j;
574 unsigned int octant_fine = 16 - (thresholdsPassed + 1);
578 unsigned int octant_fine2 = thresholdsPassed;
580 int intphi = octant << 4;
581 if(octant==0||octant==2||octant==4||octant==6){
582 intphi |= octant_fine;
584 intphi |= octant_fine2;