Here's the function:
```
relu <- nimbleFunction(
run = function(x = double(2)) {
returnType(double(2))
return(x * ( x > 0 ))
})
```
And here's the error:
```
> compileNimble(relu)
Compiling
[Note] This may take a minute.
[Note] Use 'showCompilerOutput = TRUE' to see C++ compilation details.
Error: Failed to create the shared library. Run 'printErrors()' to see the compilation errors.
> printErrors()
using C++ compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
using SDK: ‘MacOSX14.0.sdk’
P_7_rcFun_SDMGPtools242.cpp:24:42: error: no matching member function for call to 'cwiseProduct'
Eig_Interm_156 = (Eig_ARG1_x_Interm_157).cwiseProduct((((Eig_ARG1_x_Interm_158).array() > 0)).cast<double>());
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/opt/homebrew/lib/R/4.3/site-library/nimble/include/Eigen/src/Core/../plugins/MatrixCwiseBinaryOps.h:23:1: note: candidate template ignored: could not match 'MatrixBase' against 'CwiseUnaryOp'
cwiseProduct(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
^
/opt/homebrew/lib/R/4.3/site-library/nimble/include/Eigen/src/Core/MatrixBase.h:443:5: note: candidate template ignored: could not match 'SparseMatrixBase' against 'CwiseUnaryOp'
cwiseProduct(const SparseMatrixBase<OtherDerived> &other) const
^
1 error generated.
make: *** [P_7_rcFun_SDMGPtools242.o] Error 1
```
It's possible that the complaint relates to the fact that `(x > 0)` is a logical type, where `x` is a double type?