ошибка компиляции: нет соответствующей функции для вызова объекта типа - PullRequest
0 голосов
/ 07 марта 2019

У меня есть следующий код для интеграции, но я получаю вышеуказанную ошибку. Заголовочный файл:

#ifndef cppnew_hpp
#define cppnew_hpp

#include <boost/math/distributions/normal.hpp>
#include <stan/math.hpp>
#include <vector>
#include <iostream>
#include <limits>
#include <sstream>

stan::math::var partC( const double& a, const double& b, std::vector<double> theta, std::ostream& msgs) {
    auto f2 = [&](const double x, const double xc, const std::vector<var> theta,  std::vector<double> x_r, std::vector<int> x_i,  std::ostream& msgs) {
        return (( 0.5 * erfc(-(theta[0]-(theta[1]+theta[2]*exp(- theta[3]* pow((7.0+log(x)),theta[4]))))/(theta[5]*sqrt(2.0))));
    };

    const double tolerance = std::sqrt(std::numeric_limits<double>::epsilon());
    auto Q = stan::math::integrate_1d(f2, a, b, theta,{},{}, msgs, tolerance);
    return Q;
}


#endif /* cppnew_hpp */

Но я получаю ошибку:

/ Библиотека / Каркасы / R.framework / Версии / 3.5 / Ресурсы / Библиотека / StanHeaders / include / stan / math / prim / arr / functor / integrate_1d.hpp: 60: 14: ошибка: нет соответствующей функции для вызова объект типа 'const std :: __ 1 :: __ bind_r &, const std :: __ 1 :: placeholder :: __ ph <2> &, const std :: __ 1 :: vector> &, const std :: __ 1 :: vector> &, const std :: __ 1 :: vector> &, std :: __ 1 :: reference_wrapper>> ' вернуть f (x, std :: numeric_limits :: quiet_NaN ());

Я не могу понять, что я делаю неправильно. Я новичок в использовании C ++; поэтому любая помощь будет высоко ценится.

...