On 2016-01-19 07:50-0000 Arjen Markus wrote: > Hi Alan, > > > >> -----Original Message----- >> From: Alan W. Irwin [mailto:ir...@beluga.phys.uvic.ca] >> Sent: Tuesday, January 19, 2016 4:47 AM >> To: PLplot development list >> Subject: [Plplot-devel] Redacted dimension arguments >> ..., I came up with the following cunning plan.... >> >> My new plan for handling redacted dimension arguments for the Fortran >> binding is >> simply to calculate n as the minimum dimension of the associated arrays with >> the >> only sanity check imposed on our users being that the resulting n > 0. I >> think this >> way of handling things is a good one because it still gives the users some >> type of >> plot (and no memory management issues) even if they screw up and have one >> associated array inadvertently shorter than the rest. >>
> I agree on this wrt one-dimensional arrays that are passed, but for two-dimensional arrays there is a slight complication with this scheme. Thinking out loud here ... > Suppose the user passes arrays x(10,10) and y(20,20) to a contouring routine, then the most consistent way for the wrapping routine to pass these two arrays would be to take an array section: x(1:10,1:10) and y(1:10,1:10). Hm, that could be done easily with Fortran - since the C routine has no notion of non-contiguous array sections, the interfacing features will transform it into a temporary array that is contiguous. No copying back is required as the arguments are intent(in). > Okay, this should work Hi Arjen: Thanks for this additional discussion of the 2D case. I agree with your conclusion. > - provided it can be done for other bindings in the same way. I believe each language should be moved to less constrained rules for dimensions of arrays independently of the rest of the languages. I also think such a project would be pretty straightforward for any language binding written in C or C++ (e.g., all our swig-generated bindings). I don't know a lot about some of our other language binding methods, but hopefully some method can be found to move to the less constrained rules when someone takes a look. > Your remark about the Tcl binding not using redacted dimension arguments triggered me look at it again. The current bindings use the matrix data type to store the values and that type does actually keep track of the dimensions, so with a twist to that binding, we can get the same benefits. That would be great. And if we could get the C++ enthusiasts on side as well, that would mean all our bindings would be redacted. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel