Skip to content

Commit

Permalink
- fix validation of coefficient
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Sep 15, 2023
1 parent 5a54f15 commit 876212b
Show file tree
Hide file tree
Showing 22 changed files with 25 additions and 24 deletions.
7 changes: 4 additions & 3 deletions src/sbml/packages/fbc/sbml/UserDefinedConstraintComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1254,13 +1254,14 @@ UserDefinedConstraintComponent::readL3V1V3Attributes(const XMLAttributes&
//

numErrs = log ? log->getNumErrors() : 0;
assigned = attributes.readInto("coefficient", mCoefficient);
XMLTriple tripleCOEFF("coefficient", mURI, getPrefix());
assigned = attributes.readInto(tripleCOEFF, mCoefficient);

if (assigned == true)
{
if (mId.empty() == true)
if (mCoefficient.empty() == true)
{
logEmptyString(mCoefficient, level, version, "<UserDefinedConstraintComponent>");
logEmptyString("coefficient", level, version, "<UserDefinedConstraintComponent>");
}
else if (SyntaxChecker::isValidSBMLSId(mCoefficient) == false)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent metaid="_udc1" fbc:id="dd" fbc:name="string" sboTerm="SBO:0000001" fbc:coefficient="string" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent metaid="_udc1" fbc:id="dd" fbc:name="string" sboTerm="SBO:0000001" fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent metaid="_udc1" sboTerm="SBO:0000001" fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear">
<fbc:userDefinedConstraintComponent metaid="_udc1" sboTerm="SBO:0000001" fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear">
</fbc:userDefinedConstraintComponent>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent metaid="_udc1" sboTerm="SBO:0000001" fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear">
<fbc:userDefinedConstraintComponent metaid="_udc1" sboTerm="SBO:0000001" fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear">
<annotation/>
</fbc:userDefinedConstraintComponent>
</fbc:listOfUserDefinedConstraintComponents>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent metaid="_udc1" fbc:id="dd" fbc:upperBound="string" sboTerm="SBO:0000001" fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent metaid="_udc1" fbc:id="dd" fbc:upperBound="string" sboTerm="SBO:0000001" fbc:coefficient="uc2ub2" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent metaid="_udc1" fbc:id="dd" fbc:name="string" sboTerm="SBO:0000001" fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent metaid="_udc1" fbc:id="dd" fbc:name="string" sboTerm="SBO:0000001" fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent fbc:coefficient="2" fbc:variable="RNot" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent fbc:coefficient="uc2ub" fbc:variable="RNot" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent fbc:coefficient="2" fbc:variable="P1" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent fbc:coefficient="uc2ub" fbc:variable="P1" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent fbc:coefficient="2" fbc:variable="P1" fbc:variableType="wrong"/>
<fbc:userDefinedConstraintComponent fbc:coefficient="uc2ub" fbc:variable="P1" fbc:variableType="wrong"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent fbc:coefficient="2" fbc:variable="P1" fbc:variableType="quadratic"/>
<fbc:userDefinedConstraintComponent fbc:coefficient="uc2ub" fbc:variable="P1" fbc:variableType="quadratic"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent metaid="_udc1" sboTerm="SBO:0000001" fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent metaid="_udc1" sboTerm="SBO:0000001" fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent metaid="_udc1" sboTerm="SBO:0000001" fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent metaid="_udc1" sboTerm="SBO:0000001" fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent metaid="_udc1" sboTerm="SBO:0000001" fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent metaid="_udc1" sboTerm="SBO:0000001" fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<annotation/>
<fbc:listOfUserDefinedConstraintComponents>

<fbc:userDefinedConstraintComponent metaid="_udc1" sboTerm="SBO:0000001" fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent metaid="_udc1" sboTerm="SBO:0000001" fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<fbc:listOfUserDefinedConstraintComponents metaid="__hhh" unitt="mole">

<fbc:userDefinedConstraintComponent metaid="_udc1" sboTerm="SBO:0000001" fbc:coefficient="2" fbc:variable="R2" fbc:variableType="linear"/>
<fbc:userDefinedConstraintComponent metaid="_udc1" sboTerm="SBO:0000001" fbc:coefficient="uc2ub" fbc:variable="R2" fbc:variableType="linear"/>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
Expand Down

0 comments on commit 876212b

Please sign in to comment.