Re: [R-pkg-devel] Inconsistent functionality of c++ code in MatchIt

2023-05-11 Thread Noah Greifer
I want to thank Bill and everyone that reached out to me individually. It looks like Bill's solution is the right one, as he was able to replicate and fix the problem. I am still a bit confused on why this would occur on some OSs and not others (probably due to different compilers), but I think the

Re: [R-pkg-devel] Inconsistent functionality of c++ code in MatchIt

2023-05-11 Thread Bill Dunlap
I see the problem when I compile the C++ code on Ubuntu 20.04 and the latest R-devel with C++ compiler: ‘g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 If I change all the unadorned 'abs' calls in src/nn_matchC_vec.cpp with the prefix 'std::' the problem goes away. -Bill On Thu, May 11, 2023 at 11:

[R-pkg-devel] Inconsistent functionality of c++ code in MatchIt

2023-05-11 Thread Noah Greifer
Hello, I'm the mainter of the package *MatchIt*, which uses *Rcpp* to implement nearest neighbor matching. One way to customize nearest neighbor matching is to add a caliper, which is the largest distance two units can be from each other before they are not allowed to be matched. I've had some use