Monday, June 2, 2014

Weekly Log: May 26 - June 1

For the past week, I have been playing with the math for the arrays package. To fully incorporate the math into JSBML, two steps are needed: implement the functions/types in JSBML and the infix parsing of the math. The math extension for the arrays package is the following:

constructors: vector
element referenced operator: selector
qualifier components: bvar, lowlimit, uplimit, condition
sum product operators: sum, product
quantifier operators: forall, exists
statistics operators: mean, sdev, variance, median, mode, moment, moment about

Right now I am going to focus on vector and selector, and the remaining math is for future releases. Vector, as the name suggests, is used to create a vector. In JSBML, a vector node is a collection of ordered ASTNodes. In order to get an element in an array or vector, the selector function is necessary.  The selector function takes an array/vector and the index math to reference a certain element.

Vector and selector are implemented already. Selector was done by one of the mentors, Nico Rodriguez. I have done the vector. To create a vector ASTNode, you can specify vector(0, 1, 2, 3, 4, 5) and this in MathML is equivalent to:

    <cn type="integer"> 0 </cn>
    <cn type="integer"> 1 </cn>
    <cn type="integer"> 2 </cn>
    <cn type="integer"> 3 </cn>
    <cn type="integer"> 4 </cn>

The vector constructor was tested and it seems to be working fine. Once I got this to work, I moved on to infix parsing. The code is there already, but it needs more testing. More details to come.

No comments:

Post a Comment