以前はこれに問題がありましたが、今では何とか機能しています。
今、私は次の問題を抱えています。同じ関数で boost::bisect を呼び出す前に、メンバー関数に値をバインドする必要があります。かなり良いチュートリアルを見つけてそれに従いましたが、まだ何か間違っているようです。
最初に、次の作業を行うテストクラスを作成しました。
std::pair<double, double> result = bisect(&Func, 0.0, 1.0, TerminationCondition());
double root = (result.first + result.second) / 2;
その後、「うまくいくと思ったのでその場で」バインディングを追加しました
std::pair<double, double> result = bisect(boost::bind(&CLASS::Function,this, _1), 0.0, 1.000000, TerminationCondition());
その結果はエラーでした。エラー: 'boost::exception_detail::clone_impl >' のインスタンスをスローした後に終了が呼び出されました:bisect、検索するルートがないか、間隔に複数のルートがあります (f(min) = -0.0032916729090909091)。
とにかく、何らかの理由でバインディングを使用してメンバー関数として機能しない class::function があります。非メンバーとしてテストしましたが、動作します
double CLASS::Function(double c)
{
/* values: m_a, m_b, m_c, m_d, and m_minus are located in .h file */
normal norm;
double temp = m_d*sqrt(c);
double total = ((1-boost::math::pdf(norm,(m_a*c+m_b)/temp))-(1 - m_c)+boost::math::pdf(norm,(m_a*c+m_b)/temp));
return (total - m_minus);
}