Skip to content

Commit

Permalink
Using R's fround, as std::round is from C++11
Browse files Browse the repository at this point in the history
  • Loading branch information
jonclayden committed Feb 23, 2018
1 parent 8bb4c16 commit 7445509
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.cpp
Expand Up @@ -403,7 +403,7 @@ BEGIN_RCPP
if (points.ncol() == 2)
{
// Begin at the centre of the target image
Eigen::Vector2d start(std::round((targetImage->dim[1]-1.0) / 2.0), std::round((targetImage->dim[2]-1.0) / 2.0));
Eigen::Vector2d start(Rf_fround((targetImage->dim[1]-1.0) / 2.0, 0), Rf_fround((targetImage->dim[2]-1.0) / 2.0, 0));
for (int i=0; i<points.nrow(); i++)
{
Eigen::Vector2d point;
Expand All @@ -420,7 +420,7 @@ BEGIN_RCPP
else if (points.ncol() == 3)
{
// Begin at the centre of the target image
Eigen::Vector3d start(std::round((targetImage->dim[1]-1.0) / 2.0), std::round((targetImage->dim[2]-1.0) / 2.0), std::round((targetImage->dim[3]-1.0) / 2.0));
Eigen::Vector3d start(Rf_fround((targetImage->dim[1]-1.0) / 2.0, 0), Rf_fround((targetImage->dim[2]-1.0) / 2.0, 0), Rf_fround((targetImage->dim[3]-1.0) / 2.0, 0));
for (int i=0; i<points.nrow(); i++)
{
Eigen::Vector3d point;
Expand Down

0 comments on commit 7445509

Please sign in to comment.