In this example we add a function to the tree (including a pointer to the arguments). This includes the definition of the class TreeData, which is stored as args in the Tree object.
#include <iostream>
#include <vector>
#include "../include/pruner.hpp"
class TreeData {
int nnodes;
public:
~TreeData() {};
TreeData(int n): nnodes(n) {};
int get_nnodes() {return this->nnodes;};
void set_nnodes(int n) {
this->nnodes = n;
return;
};
};
void myfunction(
TreeData * a,
printf(
"Currently sitting on the node %i.\nCurrent parents are: ", iter.
id());
printf(" %i", *i);
}
printf("\n");
printf(
"Currently sitting on the node %i.\nCurrent parents are: ", iter.
id());
printf(" %i", *i);
}
printf("\n");
return;
}
int main () {
tree.
args =
new TreeData(1);
tree.
args->set_nnodes(5);
return 0;
}