From bug-request at octave dot org Mon Apr 17 05:40:46 2006 Subject: Re: CVS Compilation with PGI compiler From: Paul Kienzle To: "John W. Eaton" Cc: "bug at octave dot org mailing list" Date: Mon, 17 Apr 2006 06:39:13 -0400 On Apr 16, 2006, at 6:45 PM, John W. Eaton wrote: > On 16-Apr-2006, Paul Kienzle wrote: > > | I believe it is the latter and use of OCTAVE_LOCAL_BUFFER in > | octave and octave-forge should be considered cruft. > > OCTAVE_LOCAL_BUFFER has been unconditionaly using std::vector for some > time now and I haven't seen any complaints about it, so I think we can > start to eliminate the macro. But now I'm wondering about whether it > is actually valid to do the pointer trick we have used above to access > the elements of the array. Is that guaranteed to work? It doesn't > seem to for std::vector, so maybe we should take another look > at the code that uses the OCTAVE_LOCAL_BUFFER macro. I haven't read the standard, but comments in various groups indicate that vector neighbours in the new standard are required to be contiguous, so the pointer trick will indeed work. Others have suggested that valarray is the correct class to use since it should be designed to returned aligned storage on numeric types which can be important for performance on some platforms. Again, I don't know what the standard says about this. - Paul ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------