From: <lea...@us...> - 2015-09-25 16:21:12
|
Revision: 2362 http://sourceforge.net/p/jsbml/code/2362 Author: leandrohw Date: 2015-09-25 16:21:10 +0000 (Fri, 25 Sep 2015) Log Message: ----------- Added a piece of code that handles the issue of having x +- y in the flattening code. Modified Paths: -------------- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java 2015-09-24 00:47:29 UTC (rev 2361) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java 2015-09-25 16:21:10 UTC (rev 2362) @@ -2346,7 +2346,7 @@ return dummy; } - + /** * * @param left @@ -3168,9 +3168,25 @@ plus(negValues); + ASTNode plus = getNode(); + ASTNode minus = new ASTNode(ASTNode.Type.MINUS); + if(plus.getChildCount() > 0) { + minus.addChild(plus.getChild(0)); + + for(int i = 1; i < plus.getChildCount(); i++) + { + if(plus.getChild(i).getType() == ASTNode.Type.MINUS && plus.getChild(i).getChildCount() == 1) + { + minus.addChild(plus.getChild(i).getChild(0)); + } + } + + setNode(minus); + } return dummy; } + /* (non-Javadoc) * @see org.sbml.jsbml.util.compilers.ASTNodeCompiler#neq(org.sbml.jsbml.ASTNode, org.sbml.jsbml.ASTNode) */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |