Displaying 1 result from an estimated 1 matches for "myvector_wrap".
2008 Nov 06
2
Fwd: SWIG with R and C++ STL
...d halve_in_place(std::vector<double>& v) {
std::transform(v.begin(),v.end(),v.begin(),
std::bind2nd(std::divides<double>(),2.0));
}
-------------------------------------
Basicly they are just examples from the SWIG doc.
And I ran:
*swig -c++ -r -o myvector_wrap.cpp myvector.i
PKG_LIBS="myvector.h" R CMD SHLIB myvector_wrap.cpp*
Then in R I ran:
>*dyn.load("myvector.so")*
>*source("myvector.R")*
Then i tried to create a vector in R:
>*vi=IntVector(4)*
I go the following error:
*Error in .Call("R_swig_new_IntVecto...