我正在使用boost的使用push的odeint扩展参数研究示例,我不知道如何将值向量传递给观察者的构造函数,以便可以从观察者的函子中访问这些值(只读) .
以下是仅供观察者使用的代码.
//// Observes the system, comparing the current state to
//// values in unchangingVector
struct minimum_perturbation_observer {
struct minPerturbFunctor
{
template< class T >
__host__ __device__
void operator()( T t ) const
{
//// I would like to be able to read any member
//// of m_unchangingVector here.
}
};
// CONSTRUCTOR
minimum_perturbation_observer( size_t N, state_type unchangingVector, int len) :
m_N( N ),
m_output( N ),
m_unchangingVector( len ) // len is the correct length of unchangingVector
{ …Run Code Online (Sandbox Code Playgroud)