On Saturday, March 1, 2008 at 07:15:12 (-0600) Maurice LeBrun writes: > On Friday, February 29, 2008 at 10:46:02 (+0000) Andrew Ross writes: > > ... > > The reason (not an excuse!) that these functions are not documented is > > that they are not part of our common API. They are only used in the C > > examples and are provided as a convenience. Plplot just uses standard C > > 2-d arrays. You can allocate and free these yourself using malloc / > > free if you like. Of course other languages have their own way of > > allocating arrays and so don't need these functions for the other > > bindings. > > A caveat: these are not quite the same thing as "standard C 2-d arrays", > that is if you mean the result of: > > PLFLT f[nx][ny]; > > These are a poor substitute for a real type, which should either know its > dimensions or at least be addressable without carrying extra baggage along.
Sorry for the misuse of English. From this point on I am talking about plAlloc2dGrid() style storage only. > So instead of an array of pointers to PLFLT, this is an array of an array of > pointers to PLFLT (right about now the Fortran folks are probably > shuddering). > > While convenient, it's also a lousy data storage layout for high-speed trips > through an inner loop due to stride issues. No problem -- store the data > however you want in your code for maximum efficiency, and then copy it to one > of these plAlloc2dGrid style arrays when getting ready to plot. Or use one > of > the function evaluator approaches to lookup your data in its native format. > > * plAlloc2dGrid() > * > * Allocates a block of memory for use as a 2-d grid of PLFLT's. > * Resulting array can be indexed as f[i][j] anywhere. This is to be used > * instead of PLFLT f[nx][ny], which is less useful. Note that this type > * of allocation is required by the PLplot functions which take a 2-d > * grids of PLFLT's as an argument, such as plcont() and plot3d(). > * Example usage: > * > * PLFLT **z; > * > * Alloc2dGrid(&z, XPTS, YPTS); > > > Having said that, we should document them. Thanks for pointing this out. > > > > Andrew > > -- > Maurice LeBrun > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Plplot-general mailing list > Plplot-general@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/plplot-general -- Maurice LeBrun ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Plplot-general mailing list Plplot-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-general