我编写了一个 cpp 源代码,其中包含 pari.h 头文件:
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<stdlib.h>
#include<time.h>
#include<iterator> // for ostream_iterator
#include<strings.h>
#include<string.h>
#include<sstream>
#include <pari/pari.h> // for PARI/GP library
#include<Rcpp.h> // for sourceCpp to work, this line must be uncommented
// Enable C++11 via this plugin (Rcpp 0.10.3 or later)
// [[Rcpp::plugins(cpp11)]]
using namespace std;
using namespace Rcpp; // for sourceCpp to work, this line must be uncommented
// [[Rcpp::export]]
int main() {
long maxp = 1000000; // max value
pari_init(500000,2); // initiate pari
size_t …Run Code Online (Sandbox Code Playgroud)