나는 다음과 같은 코드를 가지고 : 내가 컴파일 할 때부스트 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