From: Chris J. M. <my...@ec...> - 2014-03-25 22:56:14
|
What do you mean by ragged? I don't think we can express this in the data model. The current data model just allows one size per dimension. I think 3-dimensions (or more) is easy in the data model, you just have more dimensions each with a size. I don't see this as a vector of vector of vectors. I see this as 3-dimensional matrix. Chris On Mar 25, 2014, at 4:47 PM, Lucian Smith <lp...@uw...> wrote: > On Tue, Mar 25, 2014 at 04:34:22PM -0600, Chris J. Myers wrote: >> I don't envision that we will support both matrices and vectors of vectors. I think we only have one and two dimensional arrays period. We can call the two dimensional arrays vectors of vectors OR matrices, but I would prefer to think of them as one and the same. Indeed, I don't know how we would express a difference in the current proposed arrays data model. > > Well, the MathML is different, and that's what the infix parser > produces. And, as noted, a vector of vectors can be ragged. Do you > want that possibility? Also also, functions like 'transpose' behave > differently if handed a vector vs. being handed a matrix. If you limit > what's present to only one type, you preclude the other behavior. > >> However, I like your vector of vector assignment method below as the way to initialize a matrix (vector of vectors). > > So you would want to make it impossible, in the infix, to produce a > vector of vectors, and instead make it always produce a matrix? I can > do that, but it's non-extendable: if we ever want arrays of more than 2 > dimensions, we will need to have a way of expressing vectors of vectors > of vectors (etc.). > > -Lucian > >> On Mar 25, 2014, at 4:04 PM, Lucian Smith <luc...@gm...> wrote: >> >>> Sounds like a plan, then: I'll use the C/Java syntax for the first pass, and keep in mind a MATLAB option going forward. >>> >>> I have one other question: C and Java don't have matrices, but only have vectors of vectors. The difference is that all the rows of a matrix must have the same dimension, but a vector of vectors might be 'ragged'. >>> >>> Without moving to MATLAB syntax, I can't think of any way syntactically (i.e. with []'s and {}'s) to distinguish between the two situations. What if we created vectors of vectors with []'s and {}'s, then, and if you wanted a matrix, you used it like a function, i.e.: >>> >>> {{1, 2, 3}, {2, 3, 4}, {3, 4, 5} } <--would make a vector of vectors >>> >>> matrix({{1, 2, 3}, {2, 3, 4}, {3, 4, 5} }) <--would make a matrix >>> >>> or: >>> >>> matrix({1, 2, 3}, {2, 3, 4}, {3, 4, 5}) <--would make a matrix >>> >>> Would we want to allow both syntaxes? i.e. "matrix(X)' would work if X was a vector of vectors, and 'matrix(x, y, z)' would work if x, y, and z were all vectors? And I assume that if you tried to construct a matrix out of a 'ragged' set of vectors, this would be an error, as opposed to being allowed to automatically fill in the blanks with zeroes? >>> >>> -Lucian >>> >>> >>> >>> On Tue, Mar 25, 2014 at 2:24 PM, Chris J. Myers <my...@ec...> wrote: >>> I also think we should focus on C/Java syntax first. I also agree that having a Matlab format option may be nice in the future as I agree that modelers likely are more familiar with that. However, I expect that we would need to look at all choices in format up to this point to make sure they are consistent with Matlab syntax. They may be. Matlab is similar to C/Java but it is just different enough to always confuse me :-). >>> >>> Chris >>> >>> On Mar 25, 2014, at 3:12 PM, Michael Hucka <mh...@ca...> wrote: >>> >>>> On Tue, 25 Mar 2014 14:09:13 -0700, Lucian Smith wrote: >>>>> So, let's get a back-and-forth translator for the C/Java syntax up and >>>>> running, and then I'll see about an alternate for MATLAB? I feel like a >>>>> MATLAB syntax might be really useful for actual modelers; we're all >>>>> programmers here, so are somewhat biased. But I have no actual modelers to >>>>> point to who I know would like it; it's just my sense, based on the >>>>> preponderance of MATLAB models in the literature. >>>> >>>> Agreed. >>>> >>>> There wouldn't need to be a switch/option for the formats at this point, until such time as an alternative is implemented. >>>> >>>> MH >>>> >>>> ------------------------------------------------------------------------------ >>>> Learn Graph Databases - Download FREE O'Reilly Book >>>> "Graph Databases" is the definitive new guide to graph databases and their >>>> applications. Written by three acclaimed leaders in the field, >>>> this first edition is now available. Download your free book today! >>>> http://p.sf.net/sfu/13534_NeoTech >>>> _______________________________________________ >>>> sbml-arrays mailing list >>>> sbm...@li... >>>> https://lists.sourceforge.net/lists/listinfo/sbml-arrays >>> >>> >>> ------------------------------------------------------------------------------ >>> Learn Graph Databases - Download FREE O'Reilly Book >>> "Graph Databases" is the definitive new guide to graph databases and their >>> applications. Written by three acclaimed leaders in the field, >>> this first edition is now available. Download your free book today! >>> http://p.sf.net/sfu/13534_NeoTech >>> _______________________________________________ >>> sbml-arrays mailing list >>> sbm...@li... >>> https://lists.sourceforge.net/lists/listinfo/sbml-arrays >>> >>> ------------------------------------------------------------------------------ >>> Learn Graph Databases - Download FREE O'Reilly Book >>> "Graph Databases" is the definitive new guide to graph databases and their >>> applications. Written by three acclaimed leaders in the field, >>> this first edition is now available. Download your free book today! >>> http://p.sf.net/sfu/13534_NeoTech_______________________________________________ >>> sbml-arrays mailing list >>> sbm...@li... >>> https://lists.sourceforge.net/lists/listinfo/sbml-arrays >> > >> ------------------------------------------------------------------------------ >> Learn Graph Databases - Download FREE O'Reilly Book >> "Graph Databases" is the definitive new guide to graph databases and their >> applications. Written by three acclaimed leaders in the field, >> this first edition is now available. Download your free book today! >> http://p.sf.net/sfu/13534_NeoTech >> _______________________________________________ >> sbml-arrays mailing list >> sbm...@li... >> https://lists.sourceforge.net/lists/listinfo/sbml-arrays > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/13534_NeoTech > _______________________________________________ > sbml-arrays mailing list > sbm...@li... > https://lists.sourceforge.net/lists/listinfo/sbml-arrays |