From: Chris J. M. <my...@ec...> - 2013-04-04 22:33:38
|
Hi Stuart, Thanks for the feedback. I do apologize about its rough state. I was planning to use it just as a conversation starter then work out the details when there was some broad agreement. It is basically a combination of parts of the old proposals and discussions that we have had at recent meetings. > > I've been through spec and I have to say I found it a bit confusing. I'm not at all clear how the index class is supposed to work. Sorry. > The idea of the index class is to allow one to index into an array in an assignment. The example on page 7 and 8 is doing the following: for (i=1; i < n; i++) { y(11-i) = x(i) } (sorry the "m" should have been an "n") Therefore, the index is being used as the math to calculate the array index for the element being assigned to. Is this more clear? > It might be worth expanding some of the explanations and annotating the examples inline (I use <!-- XML comments for that -->). Also being explicit about the package namespace will help make it clear what is array package markup and what is core. > Good points. > I took a look at the Shapiro proposal and I couldn't work out how much of it you reuse. It seems to me that the explicit array definitions and references are broadly OK and could be pretty much re-used as is. You changed the dimensions element. Was there a reason? The implicit stuff seems nice to me, but probably too complex for an initial implementation. > We stuck primarily with the explicit stuff with some modifications to fix some issues we found during our discussions. I agree the implicit stuff seems nice but a bit tricky for version one, we thought. We changed from lower limit and upper limit to just having one size term during one of our discussions. I don't recall the rationale (does anyone else?). I don't think it is a big deal either way. Perhaps, it was simply that having one value is simpler and more like many programming languages. > Anyway those are my limited thoughts so far. > Thanks again. > One other question is how would it work with libSBML? For example since parameters are of type double in the core how do get the values of parameters that are arrays types? The method Parameter::getValue() const returns a double. Presumably it would need to be modified to return a pointer to an array of arbitrary dimensions? The getValue() method is returning a field in SBML core which is still a single value. Therefore, it would still return a single value. If you want the elements of your array to have different values, then you will need to use an initial assignment or other mechanism to change there values. Remember though that values of parameters during a simulation are NOT stored in libsbml. The simulator must create their own data structures to store these values as they evolve. The actual libsbml support would simply be some get/set functions for indices and dimensions. The objects that need these to be added to them are listed on the document. Please let me know if you have further confusions and/or you see any problems with this being able to work with distributions. Cheers, Chris |