[racket] making flvector with C API?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Sep 29 09:11:12 EDT 2011

There's a 

  Scheme_Double_Vector *scheme_alloc_flvector(intptr_t size);

function internally, and I'll add it to the DLL exports and
documentation. Use it like this:

  Scheme_Double_Vector *dv;

  dv = scheme_alloc_flvector(100);

  /* initialization: */
  for (i = 0; i < 100; i++) {
    SCHEME_FLVEC_ELS(dv)[i] = 0.0;

At Wed, 28 Sep 2011 20:31:19 -0600, Jay Kominek wrote:
> I've got a little numerical routine in C that I'm calling from Racket;
> I started out with passing in normal vectors, but then I dug through
> the Racket source and found the macros necessary to handle flvectors,
> and switched to that. Seemed to speed things up. I'd like to finish
> the conversion, and return an flvector from my function, but there
> doesn't seem to be a "scheme_make_flvector", like
> "scheme_make_vector". Am I missing it? Does it have a different name?
> Can I kludge my way to it? Could it be added/exported? Do I not
> actually want to do this?
> (I could of course modify in place an flvector provided by the caller,
> but that isn't as satisfying.)
> Thanks!
> -- 
> Jay Kominek

Posted on the users mailing list.