I am extending the parameter study example from boost\'s odeint used with thrust, and I do not know how to pass a vector of values to the constructor of the observer, such t
You can pass a thrust vector to the functor, but you can not easily store it here. But you can store the underlying raw pointer form this vector:
struct minPerturbFunctor
{
state_type::value_type* m_ptr;
size_t m_len;
minPerturbFunctor( state_type const& x )
: m_ptr( thrust::raw_pointer_cast(&x[0]) )
, m_len( x.size() )
{ }
template< class T >
__host__ __device__
void operator()( T t ) const
{
// now you can access m_ptr like m_ptr[i]
}
};
This is pretty much the suggestion from Robert Crovella.