help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fast copy of buffer data into a matrix


From: John Swensen
Subject: Re: Fast copy of buffer data into a matrix
Date: Fri, 09 Feb 2007 08:55:44 -0500
User-agent: Thunderbird 2.0a1 (X11/20060807)

Muthiah Annamalai wrote:
I think theres something like a
double *val = ret_img.fortran_vec(); // in this case for Matrix,
what I gather from looking at liboctave/Marray2.cc|h &
liboctave/MArray-defs.h (where operator macros live).

-Muthiah

I have searched around a bit, but can't find a way of just doing a memcpy into the Matrix object, rather than my slow existing implementation. Any suggestions?

John Swensen
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave
FYI, here is how I ended up copying a unsigned char buffer into a Matrix of type uint8. It ended up taking about 50% of the time of doing it element by element.

static Matrix m1(settings.width, settings.height);
static uint8NDArray m = octave_value(m1).uint8_array_value();
static octave_uint8* tmp = m.fortran_vec();
memcpy( tmp, capturebuffer, settings.height*settings.width );
return octave_value(m.transpose()); As a side note, when using mkoctfile with the -p option, is there any way to get a complete list of all the include flags and all the ld flags? I need to link with a static library and mkoctfile won't allow me to specify a 'libfoo.a' file in the list of object files. So, I need to build the link up and would like to use 'mkoctfile -p', but don't want to have it start looking like 'mkoctfile -p LDFLAGS LD_CXX LD_STATIC_FLAG LIBS LFLAGS LIBCRUFT LIBOCTAVE LIBOCTINTERP ETC'

John Swensen


reply via email to

[Prev in Thread] Current Thread [Next in Thread]