Clang makes it obvious:
test.cpp:20:18: error: use of undeclared identifier 'math'; did you mean 'arma::math'?
lb(i) = -1*math::inf(); //problem line due to math
^~~~
arma::math
/Library/Frameworks/R.framework/Versions/3.2/Resources/library/RcppArmadillo/include/armadillo_bits/constants_compat.hpp:158:22: note: 'arma::math' declared here
typedef Math<double> math;
^
You want arma::math::inf()
, not math::inf()
.