Re: [R] Problem with C extension

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri 19 Jan 2007 - 17:50:53 GMT

This is a programming question, and I am sending a solution to R-devel (please see the posting guide).

On Fri, 19 Jan 2007, Markus Schmidberger wrote:

> Hello,
>
> I try to write an extension in C, to get a faster functions.
> Therefore I have to add an element (vector) to a vector. The command in
> R is very simple: x = c(x,a)
> But in C I have the problem to reallocate my vector for getting more
> space. Everything I tried, I get a "Segmentation fault".
>
> So, how can I combine two vectors in C and give the result back to R
> (return(x))?
>
> Thanks
> Markus Schmidberger
>
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sat Jan 20 05:06:53 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 19 Jan 2007 - 18:30:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.