我正在尝试从 R 中运行 Eurequa。 http://code.google.com/p/eureqa-api/ 我正在使用下面的代码,但出现编译错误:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created!
library(Rcpp)
library(inline)
rcpp1 <- '
int main(int argc, char *argv[])
{
// initialize data set and options
eureqa::data_set data("abc1.txt");
eureqa::search_options options("y = f(x)");
// connect to a eureqa server
eureqa::connection conn("127.0.0.1");
conn.send_data_set(data);
conn.send_options(options);
conn.start_search();
// display results
eureqa::search_progress progress;
eureqa::solution_frontier solutions;
while (conn.query_progress(progress))
{
solutions.add(progress.solution_);
std::cout << progress.summary() << std::endl;
std::cout << solutions.to_string() << std::endl;
}
return 0;
}
'
rcpp2 <- cxxfunction(
rcpp1, plugin="Rcpp",
includes=c('#include <eureqa/eureqa.h>, <iostream>'))
rcpp2()
我会很感激你的帮助。