#include #include "embed_octave.h" void myeval(const char *string) { std::cout << "Eval <" << string << ">\n"; call_octave(string); call_octave("disp('---------------------------');"); } int main(int argc, char *argv[]) { // Puts error output into file //std::ofstream err("cerr.txt"); //std::cerr.rdbuf(err.rdbuf()); // Puts non-error output into file //std::ofstream err("cout.txt"); //octave_stdout.rdbuf(err.rdbuf()); init_octave(argc, argv); myeval("x = [ones(10,1), rand(10,2)]; y = round(20*rand(10,1)); theta = rand(3 ,1); obj=Poisson(theta, list(y,x))"); return 0; }