Displaying 1 result from an estimated 1 matches for "fittree".
2000 Sep 07
1
Calloc() & Free() in different .C(.) calls --> not usable ?
...nd I don't know how big the tree will be, but I want the tree
(as integer array in my case) be passed back to R.
Current solution [simplified!]:
## First I fit the tree to my Data, all in C, but only return the *size*
## I'll need to store that tree in R
size <- .C("fittree", data, ..., res = integer(1))$res
## Now that I know its size, I can get it into R :
tree.in.R <- .C("gettree", size, res = integer(size))$res
where in the C code, I have a
global
static *tree_struct my_tree;
and in C's fittree(), I use
my_tree = Calloc(1, tree_s...