私は次のコードを持っている:私は、コンパイル時に、私は次のエラーを取得する、しかしブーストSTUDENT_T分布
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/numeric/interval.hpp>
#include <boost/math/distributions/students_t.hpp>
using namespace boost::numeric;
using namespace interval_lib;
unsigned int len=10;
unsigned int v = len - 1;
double sqrtlen = sqrt(double(len));
students_t dist(v);
double stdev = 0.2;
double mean = 3;
double t_stat = mean * sqrtlen/stdev;
double q = cdf(complement(dist, std::fabs(t_stat)));
を:
Tests.cpp:39:3: error: ‘students_t’ was not declared in this scope
Tests.cpp:39:14: error: expected ‘;’ before ‘dist’
Tests.cpp:45:31: error: ‘dist’ was not declared in this scope
Tests.cpp:45:54: error: ‘complement’ was not declared in this scope
Tests.cpp:45:55: error: ‘cdf’ was not declared in this scope
私が持っているとき、それは文句を言っている理由を私は理解していません適切なヘッダーが含まれています。誰でもそれを修正する方法を教えてもらえますか?ありがとう!
ありがとうございました。私は名前空間のboost :: mathを見逃していました。それを修正しました – user1155299
@ user1155299:この場合、この回答を受け入れる必要があります。 – Mankarse