You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(121) |
Aug
(343) |
Sep
(98) |
Oct
(55) |
Nov
(158) |
Dec
(219) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(278) |
Feb
(170) |
Mar
(286) |
Apr
(32) |
May
(83) |
Jun
(140) |
Jul
(212) |
Aug
(242) |
Sep
(52) |
Oct
(29) |
Nov
(132) |
Dec
(259) |
| 2010 |
Jan
(251) |
Feb
(147) |
Mar
(76) |
Apr
(140) |
May
(43) |
Jun
(66) |
Jul
(273) |
Aug
(205) |
Sep
(260) |
Oct
(100) |
Nov
(58) |
Dec
(264) |
| 2011 |
Jan
(219) |
Feb
(344) |
Mar
(320) |
Apr
(334) |
May
(125) |
Jun
(131) |
Jul
(195) |
Aug
(155) |
Sep
(55) |
Oct
(261) |
Nov
(286) |
Dec
(216) |
| 2012 |
Jan
(188) |
Feb
(177) |
Mar
(39) |
Apr
(179) |
May
(148) |
Jun
(43) |
Jul
(229) |
Aug
(104) |
Sep
(76) |
Oct
(82) |
Nov
(93) |
Dec
(180) |
| 2013 |
Jan
(323) |
Feb
(335) |
Mar
(35) |
Apr
(220) |
May
(238) |
Jun
(122) |
Jul
(316) |
Aug
(73) |
Sep
(135) |
Oct
(515) |
Nov
(320) |
Dec
(185) |
| 2014 |
Jan
(81) |
Feb
(146) |
Mar
(337) |
Apr
(234) |
May
(112) |
Jun
(239) |
Jul
(323) |
Aug
(123) |
Sep
(83) |
Oct
(285) |
Nov
(321) |
Dec
(96) |
| 2015 |
Jan
(77) |
Feb
(79) |
Mar
(124) |
Apr
(71) |
May
(35) |
Jun
(45) |
Jul
(77) |
Aug
(44) |
Sep
(22) |
Oct
(84) |
Nov
(120) |
Dec
(37) |
| 2016 |
Jan
(38) |
Feb
(74) |
Mar
(242) |
Apr
(153) |
May
(59) |
Jun
(44) |
Jul
(67) |
Aug
(74) |
Sep
(150) |
Oct
(35) |
Nov
(69) |
Dec
(43) |
| 2017 |
Jan
(43) |
Feb
(9) |
Mar
(274) |
Apr
(40) |
May
(81) |
Jun
(81) |
Jul
(87) |
Aug
(46) |
Sep
(98) |
Oct
(50) |
Nov
(220) |
Dec
(66) |
| 2018 |
Jan
(110) |
Feb
(22) |
Mar
(20) |
Apr
(147) |
May
(148) |
Jun
(30) |
Jul
(83) |
Aug
(63) |
Sep
(40) |
Oct
(53) |
Nov
(51) |
Dec
(104) |
| 2019 |
Jan
(14) |
Feb
(81) |
Mar
(80) |
Apr
(102) |
May
(16) |
Jun
(5) |
Jul
(34) |
Aug
(24) |
Sep
(9) |
Oct
(12) |
Nov
(42) |
Dec
(76) |
| 2020 |
Jan
(15) |
Feb
(11) |
Mar
(12) |
Apr
(7) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
|
2
(3) |
3
|
|
4
|
5
(1) |
6
(4) |
7
|
8
|
9
|
10
|
|
11
|
12
|
13
|
14
|
15
(1) |
16
(4) |
17
(1) |
|
18
|
19
(5) |
20
(1) |
21
(2) |
22
|
23
|
24
|
|
25
(3) |
26
(2) |
27
|
28
|
29
(2) |
30
|
31
|
|
From: <sar...@us...> - 2009-10-29 14:50:13
|
Revision: 10226
http://sbml.svn.sourceforge.net/sbml/?rev=10226&view=rev
Author: sarahkeating
Date: 2009-10-29 14:50:00 +0000 (Thu, 29 Oct 2009)
Log Message:
-----------
also works but with fewer multimaps
Modified Paths:
--------------
branches/libsbml-sarah/src/sbml/SBMLAttribute.cpp
branches/libsbml-sarah/src/sbml/SBMLAttribute.h
Modified: branches/libsbml-sarah/src/sbml/SBMLAttribute.cpp
===================================================================
--- branches/libsbml-sarah/src/sbml/SBMLAttribute.cpp 2009-10-29 13:29:45 UTC (rev 10225)
+++ branches/libsbml-sarah/src/sbml/SBMLAttribute.cpp 2009-10-29 14:50:00 UTC (rev 10226)
@@ -37,76 +37,77 @@
{
/* write the map of attributes with double values */
typedef SBMLAttribute<double> dblAtt;
- mDoubleAttributes.insert(
- pair<SBMLTypeCode_t, dblAtt >(SBML_COMPARTMENT, dblAtt(1.0, "size")));
- mDoubleAttributes.insert(
- pair<SBMLTypeCode_t, dblAtt >(SBML_COMPARTMENT,
- dblAtt(3.0, "spatialDimensions")));
- mDoubleAttributes.insert(
- pair<SBMLTypeCode_t, dblAtt >(SBML_UNIT, dblAtt(0.0, "exponent")));
- mDoubleAttributes.insert(
- pair<SBMLTypeCode_t, dblAtt >(SBML_UNIT, dblAtt(1.0, "multiplier")));
- mDoubleAttributes.insert(
- pair<SBMLTypeCode_t, dblAtt >(SBML_SPECIES, dblAtt(0.0, "initialAmount")));
- mDoubleAttributes.insert(
- pair<SBMLTypeCode_t, dblAtt >(SBML_SPECIES,
- dblAtt(0.0, "initialConcentration")));
- mDoubleAttributes.insert(
- pair<SBMLTypeCode_t, dblAtt >(SBML_PARAMETER, dblAtt(0.0, "value")));
- mDoubleAttributes.insert(
- pair<SBMLTypeCode_t, dblAtt >(SBML_SPECIES_REFERENCE,
- dblAtt(1.0, "stoichiometry")));
- mDoubleAttributes.insert(
- pair<SBMLTypeCode_t, dblAtt >(SBML_LOCAL_PARAMETER,
- dblAtt(0.0, "value")));
- /* write the map of attributes with double values */
+ mAttributes.insert(
+ pair<SBMLTypeCode_t, SBMLAttributeMap >
+ (SBML_COMPARTMENT, SBMLAttributeMap("size", dblAtt(1.0))));
+ //mDoubleAttributes.insert(
+ // pair<SBMLTypeCode_t, dblAtt >(SBML_COMPARTMENT,
+ // dblAtt(3.0, "spatialDimensions")));
+ //mDoubleAttributes.insert(
+ // pair<SBMLTypeCode_t, dblAtt >(SBML_UNIT, dblAtt(0.0, "exponent")));
+ //mDoubleAttributes.insert(
+ // pair<SBMLTypeCode_t, dblAtt >(SBML_UNIT, dblAtt(1.0, "multiplier")));
+ //mDoubleAttributes.insert(
+ // pair<SBMLTypeCode_t, dblAtt >(SBML_SPECIES, dblAtt(0.0, "initialAmount")));
+ //mDoubleAttributes.insert(
+ // pair<SBMLTypeCode_t, dblAtt >(SBML_SPECIES,
+ // dblAtt(0.0, "initialConcentration")));
+ //mDoubleAttributes.insert(
+ // pair<SBMLTypeCode_t, dblAtt >(SBML_PARAMETER, dblAtt(0.0, "value")));
+ //mDoubleAttributes.insert(
+ // pair<SBMLTypeCode_t, dblAtt >(SBML_SPECIES_REFERENCE,
+ // dblAtt(1.0, "stoichiometry")));
+ //mDoubleAttributes.insert(
+ // pair<SBMLTypeCode_t, dblAtt >(SBML_LOCAL_PARAMETER,
+ // dblAtt(0.0, "value")));
+
+ /* write the map of attributes with boolean values */
typedef SBMLAttribute<bool> boolAtt;
- mBoolAttributes.insert(
- pair<SBMLTypeCode_t, boolAtt >(SBML_COMPARTMENT,
- boolAtt(true, "constant")));
- mBoolAttributes.insert(
- pair<SBMLTypeCode_t, boolAtt >(SBML_SPECIES,
- boolAtt(false, "constant")));
- mBoolAttributes.insert(
- pair<SBMLTypeCode_t, boolAtt >(SBML_SPECIES,
- boolAtt(false, "hasOnlySubstanceUnits")));
- mBoolAttributes.insert(
- pair<SBMLTypeCode_t, boolAtt >(SBML_SPECIES,
- boolAtt(false, "boundaryCondition")));
- mBoolAttributes.insert(
- pair<SBMLTypeCode_t, boolAtt >(SBML_PARAMETER,
- boolAtt(true, "constant")));
- mBoolAttributes.insert(
- pair<SBMLTypeCode_t, boolAtt >(SBML_REACTION,
- boolAtt(false, "fast")));
- mBoolAttributes.insert(
- pair<SBMLTypeCode_t, boolAtt >(SBML_REACTION,
- boolAtt(false, "reversible")));
- mBoolAttributes.insert(
- pair<SBMLTypeCode_t, boolAtt >(SBML_SPECIES_REFERENCE,
- boolAtt(true, "constant")));
- mBoolAttributes.insert(
- pair<SBMLTypeCode_t, boolAtt >(SBML_EVENT,
- boolAtt(true, "useValuesFromTriggerTime")));
+ mAttributes.insert(
+ pair<SBMLTypeCode_t, SBMLAttributeMap >(SBML_COMPARTMENT,
+ SBMLAttributeMap("constant", boolAtt(true))));
+ //mBoolAttributes.insert(
+ // pair<SBMLTypeCode_t, boolAtt >(SBML_SPECIES,
+ // boolAtt(false, "constant")));
+ //mBoolAttributes.insert(
+ // pair<SBMLTypeCode_t, boolAtt >(SBML_SPECIES,
+ // boolAtt(false, "hasOnlySubstanceUnits")));
+ //mBoolAttributes.insert(
+ // pair<SBMLTypeCode_t, boolAtt >(SBML_SPECIES,
+ // boolAtt(false, "boundaryCondition")));
+ //mBoolAttributes.insert(
+ // pair<SBMLTypeCode_t, boolAtt >(SBML_PARAMETER,
+ // boolAtt(true, "constant")));
+ //mBoolAttributes.insert(
+ // pair<SBMLTypeCode_t, boolAtt >(SBML_REACTION,
+ // boolAtt(false, "fast")));
+ //mBoolAttributes.insert(
+ // pair<SBMLTypeCode_t, boolAtt >(SBML_REACTION,
+ // boolAtt(false, "reversible")));
+ //mBoolAttributes.insert(
+ // pair<SBMLTypeCode_t, boolAtt >(SBML_SPECIES_REFERENCE,
+ // boolAtt(true, "constant")));
+ //mBoolAttributes.insert(
+ // pair<SBMLTypeCode_t, boolAtt >(SBML_EVENT,
+ // boolAtt(true, "useValuesFromTriggerTime")));
}
bool
Functions::getAttributeDefault(SBMLTypeCode_t type, std::string name, double &value)
{
bool retrieved = false;
- if (mDoubleAttributes.empty())
+ if (mAttributes.empty())
Functions::InitialiseAttributes();
-
- for (DoubleAttributeIter ii = mDoubleAttributes.begin(); ii != mDoubleAttributes.end(); ++ii)
+
+ pair<AttributeIter, AttributeIter> range;
+ range = mAttributes.equal_range(type);
+ for (AttributeIter ii = range.first; ii != range.second; ++ii)
{
- if ((*ii).first == type)
+ if ((*ii).second.getName() == name)
{
- if ((*ii).second.getName() == name)
- {
- value = (*ii).second.getDefault();
- retrieved = true;
- }
+ value = (*ii).second.getDoubleAttribute().getDefault();
+ retrieved = true;
}
}
return retrieved;
@@ -116,18 +117,17 @@
Functions::getAttributeDefault(SBMLTypeCode_t type, std::string name, bool &value)
{
bool retrieved = false;
- if (mBoolAttributes.empty())
+ if (mAttributes.empty())
Functions::InitialiseAttributes();
- for (BoolAttributeIter ii = mBoolAttributes.begin(); ii != mBoolAttributes.end(); ++ii)
+ pair<AttributeIter, AttributeIter> range;
+ range = mAttributes.equal_range(type);
+ for (AttributeIter ii = range.first; ii != range.second; ++ii)
{
- if ((*ii).first == type)
+ if ((*ii).second.getName() == name)
{
- if ((*ii).second.getName() == name)
- {
- value = (*ii).second.getDefault();
- retrieved = true;
- }
+ value = (*ii).second.getBoolAttribute().getDefault();
+ retrieved = true;
}
}
return retrieved;
Modified: branches/libsbml-sarah/src/sbml/SBMLAttribute.h
===================================================================
--- branches/libsbml-sarah/src/sbml/SBMLAttribute.h 2009-10-29 13:29:45 UTC (rev 10225)
+++ branches/libsbml-sarah/src/sbml/SBMLAttribute.h 2009-10-29 14:50:00 UTC (rev 10226)
@@ -51,18 +51,18 @@
{
}
- SBMLAttribute(att_type value, std::string name):
- mValue ( value )
- , mDefaultValue ( value )
- , mIsSet ( false )
- , mName ( name )
- {
- }
+ //SBMLAttribute(att_type value, std::string name):
+ // mValue ( value )
+ //, mDefaultValue ( value )
+ //, mIsSet ( false )
+ //, mName ( name )
+ //{
+ //}
SBMLAttribute(att_type value):
mValue ( value )
, mDefaultValue ( value )
, mIsSet ( false )
- , mName ( "" )
+ //, mName ( "" )
{
}
//SBMLAttribute(att_type& value, const att_type& defaultValue):
@@ -139,10 +139,10 @@
}
- std::string getName() const
- {
- return mName;
- }
+ //std::string getName() const
+ //{
+ // return mName;
+ //}
@@ -203,29 +203,211 @@
att_type mValue;
att_type mDefaultValue;
bool mIsSet;
- std::string mName;
+ //std::string mName;
/** @endcond doxygen-libsbml-internal */
};
+class LIBSBML_EXTERN SBMLAttributeMap
+{
+public:
-typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<double> >
- DoubleAttribute;
-typedef DoubleAttribute::iterator DoubleAttributeIter;
-typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<bool> >
- BoolAttribute;
-typedef BoolAttribute::iterator BoolAttributeIter;
-typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<int> >
- IntAttribute;
-typedef IntAttribute::iterator IntAttributeIter;
-typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<std::string> >
- StringAttribute;
-typedef StringAttribute::iterator StringAttributeIter;
+ SBMLAttributeMap()
+ {
+ }
+
+ SBMLAttributeMap(std::string name, SBMLAttribute<double> dblAtt):
+ mName ( name )
+ , mDoubleAttribute ( dblAtt )
+ , mBoolAttribute ( 0 )
+ {
+ }
+
+ SBMLAttributeMap(std::string name, SBMLAttribute<bool> boolAtt):
+ mName ( name )
+ , mDoubleAttribute ( 0 )
+ , mBoolAttribute ( boolAtt )
+ {
+ }
+
+
+ ///**
+ // * Destroys this SBMLAttribute object.
+ // */
+ ~SBMLAttributeMap()
+ {
+ };
+
+
+ /**
+ * Copy constructor; creates a copy of a SBMLAttribute.
+ *
+ * @param orig the SBMLAttribute instance to copy.
+ */
+ //SBMLAttribute(const SBMLAttribute& orig);
+
+
+ ///**
+ // * Assignment operator for SBMLAttribute.
+ // */
+ //SBMLAttribute& operator=(const SBMLAttribute& orig);
+
+
+ ///**
+ // * Creates and returns a deep copy of this SBMLAttribute.
+ // *
+ // * @return a (deep) copy of this SBMLAttribute.
+ // */
+ //SBMLAttribute* clone () const;
+
+
+ //bool compare (SBMLAttribute& object) const;
+
+ /**
+ * Get the SBML Level of this SBMLAttribute object.
+ *
+ * @return the SBML Level of this SBMLAttribute object.
+ */
+ SBMLAttribute<double> getDoubleAttribute()
+ {
+ return mDoubleAttribute;
+ }
+ SBMLAttribute<double> getDoubleAttribute() const
+ {
+ return mDoubleAttribute;
+ }
+ SBMLAttribute<bool> getBoolAttribute()
+ {
+ return mBoolAttribute;
+ }
+ SBMLAttribute<bool> getBoolAttribute() const
+ {
+ return mBoolAttribute;
+ }
+
+// SBMLTypeCode_t getType()
+// {
+// return mType;
+// }
+//
+// SBMLTypeCode_t getType() const
+// {
+// return mType;
+// }
+//
+////
+//
+//
+// /**
+// * Get the SBML Level of this SBMLAttribute object.
+// *
+// * @return the SBML Level of this SBMLAttribute object.
+// */
+// att_type getDefault()
+// {
+// return mDefaultValue;
+// }
+//
+// att_type getDefault() const
+// {
+// return mDefaultValue;
+// }
+//
+//
+ std::string getName() const
+ {
+ return mName;
+ }
+//
+//
+//
+// /**
+// * Get the SBML Version of this SBMLAttribute object.
+// *
+// * @return the SBML Version of this SBMLAttribute object.
+// */
+// bool isSet()
+// {
+// return mIsSet;
+// }
+//
+// bool isSet() const
+// {
+// return mIsSet;
+// }
+////
+//
+// int set(att_type value)
+// {
+// mValue = value;
+// mIsSet = true;
+// return LIBSBML_OPERATION_SUCCESS;
+// }
+//
+// int unset()
+// {
+//// mValue = value;
+// mIsSet = false;
+// return LIBSBML_OPERATION_SUCCESS;
+// }
+//
+// //operator att_type()
+// //{
+// // return mValue;
+ //}
+//private:
+
+ //int setDefault(att_type value)
+ //{
+ // mDefaultValue = value;
+ // return LIBSBML_OPERATION_SUCCESS;
+ //}
+
+ //int init(att_type value)
+ //{
+ // mValue = value;
+ // return LIBSBML_OPERATION_SUCCESS;
+ //}
+
+
+
+protected:
+ /** @cond doxygen-libsbml-internal */
+
+ //SBMLTypeCode_t mType;
+ std::string mName;
+ SBMLAttribute<double> mDoubleAttribute;
+ SBMLAttribute<bool> mBoolAttribute;
+
+ //att_type mValue;
+ //att_type mDefaultValue;
+ //bool mIsSet;
+ //std::string mName;
+
+ /** @endcond doxygen-libsbml-internal */
+};
+
+
+typedef std::multimap<SBMLTypeCode_t, SBMLAttributeMap>
+ Attributes;
+typedef Attributes::iterator AttributeIter;
-static DoubleAttribute mDoubleAttributes;
-static BoolAttribute mBoolAttributes;
-static IntAttribute mIntAttributes;
-static StringAttribute mStringAttributes;
+//typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<bool> >
+// BoolAttribute;
+//typedef BoolAttribute::iterator BoolAttributeIter;
+//typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<int> >
+// IntAttribute;
+//typedef IntAttribute::iterator IntAttributeIter;
+//typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<std::string> >
+// StringAttribute;
+//typedef StringAttribute::iterator StringAttributeIter;
+//
+// StringAttribute;
+//
+static Attributes mAttributes;
+//static BoolAttribute mBoolAttributes;
+//static IntAttribute mIntAttributes;
+//static StringAttribute mStringAttributes;
class LIBSBML_EXTERN Functions
{
@@ -235,6 +417,11 @@
static bool getAttributeDefault(SBMLTypeCode_t type, std::string name, double &value);
static bool getAttributeDefault(SBMLTypeCode_t type, std::string name, bool &value);
+//private:
+//
+// SBMLAttributeMap<double> mDoubleAttributes;
+//SBMLAttributeMap<bool> mBoolAttributes;
+
};
LIBSBML_CPP_NAMESPACE_END
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-29 13:29:56
|
Revision: 10225
http://sbml.svn.sourceforge.net/sbml/?rev=10225&view=rev
Author: sarahkeating
Date: 2009-10-29 13:29:45 +0000 (Thu, 29 Oct 2009)
Log Message:
-----------
fixed so this will build with octave
Modified Paths:
--------------
trunk/SBMLToolbox/src/OutputSBML.c
Modified: trunk/SBMLToolbox/src/OutputSBML.c
===================================================================
--- trunk/SBMLToolbox/src/OutputSBML.c 2009-10-26 17:34:24 UTC (rev 10224)
+++ trunk/SBMLToolbox/src/OutputSBML.c 2009-10-29 13:29:45 UTC (rev 10225)
@@ -22,8 +22,9 @@
*----------------------------------------------------------------------- -->*/
#include <mex.h>
+#ifndef USE_OCTAVE
#include <matrix.h>
-
+#endif
#include <string.h>
#include <sbml/SBMLReader.h>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-26 17:34:43
|
Revision: 10224
http://sbml.svn.sourceforge.net/sbml/?rev=10224&view=rev
Author: sarahkeating
Date: 2009-10-26 17:34:24 +0000 (Mon, 26 Oct 2009)
Log Message:
-----------
deal correctly with 0d compartments
Modified Paths:
--------------
trunk/SBMLToolbox/src/Simulation/AnalyseSpecies.m
trunk/SBMLToolbox/src/Simulation/Test/TestAnalyseSpecies.m
trunk/SBMLToolbox/src/Simulation/WriteODEFunction.m
Modified: trunk/SBMLToolbox/src/Simulation/AnalyseSpecies.m
===================================================================
--- trunk/SBMLToolbox/src/Simulation/AnalyseSpecies.m 2009-10-26 09:54:57 UTC (rev 10223)
+++ trunk/SBMLToolbox/src/Simulation/AnalyseSpecies.m 2009-10-26 17:34:24 UTC (rev 10224)
@@ -76,6 +76,12 @@
Species(i).initialValue = Values(i);
if (SBMLModel.SBML_level == 2)
+ comp = Model_getCompartmentById(SBMLModel, SBMLModel.species(i).compartment);
+ if (comp.spatialDimensions == 0)
+ Species(i).is0Dcompartment = 1;
+ else
+ Species(i).is0Dcompartment = 0;
+ end;
if (SBMLModel.species(i).isSetInitialConcentration == 0 ...
&& SBMLModel.species(i).isSetInitialAmount == 0)
% value is set by rule/assignment thus will be concentration
Modified: trunk/SBMLToolbox/src/Simulation/Test/TestAnalyseSpecies.m
===================================================================
--- trunk/SBMLToolbox/src/Simulation/Test/TestAnalyseSpecies.m 2009-10-26 09:54:57 UTC (rev 10223)
+++ trunk/SBMLToolbox/src/Simulation/Test/TestAnalyseSpecies.m 2009-10-26 17:34:24 UTC (rev 10224)
@@ -107,6 +107,7 @@
output_2(1).constant = 0;
output_2(1).boundaryCondition = 0;
output_2(1).initialValue = 0.0300;
+output_2(1).is0Dcompartment = 0;
output_2(1).isConcentration = 0;
output_2(1).compartment = 'compartment';
output_2(1).ChangedByReaction = 1;
@@ -124,6 +125,7 @@
output_2(2).constant = 0;
output_2(2).boundaryCondition = 0;
output_2(2).initialValue = 0;
+output_2(2).is0Dcompartment = 0;
output_2(2).isConcentration = 0;
output_2(2).compartment = 'compartment';
output_2(2).ChangedByReaction = 1;
@@ -141,6 +143,7 @@
output_2(3).constant = 0;
output_2(3).boundaryCondition = 0;
output_2(3).initialValue = 7;
+output_2(3).is0Dcompartment = 0;
output_2(3).isConcentration = 1;
output_2(3).compartment = 'compartment';
output_2(3).ChangedByReaction = 0;
@@ -158,6 +161,7 @@
output_2(4).constant = 0;
output_2(4).boundaryCondition = 0;
output_2(4).initialValue = 0;
+output_2(4).is0Dcompartment = 0;
output_2(4).isConcentration = 0;
output_2(4).compartment = 'compartment';
output_2(4).ChangedByReaction = 0;
@@ -175,6 +179,7 @@
output_2(5).constant = 0;
output_2(5).boundaryCondition = 0;
output_2(5).initialValue = 0;
+output_2(5).is0Dcompartment = 0;
output_2(5).isConcentration = 0;
output_2(5).compartment = 'compartment';
output_2(5).ChangedByReaction = 1;
@@ -197,6 +202,7 @@
output(1).constant = 0;
output(1).boundaryCondition = 1;
output(1).initialValue = 0;
+output(1).is0Dcompartment = 0;
output(1).isConcentration = 0;
output(1).compartment = 'c';
output(1).ChangedByReaction = 0;
@@ -214,6 +220,7 @@
output(2).constant = 0;
output(2).boundaryCondition = 0;
output(2).initialValue = 0;
+output(2).is0Dcompartment = 0;
output(2).isConcentration = 0;
output(2).compartment = 'c';
output(2).ChangedByReaction = 1;
@@ -237,6 +244,7 @@
output_3(1).constant = 0;
output_3(1).boundaryCondition = 0;
output_3(1).initialValue = 0.026;
+output_3(1).is0Dcompartment = 0;
output_3(1).isConcentration = 1;
output_3(1).compartment = 'cell';
output_3(1).ChangedByReaction = 1;
@@ -255,6 +263,7 @@
output_3(2).constant = 0;
output_3(2).boundaryCondition = 0;
output_3(2).initialValue = 0.013;
+output_3(2).is0Dcompartment = 0;
output_3(2).isConcentration = 1;
output_3(2).compartment = 'cell';
output_3(2).ChangedByReaction = 0;
@@ -277,6 +286,7 @@
output_4(1).constant = 0;
output_4(1).boundaryCondition = 0;
output_4(1).initialValue = 0;
+output_4(1).is0Dcompartment = 0;
output_4(1).isConcentration = 0;
output_4(1).compartment = 'a';
output_4(1).ChangedByReaction = 1;
Modified: trunk/SBMLToolbox/src/Simulation/WriteODEFunction.m
===================================================================
--- trunk/SBMLToolbox/src/Simulation/WriteODEFunction.m 2009-10-26 09:54:57 UTC (rev 10223)
+++ trunk/SBMLToolbox/src/Simulation/WriteODEFunction.m 2009-10-26 17:34:24 UTC (rev 10224)
@@ -205,6 +205,8 @@
for i = 1:NumberSpecies
if (Species(i).isConcentration == 1)
fprintf(fileID, '\t%s = %i;\n', char(Species(i).Name), Species(i).initialValue);
+ elseif (Species(i).is0Dcompartment == 1)
+ fprintf(fileID, '\t%s = %i;\n', char(Species(i).Name), Species(i).initialValue);
else
fprintf(fileID, '\t%s = %i/%s;\n', char(Species(i).Name), Species(i).initialValue, Species(i).compartment);
end;
@@ -261,6 +263,8 @@
else
if (Species(i).isConcentration == 1)
fprintf(fileID, '\txdot(%u) = %i;\n', i, Species(i).initialValue);
+ elseif (Species(i).is0Dcompartment == 1)
+ fprintf(fileID, '\txdot(%u) = %i;\n', i, Species(i).initialValue);
else
fprintf(fileID, '\txdot(%u) = %i/%s;\n', i, Species(i).initialValue, Species(i).compartment);
end;
@@ -284,11 +288,11 @@
if (Species(i).ChangedByReaction == 1)
% need to look for piecewise functions
if (isempty(strfind(char(Species(i).KineticLaw), 'piecewise')))
-% if (Species(i).isConcentration == 1)
+ if (Species(i).is0Dcompartment == 0)
Array{i} = sprintf('\txdot(%u) = (%s)/%s;\n', i, char(Species(i).KineticLaw), Species(i).compartment);
-% else
-% Array{i} = sprintf('\txdot(%u) = %s;\n', i, char(Species(i).KineticLaw));
-% end;
+ else
+ Array{i} = sprintf('\txdot(%u) = %s;\n', i, char(Species(i).KineticLaw));
+ end;
else
var = sprintf('xdot(%u)', i);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ajo...@us...> - 2009-10-26 09:55:07
|
Revision: 10223
http://sbml.svn.sourceforge.net/sbml/?rev=10223&view=rev
Author: ajouraku
Date: 2009-10-26 09:54:57 +0000 (Mon, 26 Oct 2009)
Log Message:
-----------
Fixed compilation error due to unrecognized GCC's option "-Wno-long-double"
in Python and Ruby bindings on Snow Leopard (Mac OS X 10.6).
GCC's option "-Wno-long-double" has been removed on Snow Leopard.
Thanks to Jacky Snoep for reporting this problem.
Modified Paths:
--------------
trunk/libsbml/config/makefile-common-vars.mk.in
trunk/libsbml/configure
trunk/libsbml/configure.ac
trunk/libsbml/src/bindings/python/Makefile.in
trunk/libsbml/src/bindings/ruby/Makefile.in
Modified: trunk/libsbml/config/makefile-common-vars.mk.in
===================================================================
--- trunk/libsbml/config/makefile-common-vars.mk.in 2009-10-25 18:17:30 UTC (rev 10222)
+++ trunk/libsbml/config/makefile-common-vars.mk.in 2009-10-26 09:54:57 UTC (rev 10223)
@@ -190,6 +190,7 @@
USE_UNIVBINARY = @USE_UNIVBINARY@
USE_SUN_CC = @USE_SUN_CC@
+HAS_GCC_WNO_LONG_DOUBLE = @HAS_GCC_WNO_LONG_DOUBLE@
AR = @AR@
AWK = awk
Modified: trunk/libsbml/configure
===================================================================
--- trunk/libsbml/configure 2009-10-25 18:17:30 UTC (rev 10222)
+++ trunk/libsbml/configure 2009-10-26 09:54:57 UTC (rev 10223)
@@ -863,6 +863,7 @@
LTCXXCOMPILE
AUTOCONF
ACLOCAL
+HAS_GCC_WNO_LONG_DOUBLE
SWIG_CONFIG_OPT
SWIG
USE_SWIG
@@ -4561,7 +4562,7 @@
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4564 "configure"' > conftest.$ac_ext
+ echo '#line 4565 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -7210,11 +7211,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7213: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7214: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7217: \$? = $ac_status" >&5
+ echo "$as_me:7218: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7500,11 +7501,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7503: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7504: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7507: \$? = $ac_status" >&5
+ echo "$as_me:7508: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7604,11 +7605,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7607: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7608: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7611: \$? = $ac_status" >&5
+ echo "$as_me:7612: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -9968,7 +9969,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9971 "configure"
+#line 9972 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10068,7 +10069,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10071 "configure"
+#line 10072 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12473,11 +12474,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12476: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12477: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12480: \$? = $ac_status" >&5
+ echo "$as_me:12481: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12577,11 +12578,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12580: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12581: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12584: \$? = $ac_status" >&5
+ echo "$as_me:12585: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14160,11 +14161,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14163: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14164: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14167: \$? = $ac_status" >&5
+ echo "$as_me:14168: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14264,11 +14265,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14267: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14268: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14271: \$? = $ac_status" >&5
+ echo "$as_me:14272: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -16475,11 +16476,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16478: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16479: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16482: \$? = $ac_status" >&5
+ echo "$as_me:16483: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16765,11 +16766,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16768: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16769: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16772: \$? = $ac_status" >&5
+ echo "$as_me:16773: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16869,11 +16870,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16872: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16873: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16876: \$? = $ac_status" >&5
+ echo "$as_me:16877: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -19943,6 +19944,59 @@
+
+#
+# Checks whether -Wno-long-double option is supported.
+#
+# (On MacOS X, compilation generates a warning about `long double'
+# with Python and Ruby bindings).
+#
+saved_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="-Wno-long-double"
+{ echo "$as_me:$LINENO: checking whether -Wno-long-double is supported" >&5
+echo $ECHO_N "checking whether -Wno-long-double is supported... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ HAS_GCC_WNO_LONG_DOUBLE=1
+
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+CPPFLAGS=$saved_CPPFLAGS
+
+
# The Lisp language binding has been removed for the time being, because it
# no longer works in recent versions of libSBML.
@@ -26662,6 +26716,7 @@
fi
+
# Root directory
# Translate path for native Windows compilers for use with 'make check'
@@ -27655,10 +27710,10 @@
LTCXXCOMPILE!$LTCXXCOMPILE$ac_delim
AUTOCONF!$AUTOCONF$ac_delim
ACLOCAL!$ACLOCAL$ac_delim
+HAS_GCC_WNO_LONG_DOUBLE!$HAS_GCC_WNO_LONG_DOUBLE$ac_delim
SWIG_CONFIG_OPT!$SWIG_CONFIG_OPT$ac_delim
SWIG!$SWIG$ac_delim
USE_SWIG!$USE_SWIG$ac_delim
-SWIGLIB!$SWIGLIB$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -27700,6 +27755,7 @@
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
+SWIGLIB!$SWIGLIB$ac_delim
SWIGFLAGS!$SWIGFLAGS$ac_delim
SWIG_CPPFLAGS!$SWIG_CPPFLAGS$ac_delim
SWIG_LDFLAGS!$SWIG_LDFLAGS$ac_delim
@@ -27791,7 +27847,7 @@
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
Modified: trunk/libsbml/configure.ac
===================================================================
--- trunk/libsbml/configure.ac 2009-10-25 18:17:30 UTC (rev 10222)
+++ trunk/libsbml/configure.ac 2009-10-26 09:54:57 UTC (rev 10223)
@@ -187,6 +187,25 @@
AC_PATH_PROG([AUTOCONF],[autoconf],[autoconf])
AC_PATH_PROG([ACLOCAL],[aclocal],[aclocal])
+
+#
+# Checks whether -Wno-long-double option is supported.
+#
+# (On MacOS X, compilation generates a warning about `long double'
+# with Python and Ruby bindings).
+#
+saved_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="-Wno-long-double"
+AC_MSG_CHECKING([whether -Wno-long-double is supported])
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([])],
+ [AC_SUBST(HAS_GCC_WNO_LONG_DOUBLE, 1)
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])]
+)
+CPPFLAGS=$saved_CPPFLAGS
+
+
# The Lisp language binding has been removed for the time being, because it
# no longer works in recent versions of libSBML.
@@ -258,6 +277,7 @@
AC_SUBST(USE_SUN_CC, 1)
fi
+
dnl ---------------------------------------------------------------------------
dnl Miscellaneous
dnl ---------------------------------------------------------------------------
Modified: trunk/libsbml/src/bindings/python/Makefile.in
===================================================================
--- trunk/libsbml/src/bindings/python/Makefile.in 2009-10-25 18:17:30 UTC (rev 10222)
+++ trunk/libsbml/src/bindings/python/Makefile.in 2009-10-26 09:54:57 UTC (rev 10223)
@@ -75,7 +75,9 @@
# On MacOS X, compilation generates a warning about `long double'.
ifeq "$(HOST_TYPE)" "darwin"
- extra_CPPFLAGS += -Wno-long-double
+ ifdef HAS_GCC_WNO_LONG_DOUBLE
+ extra_CPPFLAGS += -Wno-long-double
+ endif
endif
extra_LDFLAGS = $(PYTHON_LDFLAGS)
Modified: trunk/libsbml/src/bindings/ruby/Makefile.in
===================================================================
--- trunk/libsbml/src/bindings/ruby/Makefile.in 2009-10-25 18:17:30 UTC (rev 10222)
+++ trunk/libsbml/src/bindings/ruby/Makefile.in 2009-10-26 09:54:57 UTC (rev 10223)
@@ -75,7 +75,9 @@
# On MacOS X, compilation generates a warning about `long double'.
ifeq "$(HOST_TYPE)" "darwin"
- extra_CPPFLAGS += -Wno-long-double
+ ifdef HAS_GCC_WNO_LONG_DOUBLE
+ extra_CPPFLAGS += -Wno-long-double
+ endif
endif
extra_LDFLAGS = $(RUBY_LDFLAGS)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-25 18:17:37
|
Revision: 10222
http://sbml.svn.sourceforge.net/sbml/?rev=10222&view=rev
Author: sarahkeating
Date: 2009-10-25 18:17:30 +0000 (Sun, 25 Oct 2009)
Log Message:
-----------
This is getting there with getDefaultValues
Modified Paths:
--------------
branches/libsbml-sarah/src/sbml/SBMLAttribute.cpp
branches/libsbml-sarah/src/sbml/SBMLAttribute.h
branches/libsbml-sarah/src/sbml/SBase.cpp
branches/libsbml-sarah/src/sbml/SBase.h
Modified: branches/libsbml-sarah/src/sbml/SBMLAttribute.cpp
===================================================================
--- branches/libsbml-sarah/src/sbml/SBMLAttribute.cpp 2009-10-25 15:46:25 UTC (rev 10221)
+++ branches/libsbml-sarah/src/sbml/SBMLAttribute.cpp 2009-10-25 18:17:30 UTC (rev 10222)
@@ -35,12 +35,103 @@
void
Functions::InitialiseAttributes()
{
+ /* write the map of attributes with double values */
typedef SBMLAttribute<double> dblAtt;
mDoubleAttributes.insert(
pair<SBMLTypeCode_t, dblAtt >(SBML_COMPARTMENT, dblAtt(1.0, "size")));
mDoubleAttributes.insert(
- pair<SBMLTypeCode_t, dblAtt >(SBML_COMPARTMENT, dblAtt(3.0, "spatialDimensions")));
+ pair<SBMLTypeCode_t, dblAtt >(SBML_COMPARTMENT,
+ dblAtt(3.0, "spatialDimensions")));
+ mDoubleAttributes.insert(
+ pair<SBMLTypeCode_t, dblAtt >(SBML_UNIT, dblAtt(0.0, "exponent")));
+ mDoubleAttributes.insert(
+ pair<SBMLTypeCode_t, dblAtt >(SBML_UNIT, dblAtt(1.0, "multiplier")));
+ mDoubleAttributes.insert(
+ pair<SBMLTypeCode_t, dblAtt >(SBML_SPECIES, dblAtt(0.0, "initialAmount")));
+ mDoubleAttributes.insert(
+ pair<SBMLTypeCode_t, dblAtt >(SBML_SPECIES,
+ dblAtt(0.0, "initialConcentration")));
+ mDoubleAttributes.insert(
+ pair<SBMLTypeCode_t, dblAtt >(SBML_PARAMETER, dblAtt(0.0, "value")));
+ mDoubleAttributes.insert(
+ pair<SBMLTypeCode_t, dblAtt >(SBML_SPECIES_REFERENCE,
+ dblAtt(1.0, "stoichiometry")));
+ mDoubleAttributes.insert(
+ pair<SBMLTypeCode_t, dblAtt >(SBML_LOCAL_PARAMETER,
+ dblAtt(0.0, "value")));
+ /* write the map of attributes with double values */
+ typedef SBMLAttribute<bool> boolAtt;
+ mBoolAttributes.insert(
+ pair<SBMLTypeCode_t, boolAtt >(SBML_COMPARTMENT,
+ boolAtt(true, "constant")));
+ mBoolAttributes.insert(
+ pair<SBMLTypeCode_t, boolAtt >(SBML_SPECIES,
+ boolAtt(false, "constant")));
+ mBoolAttributes.insert(
+ pair<SBMLTypeCode_t, boolAtt >(SBML_SPECIES,
+ boolAtt(false, "hasOnlySubstanceUnits")));
+ mBoolAttributes.insert(
+ pair<SBMLTypeCode_t, boolAtt >(SBML_SPECIES,
+ boolAtt(false, "boundaryCondition")));
+ mBoolAttributes.insert(
+ pair<SBMLTypeCode_t, boolAtt >(SBML_PARAMETER,
+ boolAtt(true, "constant")));
+ mBoolAttributes.insert(
+ pair<SBMLTypeCode_t, boolAtt >(SBML_REACTION,
+ boolAtt(false, "fast")));
+ mBoolAttributes.insert(
+ pair<SBMLTypeCode_t, boolAtt >(SBML_REACTION,
+ boolAtt(false, "reversible")));
+ mBoolAttributes.insert(
+ pair<SBMLTypeCode_t, boolAtt >(SBML_SPECIES_REFERENCE,
+ boolAtt(true, "constant")));
+ mBoolAttributes.insert(
+ pair<SBMLTypeCode_t, boolAtt >(SBML_EVENT,
+ boolAtt(true, "useValuesFromTriggerTime")));
}
+
+bool
+Functions::getAttributeDefault(SBMLTypeCode_t type, std::string name, double &value)
+{
+ bool retrieved = false;
+ if (mDoubleAttributes.empty())
+ Functions::InitialiseAttributes();
+
+ for (DoubleAttributeIter ii = mDoubleAttributes.begin(); ii != mDoubleAttributes.end(); ++ii)
+ {
+ if ((*ii).first == type)
+ {
+ if ((*ii).second.getName() == name)
+ {
+ value = (*ii).second.getDefault();
+ retrieved = true;
+ }
+ }
+ }
+ return retrieved;
+}
+
+bool
+Functions::getAttributeDefault(SBMLTypeCode_t type, std::string name, bool &value)
+{
+ bool retrieved = false;
+ if (mBoolAttributes.empty())
+ Functions::InitialiseAttributes();
+
+ for (BoolAttributeIter ii = mBoolAttributes.begin(); ii != mBoolAttributes.end(); ++ii)
+ {
+ if ((*ii).first == type)
+ {
+ if ((*ii).second.getName() == name)
+ {
+ value = (*ii).second.getDefault();
+ retrieved = true;
+ }
+ }
+ }
+ return retrieved;
+}
+
LIBSBML_CPP_NAMESPACE_END
Modified: branches/libsbml-sarah/src/sbml/SBMLAttribute.h
===================================================================
--- branches/libsbml-sarah/src/sbml/SBMLAttribute.h 2009-10-25 15:46:25 UTC (rev 10221)
+++ branches/libsbml-sarah/src/sbml/SBMLAttribute.h 2009-10-25 18:17:30 UTC (rev 10222)
@@ -209,22 +209,32 @@
};
-typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<double> > DoubleAttribute;
+typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<double> >
+ DoubleAttribute;
typedef DoubleAttribute::iterator DoubleAttributeIter;
-typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<bool> > BoolAttribute;
+typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<bool> >
+ BoolAttribute;
typedef BoolAttribute::iterator BoolAttributeIter;
-typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<int> > IntAttribute;
+typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<int> >
+ IntAttribute;
typedef IntAttribute::iterator IntAttributeIter;
-typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<std::string> > StringAttribute;
+typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<std::string> >
+ StringAttribute;
typedef StringAttribute::iterator StringAttributeIter;
static DoubleAttribute mDoubleAttributes;
-
+static BoolAttribute mBoolAttributes;
+static IntAttribute mIntAttributes;
+static StringAttribute mStringAttributes;
+
class LIBSBML_EXTERN Functions
{
public:
static void InitialiseAttributes();
+
+ static bool getAttributeDefault(SBMLTypeCode_t type, std::string name, double &value);
+ static bool getAttributeDefault(SBMLTypeCode_t type, std::string name, bool &value);
};
LIBSBML_CPP_NAMESPACE_END
Modified: branches/libsbml-sarah/src/sbml/SBase.cpp
===================================================================
--- branches/libsbml-sarah/src/sbml/SBase.cpp 2009-10-25 15:46:25 UTC (rev 10221)
+++ branches/libsbml-sarah/src/sbml/SBase.cpp 2009-10-25 18:17:30 UTC (rev 10222)
@@ -284,26 +284,21 @@
}
}
-double
-SBase::getDefaultValue(std::string attribute)
+bool
+SBase::readDefaultValue(const char * attribute, double &value)
{
- if (mDoubleAttributes.empty())
- Functions::InitialiseAttributes();
+
+ SBMLTypeCode_t type = this->getTypeCode();
+ return Functions::getAttributeDefault(type, attribute, value);
+}
+bool
+SBase::readDefaultValue(const char * attribute, bool &value)
+{
SBMLTypeCode_t type = this->getTypeCode();
- for (DoubleAttributeIter ii = mDoubleAttributes.begin(); ii != mDoubleAttributes.end(); ++ii)
- {
- if ((*ii).first == type)
- {
- if ((*ii).second.getName() == attribute)
- {
- return (*ii).second.getDefault();
- }
- }
- }
-
+ return Functions::getAttributeDefault(type, attribute, value);
}
/*
* @return the metaid of this SBML object.
Modified: branches/libsbml-sarah/src/sbml/SBase.h
===================================================================
--- branches/libsbml-sarah/src/sbml/SBase.h 2009-10-25 15:46:25 UTC (rev 10221)
+++ branches/libsbml-sarah/src/sbml/SBase.h 2009-10-25 18:17:30 UTC (rev 10222)
@@ -422,7 +422,8 @@
virtual bool compare (const SBase& object) const;
- double getDefaultValue(std::string attribute);
+ bool readDefaultValue(const char * attribute, double& value);
+ bool readDefaultValue(const char * attribute, bool& value);
/**
* Returns the value of the "metaid" attribute of this object.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-25 15:46:39
|
Revision: 10221
http://sbml.svn.sourceforge.net/sbml/?rev=10221&view=rev
Author: sarahkeating
Date: 2009-10-25 15:46:25 +0000 (Sun, 25 Oct 2009)
Log Message:
-----------
looking at creating a multimap of SBMLAttributes
this would mean any attribute was accessible from an SBase *
It seems to be working but for some reason I'm losing the static map !!
Modified Paths:
--------------
branches/libsbml-sarah/src/sbml/Compartment.h
branches/libsbml-sarah/src/sbml/SBMLAttribute.h
branches/libsbml-sarah/src/sbml/SBase.cpp
branches/libsbml-sarah/src/sbml/SBase.h
Added Paths:
-----------
branches/libsbml-sarah/src/sbml/SBMLAttribute.cpp
Modified: branches/libsbml-sarah/src/sbml/Compartment.h
===================================================================
--- branches/libsbml-sarah/src/sbml/Compartment.h 2009-10-25 13:34:26 UTC (rev 10220)
+++ branches/libsbml-sarah/src/sbml/Compartment.h 2009-10-25 15:46:25 UTC (rev 10221)
@@ -436,6 +436,7 @@
* @see isSetSize()
*/
double getSize () const;
+ // double getDefaultSize () const;
/**
Added: branches/libsbml-sarah/src/sbml/SBMLAttribute.cpp
===================================================================
--- branches/libsbml-sarah/src/sbml/SBMLAttribute.cpp (rev 0)
+++ branches/libsbml-sarah/src/sbml/SBMLAttribute.cpp 2009-10-25 15:46:25 UTC (rev 10221)
@@ -0,0 +1,46 @@
+/**
+ * @file SBMLAttribute.cpp
+ * @brief SBMLAttribute class to store level/version and namespace
+ * @author Sarah Keating
+ *
+ * $Id: $
+ * $HeadURL: $
+ *
+ *<!---------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright 2005-2009 California Institute of Technology.
+ * Copyright 2002-2005 California Institute of Technology and
+ * Japan Science and Technology Corporation.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ *----------------------------------------------------------------------- -->
+ */
+
+#include <sbml/SBMLAttribute.h>
+
+/** @cond doxygen-ignored */
+
+using namespace std;
+
+/** @endcond doxygen-ignored */
+
+LIBSBML_CPP_NAMESPACE_BEGIN
+
+void
+Functions::InitialiseAttributes()
+{
+ typedef SBMLAttribute<double> dblAtt;
+ mDoubleAttributes.insert(
+ pair<SBMLTypeCode_t, dblAtt >(SBML_COMPARTMENT, dblAtt(1.0, "size")));
+ mDoubleAttributes.insert(
+ pair<SBMLTypeCode_t, dblAtt >(SBML_COMPARTMENT, dblAtt(3.0, "spatialDimensions")));
+
+}
+LIBSBML_CPP_NAMESPACE_END
+
Modified: branches/libsbml-sarah/src/sbml/SBMLAttribute.h
===================================================================
--- branches/libsbml-sarah/src/sbml/SBMLAttribute.h 2009-10-25 13:34:26 UTC (rev 10220)
+++ branches/libsbml-sarah/src/sbml/SBMLAttribute.h 2009-10-25 15:46:25 UTC (rev 10221)
@@ -30,15 +30,16 @@
#ifndef SBMLAttribute_h
#define SBMLAttribute_h
+#ifdef __cplusplus
#include <sbml/xml/XMLNamespaces.h>
+#include <sbml/SBMLTypeCodes.h>
-#ifdef __cplusplus
+#include <map>
-
LIBSBML_CPP_NAMESPACE_BEGIN
template <typename att_type>
@@ -50,10 +51,18 @@
{
}
+ SBMLAttribute(att_type value, std::string name):
+ mValue ( value )
+ , mDefaultValue ( value )
+ , mIsSet ( false )
+ , mName ( name )
+ {
+ }
SBMLAttribute(att_type value):
mValue ( value )
, mDefaultValue ( value )
, mIsSet ( false )
+ , mName ( "" )
{
}
//SBMLAttribute(att_type& value, const att_type& defaultValue):
@@ -130,7 +139,13 @@
}
+ std::string getName() const
+ {
+ return mName;
+ }
+
+
/**
* Get the SBML Version of this SBMLAttribute object.
*
@@ -188,28 +203,33 @@
att_type mValue;
att_type mDefaultValue;
bool mIsSet;
+ std::string mName;
/** @endcond doxygen-libsbml-internal */
};
-LIBSBML_CPP_NAMESPACE_END
-#endif /* __cplusplus */
+typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<double> > DoubleAttribute;
+typedef DoubleAttribute::iterator DoubleAttributeIter;
+typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<bool> > BoolAttribute;
+typedef BoolAttribute::iterator BoolAttributeIter;
+typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<int> > IntAttribute;
+typedef IntAttribute::iterator IntAttributeIter;
+typedef std::multimap<SBMLTypeCode_t, SBMLAttribute<std::string> > StringAttribute;
+typedef StringAttribute::iterator StringAttributeIter;
+
+static DoubleAttribute mDoubleAttributes;
+class LIBSBML_EXTERN Functions
+{
+public:
-#ifndef SWIG
+ static void InitialiseAttributes();
+};
-LIBSBML_CPP_NAMESPACE_BEGIN
-BEGIN_C_DECLS
+LIBSBML_CPP_NAMESPACE_END
-/*-----------------------------------------------------------------------------
- * See the .cpp file for the documentation of the following functions.
- *---------------------------------------------------------------------------*/
+#endif /* __cplusplus */
-
-END_C_DECLS
-LIBSBML_CPP_NAMESPACE_END
-
-#endif /* !SWIG */
#endif /* SBMLAttribute_h */
Modified: branches/libsbml-sarah/src/sbml/SBase.cpp
===================================================================
--- branches/libsbml-sarah/src/sbml/SBase.cpp 2009-10-25 13:34:26 UTC (rev 10220)
+++ branches/libsbml-sarah/src/sbml/SBase.cpp 2009-10-25 15:46:25 UTC (rev 10221)
@@ -284,7 +284,27 @@
}
}
+double
+SBase::getDefaultValue(std::string attribute)
+{
+ if (mDoubleAttributes.empty())
+ Functions::InitialiseAttributes();
+
+ SBMLTypeCode_t type = this->getTypeCode();
+
+ for (DoubleAttributeIter ii = mDoubleAttributes.begin(); ii != mDoubleAttributes.end(); ++ii)
+ {
+ if ((*ii).first == type)
+ {
+ if ((*ii).second.getName() == attribute)
+ {
+ return (*ii).second.getDefault();
+ }
+ }
+ }
+
+}
/*
* @return the metaid of this SBML object.
*/
Modified: branches/libsbml-sarah/src/sbml/SBase.h
===================================================================
--- branches/libsbml-sarah/src/sbml/SBase.h 2009-10-25 13:34:26 UTC (rev 10220)
+++ branches/libsbml-sarah/src/sbml/SBase.h 2009-10-25 15:46:25 UTC (rev 10221)
@@ -349,6 +349,7 @@
#include <sbml/util/List.h>
#include <sbml/SBMLNamespaces.h>
#include <sbml/SyntaxChecker.h>
+#include <sbml/SBMLAttribute.h>
#ifdef __cplusplus
@@ -420,6 +421,8 @@
virtual bool compare (const SBase& object) const;
+
+ double getDefaultValue(std::string attribute);
/**
* Returns the value of the "metaid" attribute of this object.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-25 13:34:36
|
Revision: 10220
http://sbml.svn.sourceforge.net/sbml/?rev=10220&view=rev
Author: sarahkeating
Date: 2009-10-25 13:34:26 +0000 (Sun, 25 Oct 2009)
Log Message:
-----------
creating a template SBMLAttribute class to store value, default value and boolean determining whether the value has been set by the user
Modified Paths:
--------------
branches/libsbml-sarah/src/sbml/Compartment.cpp
branches/libsbml-sarah/src/sbml/Compartment.h
branches/libsbml-sarah/src/sbml/Makefile.in
branches/libsbml-sarah/src/sbml/test/TestCompartment.c
branches/libsbml-sarah/src/sbml/test/TestReadSBML.cpp
Added Paths:
-----------
branches/libsbml-sarah/src/sbml/SBMLAttribute.h
Modified: branches/libsbml-sarah/src/sbml/Compartment.cpp
===================================================================
--- branches/libsbml-sarah/src/sbml/Compartment.cpp 2009-10-21 15:20:28 UTC (rev 10219)
+++ branches/libsbml-sarah/src/sbml/Compartment.cpp 2009-10-25 13:34:26 UTC (rev 10220)
@@ -33,6 +33,7 @@
#include <sbml/SBMLError.h>
#include <sbml/Model.h>
#include <sbml/Compartment.h>
+#include <sbml/SBMLAttribute.h>
/** @cond doxygen-ignored */
@@ -57,10 +58,19 @@
if (!hasValidLevelVersionNamespaceCombination())
throw SBMLConstructorException();
+ switch (level)
+ {
+ case 2:
+ case 3:
+ mSize.init(numeric_limits<double>::quiet_NaN());
+ mSize.setDefault(1.0);
+ break;
+ }
+
// if level 3 values have no defaults
if (level == 3)
{
- mSize = numeric_limits<double>::quiet_NaN();
+// mSize = numeric_limits<double>::quiet_NaN();
mSpatialDimensionsDouble = numeric_limits<double>::quiet_NaN();
}
}
@@ -80,10 +90,18 @@
if (!hasValidLevelVersionNamespaceCombination())
throw SBMLConstructorException();
+ switch (sbmlns->getLevel())
+ {
+ case 2:
+ case 3:
+ mSize.init(numeric_limits<double>::quiet_NaN());
+ mSize.setDefault(1.0);
+ break;
+ }
// if level 3 values have no defaults
if (sbmlns->getLevel() == 3)
{
- mSize = numeric_limits<double>::quiet_NaN();
+// mSize = numeric_limits<double>::quiet_NaN();
mSpatialDimensionsDouble = numeric_limits<double>::quiet_NaN();
}
}
@@ -192,13 +210,16 @@
// level 3 has no defaults
if (getLevel() < 3)
{
- mSize = 1.0; // Actually, setting L1 volume not
- mIsSetSize = false; // L2 size.
-
unsigned int dims = 3;
setSpatialDimensions(dims);
setConstant(1);
}
+ if (getLevel() == 1)
+ {
+ mSize.set(1.0); // Actually, setting L1 volume not
+ mIsSetSize = false; // L2 size.
+ }
+
}
@@ -283,7 +304,7 @@
double
Compartment::getSize () const
{
- return mSize;
+ return mSize.get();
}
@@ -368,7 +389,7 @@
bool
Compartment::isSetSize () const
{
- return mIsSetSize;
+ return mSize.isSet();//mIsSetSize;
}
@@ -575,9 +596,9 @@
return LIBSBML_UNEXPECTED_ATTRIBUTE;
}
*/
- mSize = value;
- mIsSetSize = true;
- return LIBSBML_OPERATION_SUCCESS;
+ return mSize.set(value);// = value;
+ //mIsSetSize = true;
+ //return LIBSBML_OPERATION_SUCCESS;
}
@@ -718,13 +739,14 @@
int
Compartment::unsetSize ()
{
+ mSize.unset();
if (getLevel() == 1)
{
- mSize = 1.0;
+ mSize.init(1.0);
}
else
{
- mSize = numeric_limits<double>::quiet_NaN();
+ mSize.init(numeric_limits<double>::quiet_NaN());
}
mIsSetSize = false;
@@ -988,8 +1010,11 @@
// size { use="optional" } (L2v1 ->)
//
const string size = (level == 1) ? "volume" : "size";
- mIsSetSize = attributes.readInto(size, mSize, getErrorLog(), false);
+ double temp;
+ mIsSetSize = attributes.readInto(size, temp, getErrorLog(), false);
+ if (mIsSetSize)
+ mSize.set(temp);
//
// units { use="optional" } (L1v1 ->)
//
@@ -1138,10 +1163,10 @@
// volume { use="optional" default="1" } (L1v1, L1v2)
// size { use="optional" } (L2v1->)
//
- if (mIsSetSize)
+ if (mSize.isSet())
{
const string size = (level == 1) ? "volume" : "size";
- stream.writeAttribute(size, mSize);
+ stream.writeAttribute(size, mSize.get());
}
//
Modified: branches/libsbml-sarah/src/sbml/Compartment.h
===================================================================
--- branches/libsbml-sarah/src/sbml/Compartment.h 2009-10-21 15:20:28 UTC (rev 10219)
+++ branches/libsbml-sarah/src/sbml/Compartment.h 2009-10-25 13:34:26 UTC (rev 10220)
@@ -256,6 +256,7 @@
#include <sbml/SBase.h>
#include <sbml/ListOf.h>
+#include <sbml/SBMLAttribute.h>
LIBSBML_CPP_NAMESPACE_BEGIN
@@ -1084,10 +1085,11 @@
std::string mCompartmentType;
unsigned int mSpatialDimensions;
double mSpatialDimensionsDouble;
- double mSize;
+// double mSize;
std::string mUnits;
std::string mOutside;
bool mConstant;
+ SBMLAttribute<double> mSize;
bool mIsSetSize;
bool mIsSetSpatialDimensions;
Modified: branches/libsbml-sarah/src/sbml/Makefile.in
===================================================================
--- branches/libsbml-sarah/src/sbml/Makefile.in 2009-10-21 15:20:28 UTC (rev 10219)
+++ branches/libsbml-sarah/src/sbml/Makefile.in 2009-10-25 13:34:26 UTC (rev 10220)
@@ -61,6 +61,7 @@
Parameter.h \
Reaction.h \
Rule.h \
+ SBMLAttribute.h \
SBMLDocument.h \
SBMLError.h \
SBMLErrorLog.h \
Added: branches/libsbml-sarah/src/sbml/SBMLAttribute.h
===================================================================
--- branches/libsbml-sarah/src/sbml/SBMLAttribute.h (rev 0)
+++ branches/libsbml-sarah/src/sbml/SBMLAttribute.h 2009-10-25 13:34:26 UTC (rev 10220)
@@ -0,0 +1,215 @@
+/**
+ * @file SBMLAttribute.h
+ * @brief SBMLAttribute class to store level/version and namespace
+ * @author Sarah Keating
+ *
+ * $Id: $
+ * $HeadURL: $
+ *
+ *<!---------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright 2005-2009 California Institute of Technology.
+ * Copyright 2002-2005 California Institute of Technology and
+ * Japan Science and Technology Corporation.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ *------------------------------------------------------------------------- -->
+ *
+ * @class SBMLAttribute
+ * @brief Class to store SBML level, version and namespace information.
+ *
+ * @htmlinclude libsbml-not-sbml-warning.html
+ *
+ */
+
+#ifndef SBMLAttribute_h
+#define SBMLAttribute_h
+
+#include <sbml/xml/XMLNamespaces.h>
+
+
+
+#ifdef __cplusplus
+
+
+
+LIBSBML_CPP_NAMESPACE_BEGIN
+
+template <typename att_type>
+class LIBSBML_EXTERN SBMLAttribute
+{
+public:
+
+ SBMLAttribute()
+ {
+ }
+
+ SBMLAttribute(att_type value):
+ mValue ( value )
+ , mDefaultValue ( value )
+ , mIsSet ( false )
+ {
+ }
+ //SBMLAttribute(att_type& value, const att_type& defaultValue):
+ // mValue ( value )
+ //, mDefaultValue ( defaultValue )
+ //, mIsSet ( false )
+ //{
+ //}
+
+
+
+ ///**
+ // * Destroys this SBMLAttribute object.
+ // */
+ //~SBMLAttribute()
+ //{
+ //};
+
+
+ /**
+ * Copy constructor; creates a copy of a SBMLAttribute.
+ *
+ * @param orig the SBMLAttribute instance to copy.
+ */
+ //SBMLAttribute(const SBMLAttribute& orig);
+
+
+ ///**
+ // * Assignment operator for SBMLAttribute.
+ // */
+ //SBMLAttribute& operator=(const SBMLAttribute& orig);
+
+
+ ///**
+ // * Creates and returns a deep copy of this SBMLAttribute.
+ // *
+ // * @return a (deep) copy of this SBMLAttribute.
+ // */
+ //SBMLAttribute* clone () const;
+
+
+ //bool compare (SBMLAttribute& object) const;
+
+ /**
+ * Get the SBML Level of this SBMLAttribute object.
+ *
+ * @return the SBML Level of this SBMLAttribute object.
+ */
+ att_type get()
+ {
+ return mValue;
+ }
+
+ att_type get() const
+ {
+ return mValue;
+ }
+
+
+
+ /**
+ * Get the SBML Level of this SBMLAttribute object.
+ *
+ * @return the SBML Level of this SBMLAttribute object.
+ */
+ att_type getDefault()
+ {
+ return mDefaultValue;
+ }
+
+ att_type getDefault() const
+ {
+ return mDefaultValue;
+ }
+
+
+
+ /**
+ * Get the SBML Version of this SBMLAttribute object.
+ *
+ * @return the SBML Version of this SBMLAttribute object.
+ */
+ bool isSet()
+ {
+ return mIsSet;
+ }
+
+ bool isSet() const
+ {
+ return mIsSet;
+ }
+
+
+ int set(att_type value)
+ {
+ mValue = value;
+ mIsSet = true;
+ return LIBSBML_OPERATION_SUCCESS;
+ }
+
+ int unset()
+ {
+// mValue = value;
+ mIsSet = false;
+ return LIBSBML_OPERATION_SUCCESS;
+ }
+
+ //operator att_type()
+ //{
+ // return mValue;
+ //}
+//private:
+
+ int setDefault(att_type value)
+ {
+ mDefaultValue = value;
+ return LIBSBML_OPERATION_SUCCESS;
+ }
+
+ int init(att_type value)
+ {
+ mValue = value;
+ return LIBSBML_OPERATION_SUCCESS;
+ }
+
+
+
+protected:
+ /** @cond doxygen-libsbml-internal */
+
+
+ att_type mValue;
+ att_type mDefaultValue;
+ bool mIsSet;
+
+ /** @endcond doxygen-libsbml-internal */
+};
+
+LIBSBML_CPP_NAMESPACE_END
+
+#endif /* __cplusplus */
+
+
+#ifndef SWIG
+
+LIBSBML_CPP_NAMESPACE_BEGIN
+BEGIN_C_DECLS
+
+/*-----------------------------------------------------------------------------
+ * See the .cpp file for the documentation of the following functions.
+ *---------------------------------------------------------------------------*/
+
+
+
+END_C_DECLS
+LIBSBML_CPP_NAMESPACE_END
+
+#endif /* !SWIG */
+#endif /* SBMLAttribute_h */
Modified: branches/libsbml-sarah/src/sbml/test/TestCompartment.c
===================================================================
--- branches/libsbml-sarah/src/sbml/test/TestCompartment.c 2009-10-21 15:20:28 UTC (rev 10219)
+++ branches/libsbml-sarah/src/sbml/test/TestCompartment.c 2009-10-25 13:34:26 UTC (rev 10220)
@@ -94,7 +94,8 @@
fail_unless( Compartment_getOutside(C) == NULL );
fail_unless( Compartment_getSpatialDimensions(C) == 3 );
- fail_unless( Compartment_getVolume (C) == 1.0 );
+ fail_unless( isnan(Compartment_getSize (C)) );
+ //fail_unless( Compartment_getVolume (C) == 1.0 );
fail_unless( Compartment_getConstant (C) == 1 );
fail_unless( !Compartment_isSetId (C) );
@@ -120,7 +121,8 @@
fail_unless( Compartment_getOutside(c) == NULL );
fail_unless( Compartment_getSpatialDimensions(c) == 3 );
- fail_unless( Compartment_getVolume (c) == 1.0 );
+ fail_unless( isnan(Compartment_getSize (C)) );
+// fail_unless( Compartment_getVolume (c) == 1.0 );
fail_unless( Compartment_getConstant (c) == 1 );
fail_unless( Compartment_isSetId (c) );
Modified: branches/libsbml-sarah/src/sbml/test/TestReadSBML.cpp
===================================================================
--- branches/libsbml-sarah/src/sbml/test/TestReadSBML.cpp 2009-10-21 15:20:28 UTC (rev 10219)
+++ branches/libsbml-sarah/src/sbml/test/TestReadSBML.cpp 2009-10-25 13:34:26 UTC (rev 10220)
@@ -45,11 +45,11 @@
//TO DO - add namespace
#define XML_HEADER "<?xml version='1.0' encoding='UTF-8'?>\n"
-#define SBML_HEADER_L1v1 "<sbml level='1' version='1'> <model name='m'>\n"
-#define SBML_HEADER_L1v2 "<sbml level='1' version='2'> <model name='m'>\n"
-#define SBML_HEADER_L2v1 "<sbml level='2' version='1'> <model name='m'>\n"
-#define SBML_HEADER_L2v2 "<sbml level='2' version='2'> <model name='m'>\n"
-#define SBML_HEADER_L2v3 "<sbml level='2' version='3'> <model name='m'>\n"
+#define SBML_HEADER_L1v1 "<sbml level='1' version='1' xmlns=\"http://www.sbml.org/sbml/level1\"> <model name='m'>\n"
+#define SBML_HEADER_L1v2 "<sbml level='1' version='2' xmlns=\"http://www.sbml.org/sbml/level1\"> <model name='m'>\n"
+#define SBML_HEADER_L2v1 "<sbml level='2' version='1' xmlns=\"http://www.sbml.org/sbml/level2\"> <model name='m'>\n"
+#define SBML_HEADER_L2v2 "<sbml level='2' version='2' xmlns=\"http://www.sbml.org/sbml/level2/version2\"> <model name='m'>\n"
+#define SBML_HEADER_L2v3 "<sbml level='2' version='3' xmlns=\"http://www.sbml.org/sbml/level2/version3\"> <model name='m'>\n"
#define SBML_FOOTER "</model> </sbml>"
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-21 15:20:35
|
Revision: 10219
http://sbml.svn.sourceforge.net/sbml/?rev=10219&view=rev
Author: sarahkeating
Date: 2009-10-21 15:20:28 +0000 (Wed, 21 Oct 2009)
Log Message:
-----------
beginning to look at a compare function
Modified Paths:
--------------
branches/libsbml-sarah/src/sbml/SBMLNamespaces.cpp
branches/libsbml-sarah/src/sbml/SBMLNamespaces.h
branches/libsbml-sarah/src/sbml/SBase.cpp
branches/libsbml-sarah/src/sbml/SBase.h
Modified: branches/libsbml-sarah/src/sbml/SBMLNamespaces.cpp
===================================================================
--- branches/libsbml-sarah/src/sbml/SBMLNamespaces.cpp 2009-10-21 14:55:56 UTC (rev 10218)
+++ branches/libsbml-sarah/src/sbml/SBMLNamespaces.cpp 2009-10-21 15:20:28 UTC (rev 10219)
@@ -121,6 +121,57 @@
}
+bool
+SBMLNamespaces::compare (SBMLNamespaces& object) const
+{
+ if (mLevel != object.getLevel())
+ {
+ return false;
+ }
+ else if (mVersion != object.getVersion())
+ {
+ return false;
+ }
+ else if (mNamespaces == NULL && object.getNamespaces() != NULL)
+ {
+ return false;
+ }
+ else if (mNamespaces != NULL && object.getNamespaces() == NULL)
+ {
+ return false;
+ }
+ else if (mNamespaces->getLength() != object.getNamespaces()->getLength())
+ {
+ return false;
+ }
+
+ /* if we are still here then everything so far matches */
+ unsigned int num = mNamespaces->getLength();
+ unsigned int matches = 0;
+ for (unsigned int i = 0; i < num; i++)
+ {
+ for (unsigned int j = 0; j < num; j++)
+ {
+ if (mNamespaces->getPrefix(i) == object.getNamespaces()->getPrefix(j)
+ && mNamespaces->getURI(i) == object.getNamespaces()->getURI(j))
+ {
+ matches++;
+ break;
+ }
+ }
+ }
+
+ if (matches != num)
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+}
+
+
std::string
SBMLNamespaces::getSBMLNamespaceURI(unsigned int level,
unsigned int version)
@@ -170,18 +221,40 @@
unsigned int
+SBMLNamespaces::getLevel() const
+{
+ return mLevel;
+}
+
+
+unsigned int
SBMLNamespaces::getVersion()
{
return mVersion;
}
+unsigned int
+SBMLNamespaces::getVersion() const
+{
+ return mVersion;
+}
+
+
XMLNamespaces *
SBMLNamespaces::getNamespaces()
{
return mNamespaces;
}
+
+const XMLNamespaces *
+SBMLNamespaces::getNamespaces() const
+{
+ return mNamespaces;
+}
+
+
void
SBMLNamespaces::addNamespaces(XMLNamespaces * xmlns)
{
Modified: branches/libsbml-sarah/src/sbml/SBMLNamespaces.h
===================================================================
--- branches/libsbml-sarah/src/sbml/SBMLNamespaces.h 2009-10-21 14:55:56 UTC (rev 10218)
+++ branches/libsbml-sarah/src/sbml/SBMLNamespaces.h 2009-10-21 15:20:28 UTC (rev 10219)
@@ -142,6 +142,7 @@
SBMLNamespaces* clone () const;
+ bool compare (SBMLNamespaces& object) const;
/**
* Returns a string representing the SBML XML namespace for the
* given @p level and @p version of SBML.
@@ -166,6 +167,15 @@
/**
+ * Get the SBML Level of this SBMLNamespaces object.
+ *
+ * @return the SBML Level of this SBMLNamespaces object.
+ */
+ unsigned int getLevel() const;
+
+
+
+ /**
* Get the SBML Version of this SBMLNamespaces object.
*
* @return the SBML Version of this SBMLNamespaces object.
@@ -175,6 +185,15 @@
/**
+ * Get the SBML Version of this SBMLNamespaces object.
+ *
+ * @return the SBML Version of this SBMLNamespaces object.
+ */
+ unsigned int getVersion() const;
+
+
+
+ /**
* Get the XML namespaces list for this SBMLNamespaces object.
*
* The plural is not a mistake, because in SBML Level 3, objects may
@@ -191,6 +210,22 @@
/**
+ * Get the XML namespaces list for this SBMLNamespaces object.
+ *
+ * The plural is not a mistake, because in SBML Level 3, objects may
+ * have extensions added by Level 3 packages used by a given model,
+ * and therefore there may be multiple XML namespaces involved too.
+ * However, until the introduction of SBML Level 3, the
+ * SBMLNamespaces object only records one SBML Level/Version/namespace
+ * combination at a time, and so this method will also only return
+ * a list of one item.
+ *
+ * @return the XML namespaces of this SBMLNamespaces object.
+ */
+ const XMLNamespaces * getNamespaces() const;
+
+
+ /**
* Add the XML namespaces list to the set of namespaces
* within this SBMLNamespaces object.
*
Modified: branches/libsbml-sarah/src/sbml/SBase.cpp
===================================================================
--- branches/libsbml-sarah/src/sbml/SBase.cpp 2009-10-21 14:55:56 UTC (rev 10218)
+++ branches/libsbml-sarah/src/sbml/SBase.cpp 2009-10-21 15:20:28 UTC (rev 10219)
@@ -267,7 +267,24 @@
return *this;
}
+bool
+SBase::compare(const SBase& object) const
+{
+ if (!(getSBMLNamespaces()->compare(*(object.getSBMLNamespaces()))))
+ {
+ return false;
+ }
+ else if (mMetaId != object.mMetaId)
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+}
+
/*
* @return the metaid of this SBML object.
*/
Modified: branches/libsbml-sarah/src/sbml/SBase.h
===================================================================
--- branches/libsbml-sarah/src/sbml/SBase.h 2009-10-21 14:55:56 UTC (rev 10218)
+++ branches/libsbml-sarah/src/sbml/SBase.h 2009-10-21 15:20:28 UTC (rev 10219)
@@ -419,6 +419,7 @@
virtual SBase* clone () const = 0;
+ virtual bool compare (const SBase& object) const;
/**
* Returns the value of the "metaid" attribute of this object.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-21 14:56:03
|
Revision: 10218
http://sbml.svn.sourceforge.net/sbml/?rev=10218&view=rev
Author: sarahkeating
Date: 2009-10-21 14:55:56 +0000 (Wed, 21 Oct 2009)
Log Message:
-----------
create a branch for experimenting with modes/defaults etc
Added Paths:
-----------
branches/libsbml-sarah/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-20 07:06:57
|
Revision: 10217
http://sbml.svn.sourceforge.net/sbml/?rev=10217&view=rev
Author: sarahkeating
Date: 2009-10-20 07:06:46 +0000 (Tue, 20 Oct 2009)
Log Message:
-----------
updated to use libsbml-4
Modified Paths:
--------------
trunk/SBMLToolbox/src/OutputSBML.c
Modified: trunk/SBMLToolbox/src/OutputSBML.c
===================================================================
--- trunk/SBMLToolbox/src/OutputSBML.c 2009-10-19 14:45:24 UTC (rev 10216)
+++ trunk/SBMLToolbox/src/OutputSBML.c 2009-10-20 07:06:46 UTC (rev 10217)
@@ -258,7 +258,7 @@
mexErrMsgTxt("Cannot copy name");
}
- SBase_setName((SBase_t *) (sbmlModel), pacName);
+ Model_setName(sbmlModel, pacName);
mxUnitDefinitions = mxGetField(mxModel[0], 0, "unitDefinition");
GetUnitDefinition(mxUnitDefinitions, nLevel, nVersion, sbmlModel);
@@ -2331,7 +2331,8 @@
if (strcmp(pacStoichiometryMath, ""))
{
pStoichiometryMath =
- StoichiometryMath_createWithMath(SBML_parseFormula(pacStoichiometryMath));
+ StoichiometryMath_create(unSBMLLevel, unSBMLVersion);
+ StoichiometryMath_setMath(pStoichiometryMath, SBML_parseFormula(pacStoichiometryMath));
SpeciesReference_setStoichiometryMath(pSpeciesReference, pStoichiometryMath);
}
}
@@ -3180,7 +3181,8 @@
if (strcmp(pacTrigger, ""))
{
- Trigger_t * trigger = Trigger_createWithMath(SBML_parseFormula(pacTrigger));
+ Trigger_t * trigger = Trigger_create(unSBMLLevel, unSBMLVersion);
+ Trigger_setMath(trigger, SBML_parseFormula(pacTrigger));
Event_setTrigger(pEvent, trigger);
}
}
@@ -3203,7 +3205,8 @@
if (strcmp(pacDelay, ""))
{
- Delay_t * delay = Delay_createWithMath(SBML_parseFormula(pacDelay));
+ Delay_t * delay = Delay_create(unSBMLLevel, unSBMLVersion);
+ Delay_setMath(delay, SBML_parseFormula(pacDelay));
Event_setDelay(pEvent, delay);
}
}
@@ -3957,7 +3960,7 @@
ASTNode_t *ast;
if (mxStoichiometryMath == NULL) return;
- pStoichiometryMath = StoichiometryMath_create();
+ pStoichiometryMath = StoichiometryMath_create(unSBMLLevel, unSBMLVersion);
/* get notes */
mxNotes = mxGetField(mxStoichiometryMath, 0, "notes");
@@ -4068,7 +4071,7 @@
ASTNode_t * ast;
if (mxTrigger == NULL) return;
- pTrigger = Trigger_create();
+ pTrigger = Trigger_create(unSBMLLevel, unSBMLVersion);
/* get notes */
mxNotes = mxGetField(mxTrigger, 0, "notes");
@@ -4178,7 +4181,7 @@
Delay_t *pDelay;
ASTNode_t * ast;
if (mxDelay == NULL) return;
- pDelay = Delay_create();
+ pDelay = Delay_create(unSBMLLevel, unSBMLVersion);
/* get notes */
mxNotes = mxGetField(mxDelay, 0, "notes");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-19 14:45:30
|
Revision: 10216
http://sbml.svn.sourceforge.net/sbml/?rev=10216&view=rev
Author: sarahkeating
Date: 2009-10-19 14:45:24 +0000 (Mon, 19 Oct 2009)
Log Message:
-----------
Tracker issue #2859186
When the exponent argument to a power function is itself an expression it was messing up unit checking - this is now reported more clearly
Modified Paths:
--------------
branches/libsbml-3.4/src/validator/constraints/PowerUnitsCheck.cpp
branches/libsbml-3.4/src/validator/constraints/PowerUnitsCheck.h
Modified: branches/libsbml-3.4/src/validator/constraints/PowerUnitsCheck.cpp
===================================================================
--- branches/libsbml-3.4/src/validator/constraints/PowerUnitsCheck.cpp 2009-10-19 14:45:09 UTC (rev 10215)
+++ branches/libsbml-3.4/src/validator/constraints/PowerUnitsCheck.cpp 2009-10-19 14:45:24 UTC (rev 10216)
@@ -175,6 +175,7 @@
// if not argument needs to be an integer or a rational
unsigned int isInteger = 0;
unsigned int isRational = 0;
+ unsigned int isExpression = 0;
/* power must be an integer
* but need to check that it is not a real
* number that is integral
@@ -195,6 +196,12 @@
isInteger = 1;
}
}
+ else if (child->getNumChildren() > 0)
+
+ {
+ // power might itself be an expression - then we cant check
+ isExpression = 1;
+ }
else
{
// power could be a parameter
@@ -266,6 +273,10 @@
logRationalPowerConflict(node, sb);
}
+ else if (isExpression == 1)
+ {
+ logExpressionPowerConflict(node, sb);
+ }
else if (isInteger == 0)
{
logNonIntegerPowerConflict(node, sb);
@@ -524,3 +535,25 @@
}
+
+void
+PowerUnitsCheck::logExpressionPowerConflict (const ASTNode & node,
+ const SBase & sb)
+{
+ char * formula = SBML_formulaToString(&node);
+ msg = "The formula '";
+ msg += formula;
+ msg += "' in the ";
+ msg += getFieldname();
+ msg += " element of the " ;
+ msg += getTypename(sb);
+ msg += " contains an expression for the exponent of the power function ";
+ msg += "and thus cannot be checked for unit validity.";
+
+
+ safe_free(formula);
+
+ logFailure(sb, msg);
+
+}
+
Modified: branches/libsbml-3.4/src/validator/constraints/PowerUnitsCheck.h
===================================================================
--- branches/libsbml-3.4/src/validator/constraints/PowerUnitsCheck.h 2009-10-19 14:45:09 UTC (rev 10215)
+++ branches/libsbml-3.4/src/validator/constraints/PowerUnitsCheck.h 2009-10-19 14:45:24 UTC (rev 10216)
@@ -101,6 +101,8 @@
const SBase & sb);
void logRationalPowerConflict (const ASTNode & node,
const SBase & sb);
+ void logExpressionPowerConflict (const ASTNode & node,
+ const SBase & sb);
/* HACK: until I rewrite the unit stuff
* if a mathml has pow(p, 0.5)/ pow (p, 0.5) then its valid
* at moment it will fire this constraint twice
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-19 14:45:26
|
Revision: 10215
http://sbml.svn.sourceforge.net/sbml/?rev=10215&view=rev
Author: sarahkeating
Date: 2009-10-19 14:45:09 +0000 (Mon, 19 Oct 2009)
Log Message:
-----------
Tracker issue #2859186
When the exponent argument to a power function is itself an expression it was messing up unit checking - this is now reported more clearly
Modified Paths:
--------------
trunk/libsbml/src/validator/constraints/PowerUnitsCheck.cpp
trunk/libsbml/src/validator/constraints/PowerUnitsCheck.h
Modified: trunk/libsbml/src/validator/constraints/PowerUnitsCheck.cpp
===================================================================
--- trunk/libsbml/src/validator/constraints/PowerUnitsCheck.cpp 2009-10-19 11:15:42 UTC (rev 10214)
+++ trunk/libsbml/src/validator/constraints/PowerUnitsCheck.cpp 2009-10-19 14:45:09 UTC (rev 10215)
@@ -159,6 +159,7 @@
ASTNode *child = node.getRightChild();
unitFormat->resetFlags();
unitsArgPower = unitFormat->getUnitDefinition(child, inKL, reactNo);
+
unsigned int undeclaredUnitsPower =
unitFormat->getContainsUndeclaredUnits();
@@ -178,6 +179,7 @@
// if not argument needs to be an integer or a rational
unsigned int isInteger = 0;
unsigned int isRational = 0;
+ unsigned int isExpression = 0;
/* power must be an integer
* but need to check that it is not a real
* number that is integral
@@ -198,8 +200,14 @@
isInteger = 1;
}
}
- else
+ else if (child->getNumChildren() > 0)
+
{
+ // power might itself be an expression - then we cant check
+ isExpression = 1;
+ }
+ else
+ {
// power could be a parameter
const Parameter *param = NULL;
@@ -271,6 +279,10 @@
logRationalPowerConflict(node, sb);
}
+ else if (isExpression == 1)
+ {
+ logExpressionPowerConflict(node, sb);
+ }
else if (isInteger == 0)
{
logNonIntegerPowerConflict(node, sb);
@@ -530,4 +542,26 @@
}
+void
+PowerUnitsCheck::logExpressionPowerConflict (const ASTNode & node,
+ const SBase & sb)
+{
+ char * formula = SBML_formulaToString(&node);
+ msg = "The formula '";
+ msg += formula;
+ msg += "' in the ";
+ msg += getFieldname();
+ msg += " element of the " ;
+ msg += getTypename(sb);
+ msg += " contains an expression for the exponent of the power function ";
+ msg += "and thus cannot be checked for unit validity.";
+
+
+ safe_free(formula);
+
+ logFailure(sb, msg);
+
+}
+
+
LIBSBML_CPP_NAMESPACE_END
Modified: trunk/libsbml/src/validator/constraints/PowerUnitsCheck.h
===================================================================
--- trunk/libsbml/src/validator/constraints/PowerUnitsCheck.h 2009-10-19 11:15:42 UTC (rev 10214)
+++ trunk/libsbml/src/validator/constraints/PowerUnitsCheck.h 2009-10-19 14:45:09 UTC (rev 10215)
@@ -102,6 +102,8 @@
const SBase & sb);
void logRationalPowerConflict (const ASTNode & node,
const SBase & sb);
+ void logExpressionPowerConflict (const ASTNode & node,
+ const SBase & sb);
/* HACK: until I rewrite the unit stuff
* if a mathml has pow(p, 0.5)/ pow (p, 0.5) then its valid
* at moment it will fire this constraint twice
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ajo...@us...> - 2009-10-19 11:15:52
|
Revision: 10214
http://sbml.svn.sourceforge.net/sbml/?rev=10214&view=rev
Author: ajouraku
Date: 2009-10-19 11:15:42 +0000 (Mon, 19 Oct 2009)
Log Message:
-----------
Fixed invalid SId in example C++ programs in "examples/layout/example2.cpp".
Modified Paths:
--------------
branches/libsbml-3.4/examples/layout/example2.cpp
Modified: branches/libsbml-3.4/examples/layout/example2.cpp
===================================================================
--- branches/libsbml-3.4/examples/layout/example2.cpp 2009-10-19 11:08:31 UTC (rev 10213)
+++ branches/libsbml-3.4/examples/layout/example2.cpp 2009-10-19 11:15:42 UTC (rev 10214)
@@ -358,8 +358,8 @@
tGlyph=layout->createTextGlyph();
-tGlyph->setId("TextGlyph+_01");
-bb=BoundingBox("bb+_01",350,140,20,20);
+tGlyph->setId("TextGlyph_plus_01");
+bb=BoundingBox("bb_plus_01",350,140,20,20);
tGlyph->setBoundingBox(&bb);
tGlyph->setText("+");
@@ -439,8 +439,8 @@
tGlyph->setGraphicalObjectId(glyph_ADP_2->getId());
tGlyph=layout->createTextGlyph();
-tGlyph->setId("TextGlyph+_02");
-bb=BoundingBox("bb+_02",350,480,20,20);
+tGlyph->setId("TextGlyph_plus_02");
+bb=BoundingBox("bb_plus_02",350,480,20,20);
tGlyph->setBoundingBox(&bb);
tGlyph->setText("+");
@@ -519,8 +519,8 @@
tGlyph->setGraphicalObjectId(glyph_NAD_1->getId());
tGlyph=layout->createTextGlyph();
-tGlyph->setId("TextGlyph+_06");
-bb=BoundingBox("bb+_06",350,750,20,20);
+tGlyph->setId("TextGlyph_plus_06");
+bb=BoundingBox("bb_plus_06",350,750,20,20);
tGlyph->setBoundingBox(&bb);
tGlyph->setText("+");
@@ -554,8 +554,8 @@
tGlyph=layout->createTextGlyph();
-tGlyph->setId("TextGlyph+_06");
-bb=BoundingBox("bb+_06",365,820,20,20);
+tGlyph->setId("TextGlyph_plus_06");
+bb=BoundingBox("bb_plus_06",365,820,20,20);
tGlyph->setBoundingBox(&bb);
tGlyph->setText("+");
@@ -603,8 +603,8 @@
tGlyph->setGraphicalObjectId(glyph_ADP_3->getId());
tGlyph=layout->createTextGlyph();
-tGlyph->setId("TextGlyph+_03");
-bb=BoundingBox("bb+_03",350,920,20,20);
+tGlyph->setId("TextGlyph_plus_03");
+bb=BoundingBox("bb_plus_03",350,920,20,20);
tGlyph->setBoundingBox(&bb);
tGlyph->setText("+");
@@ -710,8 +710,8 @@
tGlyph->setGraphicalObjectId(glyph_ADP_4->getId());
tGlyph=layout->createTextGlyph();
-tGlyph->setId("TextGlyph+_04");
-bb=BoundingBox("bb+_04",345,1430,20,20);
+tGlyph->setId("TextGlyph_plus_04");
+bb=BoundingBox("bb_plus_04",345,1430,20,20);
tGlyph->setBoundingBox(&bb);
tGlyph->setText("+");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ajo...@us...> - 2009-10-19 11:08:44
|
Revision: 10213
http://sbml.svn.sourceforge.net/sbml/?rev=10213&view=rev
Author: ajouraku
Date: 2009-10-19 11:08:31 +0000 (Mon, 19 Oct 2009)
Log Message:
-----------
Fixed invalid SId in example C++ programs in "examples/layout/example2.cpp".
Modified Paths:
--------------
trunk/libsbml/examples/layout/example2.cpp
Modified: trunk/libsbml/examples/layout/example2.cpp
===================================================================
--- trunk/libsbml/examples/layout/example2.cpp 2009-10-19 03:14:00 UTC (rev 10212)
+++ trunk/libsbml/examples/layout/example2.cpp 2009-10-19 11:08:31 UTC (rev 10213)
@@ -359,8 +359,8 @@
tGlyph=layout->createTextGlyph();
-tGlyph->setId("TextGlyph+_01");
-bb=BoundingBox("bb+_01",350,140,20,20);
+tGlyph->setId("TextGlyph_plus_01");
+bb=BoundingBox("bb_plus_01",350,140,20,20);
tGlyph->setBoundingBox(&bb);
tGlyph->setText("+");
@@ -440,8 +440,8 @@
tGlyph->setGraphicalObjectId(glyph_ADP_2->getId());
tGlyph=layout->createTextGlyph();
-tGlyph->setId("TextGlyph+_02");
-bb=BoundingBox("bb+_02",350,480,20,20);
+tGlyph->setId("TextGlyph_plus_02");
+bb=BoundingBox("bb_plus_02",350,480,20,20);
tGlyph->setBoundingBox(&bb);
tGlyph->setText("+");
@@ -520,8 +520,8 @@
tGlyph->setGraphicalObjectId(glyph_NAD_1->getId());
tGlyph=layout->createTextGlyph();
-tGlyph->setId("TextGlyph+_06");
-bb=BoundingBox("bb+_06",350,750,20,20);
+tGlyph->setId("TextGlyph_plus_06");
+bb=BoundingBox("bb_plus_06",350,750,20,20);
tGlyph->setBoundingBox(&bb);
tGlyph->setText("+");
@@ -555,8 +555,8 @@
tGlyph=layout->createTextGlyph();
-tGlyph->setId("TextGlyph+_06");
-bb=BoundingBox("bb+_06",365,820,20,20);
+tGlyph->setId("TextGlyph_plus_06");
+bb=BoundingBox("bb_plus_06",365,820,20,20);
tGlyph->setBoundingBox(&bb);
tGlyph->setText("+");
@@ -604,8 +604,8 @@
tGlyph->setGraphicalObjectId(glyph_ADP_3->getId());
tGlyph=layout->createTextGlyph();
-tGlyph->setId("TextGlyph+_03");
-bb=BoundingBox("bb+_03",350,920,20,20);
+tGlyph->setId("TextGlyph_plus_03");
+bb=BoundingBox("bb_plus_03",350,920,20,20);
tGlyph->setBoundingBox(&bb);
tGlyph->setText("+");
@@ -711,8 +711,8 @@
tGlyph->setGraphicalObjectId(glyph_ADP_4->getId());
tGlyph=layout->createTextGlyph();
-tGlyph->setId("TextGlyph+_04");
-bb=BoundingBox("bb+_04",345,1430,20,20);
+tGlyph->setId("TextGlyph_plus_04");
+bb=BoundingBox("bb_plus_04",345,1430,20,20);
tGlyph->setBoundingBox(&bb);
tGlyph->setText("+");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ajo...@us...> - 2009-10-19 03:14:08
|
Revision: 10212
http://sbml.svn.sourceforge.net/sbml/?rev=10212&view=rev
Author: ajouraku
Date: 2009-10-19 03:14:00 +0000 (Mon, 19 Oct 2009)
Log Message:
-----------
Added %newobject directives for the following additional functions
that return an SBMLDocument* object owned by the caller.
1) SBMLReader::readSBMLFromFile(const std::string&)
2) readSBMLFromFile(const char*)
Modified Paths:
--------------
trunk/libsbml/src/bindings/swig/libsbml.i
Modified: trunk/libsbml/src/bindings/swig/libsbml.i
===================================================================
--- trunk/libsbml/src/bindings/swig/libsbml.i 2009-10-17 10:14:20 UTC (rev 10211)
+++ trunk/libsbml/src/bindings/swig/libsbml.i 2009-10-19 03:14:00 UTC (rev 10212)
@@ -328,9 +328,11 @@
%newobject *::clone;
%newobject SBase::toSBML;
%newobject SBMLReader::readSBMLFromString;
+%newobject SBMLReader::readSBMLFromFile;
%newobject SBMLReader::readSBML;
%newobject readSBML(const char *);
%newobject readSBMLFromString(const char *);
+%newobject readSBMLFromFile(const char *);
%newobject SBMLWriter::writeToString;
%newobject writeSBMLToString;
%newobject readMathMLFromString;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-17 10:14:27
|
Revision: 10211
http://sbml.svn.sourceforge.net/sbml/?rev=10211&view=rev
Author: sarahkeating
Date: 2009-10-17 10:14:20 +0000 (Sat, 17 Oct 2009)
Log Message:
-----------
added C API functions to reflect the readSBMLFromFile function I added yesterday.
Modified Paths:
--------------
trunk/libsbml/src/sbml/SBMLReader.cpp
trunk/libsbml/src/sbml/SBMLReader.h
Modified: trunk/libsbml/src/sbml/SBMLReader.cpp
===================================================================
--- trunk/libsbml/src/sbml/SBMLReader.cpp 2009-10-16 10:19:31 UTC (rev 10210)
+++ trunk/libsbml/src/sbml/SBMLReader.cpp 2009-10-17 10:14:20 UTC (rev 10211)
@@ -355,6 +355,38 @@
/**
+ * Reads an SBML document from the given file. If filename does not exist
+ * or is not an SBML file, an error will be logged. Errors can be
+ * identified by their unique ids, e.g.:
+ *
+ * <code>
+ * SBMLReader_t *sr;\n
+ * SBMLDocument_t *d;
+ *
+ * sr = SBMLReader_create();
+ *
+ * d = SBMLReader_readSBML(reader, filename);
+ *
+ * if (SBMLDocument_getNumErrors(d) > 0)\n
+ * {\n
+ * if (XMLError_getId(SBMLDocument_getError(d, 0))
+ * == SBML_READ_ERROR_FILE_NOT_FOUND)\n
+ * if (XMLError_getId(SBMLDocument_getError(d, 0))
+ * == SBML_READ_ERROR_NOT_SBML)\n
+ * }\n
+ * </code>
+ *
+ * @return a pointer to the SBMLDocument read.
+ */
+LIBSBML_EXTERN
+SBMLDocument_t *
+SBMLReader_readSBMLFromFile (SBMLReader_t *sr, const char *filename)
+{
+ return (filename != NULL) ? sr->readSBML(filename) : sr->readSBML("");
+}
+
+
+/**
* Reads an SBML document from the given XML string.
*
* If the string does not begin with XML declaration:
@@ -455,6 +487,54 @@
/**
+ * Reads an SBML document from the given file. If filename does not exist
+ * or is not an SBML file, an error will be logged. Errors can be
+ * identified by their unique ids, e.g.:
+ *
+ * <code>
+ * SBMLReader_t *sr;\n
+ * SBMLDocument_t *d;
+ *
+ * sr = SBMLReader_create();
+ *
+ * d = SBMLReader_readSBML(reader, filename);
+ *
+ * if (SBMLDocument_getNumErrors(d) > 0)\n
+ * {\n
+ * if (XMLError_getId(SBMLDocument_getError(d, 0))
+ * == SBML_READ_ERROR_FILE_NOT_FOUND)\n
+ * if (XMLError_getId(SBMLDocument_getError(d, 0))
+ * == SBML_READ_ERROR_NOT_SBML)\n
+ * }\n
+ * </code>
+ *
+ * If the filename ends with @em .gz, the file will be read as a @em gzip file.
+ * Similary, if the filename ends with @em .zip or @em .bz2, the file will be
+ * read as a @em zip or @em bzip2 file, respectively. Otherwise, the fill will be
+ * read as an uncompressed file.
+ * If the filename ends with @em .zip, only the first file in the archive will
+ * be read if the zip archive contains two or more files.
+ *
+ * To read a gzip/zip file, underlying libSBML needs to be linked with zlib
+ * at compile time. Also, underlying libSBML needs to be linked with bzip2
+ * to read a bzip2 file. File unreadable error will be logged if a compressed
+ * file name is given and underlying libSBML is not linked with the corresponding
+ * required library.
+ * SBMLReader_hasZlib() and SBMLReader_hasBzip2() can be used to check
+ * whether libSBML is linked with each library.
+ *
+ * @return a pointer to the SBMLDocument read.
+ */
+LIBSBML_EXTERN
+SBMLDocument_t *
+readSBMLFromFile (const char *filename)
+{
+ SBMLReader sr;
+ return sr.readSBML(filename);
+}
+
+
+/**
* Reads an SBML document from the given XML string.
*
* If the string does not begin with XML declaration:
Modified: trunk/libsbml/src/sbml/SBMLReader.h
===================================================================
--- trunk/libsbml/src/sbml/SBMLReader.h 2009-10-16 10:19:31 UTC (rev 10210)
+++ trunk/libsbml/src/sbml/SBMLReader.h 2009-10-17 10:14:20 UTC (rev 10211)
@@ -410,6 +410,10 @@
SBMLDocument_t *
SBMLReader_readSBML (SBMLReader_t *sr, const char *filename);
+LIBSBML_EXTERN
+SBMLDocument_t *
+SBMLReader_readSBMLFromFile (SBMLReader_t *sr, const char *filename);
+
/**
* Reads an SBML document from the given XML string.
*
@@ -470,6 +474,11 @@
readSBML (const char *filename);
+LIBSBML_EXTERN
+SBMLDocument_t *
+readSBMLFromFile (const char *filename);
+
+
/**
* Reads an SBML document from a string assumed to be in XML format.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-16 10:19:37
|
Revision: 10210
http://sbml.svn.sourceforge.net/sbml/?rev=10210&view=rev
Author: sarahkeating
Date: 2009-10-16 10:19:31 +0000 (Fri, 16 Oct 2009)
Log Message:
-----------
Tracker item #2877180
Added a readSBMLFromFile as requested by Lucian Smith
Modified Paths:
--------------
trunk/libsbml/src/sbml/SBMLReader.cpp
trunk/libsbml/src/sbml/SBMLReader.h
Modified: trunk/libsbml/src/sbml/SBMLReader.cpp
===================================================================
--- trunk/libsbml/src/sbml/SBMLReader.cpp 2009-10-16 09:56:31 UTC (rev 10209)
+++ trunk/libsbml/src/sbml/SBMLReader.cpp 2009-10-16 10:19:31 UTC (rev 10210)
@@ -100,6 +100,16 @@
/*
* Reads an SBML document from the given XML string.
+ */
+SBMLDocument*
+SBMLReader::readSBMLFromFile (const std::string& filename)
+{
+ return readInternal(filename.c_str(), true);
+}
+
+
+/*
+ * Reads an SBML document from the given XML string.
*
* If the string does not begin with XML declaration:
*
Modified: trunk/libsbml/src/sbml/SBMLReader.h
===================================================================
--- trunk/libsbml/src/sbml/SBMLReader.h 2009-10-16 09:56:31 UTC (rev 10209)
+++ trunk/libsbml/src/sbml/SBMLReader.h 2009-10-16 10:19:31 UTC (rev 10210)
@@ -168,6 +168,94 @@
/**
+ * Reads an SBML document from a file.
+ *
+ * If the file named @p filename does not exist or its content is not
+ * valid SBML, one or more errors will be logged with the SBMLDocument
+ * object returned by this method. Callers can use the methods on
+ * SBMLDocument such as SBMLDocument::getNumErrors() and
+ * @if clike SBMLDocument::getError() @endif@if java SBMLDocument::getError(long n) @endif to get the errors. The object returned by
+ * @if clike SBMLDocument::getError() @endif@if java SBMLDocument::getError(long n) @endif is an SBMLError object, and it has methods to
+ * get the error code, category, and severity level of the problem, as
+ * well as a textual description of the problem. The possible severity
+ * levels range from informational messages to fatal errors; see the
+ * documentation for SBMLError for more information.
+ *
+ * If the file @p filename could not be read, the file-reading error will
+ * appear first. The error code can provide a clue about what happened.
+ * For example, a file might be unreadable (either because it does not
+ * actually exist or because the user does not have the necessary access
+ * priviledges to read it) or some sort of file operation error may have
+ * bee reported by the underlying operating system. Callers can check
+ * for these situations using code such as the following:
+ * @code
+ * SBMLReader* reader = new SBMLReader();
+ * SBMLDocument* doc = reader.readSBML(filename);
+ *
+ * if (doc->getNumErrors() > 0)
+ * {
+ * if (doc->getError(0)->getId() == XMLError::FileUnreadable)
+ * {
+ * // Handle case of unreadable file here.
+ * }
+ * else if (doc->getError(0)->getId() == XMLError::FileOperationError)
+ * {
+ * // Handle case of other file error here.
+ * }
+ * else
+ * {
+ * // Handle other cases -- see error codes defined in XMLErrorCode_t
+ * // for other possible cases to check.
+ * }
+ * }
+ * @endcode
+ *
+ * If the given filename ends with the suffix @c ".gz" (for example, @c
+ * "myfile.xml.gz"), the file is assumed to be compressed in @em gzip
+ * format and will be automatically decompressed upon reading.
+ * Similarly, if the given filename ends with @c ".zip" or @c ".bz2", the
+ * file is assumed to be compressed in @em zip or @em bzip2 format
+ * (respectively). Files whose names lack these suffixes will be read
+ * uncompressed. Note that if the file is in @em zip format but the
+ * archive contains more than one file, only the first file in the
+ * archive will be read and the rest ignored.
+ *
+ * @param filename the name or full pathname of the file to be read.
+ *
+ * @return a pointer to the SBMLDocument created from the SBML content.
+ *
+ * @see SBMLError
+ *
+ * @note LibSBML versions 2.x and 3.x behave differently in error
+ * handling in several respects. One difference is how early some errors
+ * are caught and whether libSBML continues processing a file in the face
+ * of some early errors. In general, libSBML 3.x stops parsing SBML
+ * inputs sooner than libSBML 2.x in the face of XML errors because the
+ * errors may invalidate any further SBML content. For example, a
+ * missing XML declaration at the beginning of the file was ignored by
+ * libSBML 2.x but in version 3.x, it will cause libSBML to stop parsing
+ * the rest of the input altogether. While this behavior may seem more
+ * severe and intolerant, it was necessary in order to provide uniform
+ * behavior regardless of which underlying XML parser (Expat, Xerces,
+ * libxml2) is being used by libSBML. The XML parsers themselves behave
+ * differently in their error reporting, and sometimes libSBML has to
+ * resort to the lowest common denominator.
+ *
+ * @note To read a gzip/zip file, libSBML needs to be configured and
+ * linked with the <a href="http://www.zlib.net/">zlib</a> library at
+ * compile time. It also needs to be linked with the <a
+ * href="">bzip2</a> library to read files in @em bzip2 format. (Both of
+ * these are the default configurations for libSBML.) Errors about
+ * unreadable files will be logged if a compressed filename is given and
+ * libSBML was @em not linked with the corresponding required library.
+ *
+ * @note SBMLReader::hasZlib() and SBMLReader::hasBzip2() can be used to
+ * check whether libSBML has been linked with each library.
+ */
+ SBMLDocument* readSBMLFromFile (const std::string& filename);
+
+
+ /**
* Reads an SBML document from the given XML string.
*
* This method is flexible with respect to the presence of an XML
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-16 09:56:39
|
Revision: 10209
http://sbml.svn.sourceforge.net/sbml/?rev=10209&view=rev
Author: sarahkeating
Date: 2009-10-16 09:56:31 +0000 (Fri, 16 Oct 2009)
Log Message:
-----------
removed unused variable
Modified Paths:
--------------
trunk/libsbml/src/sbml/SyntaxChecker.cpp
Modified: trunk/libsbml/src/sbml/SyntaxChecker.cpp
===================================================================
--- trunk/libsbml/src/sbml/SyntaxChecker.cpp 2009-10-16 09:55:52 UTC (rev 10208)
+++ trunk/libsbml/src/sbml/SyntaxChecker.cpp 2009-10-16 09:56:31 UTC (rev 10209)
@@ -231,7 +231,6 @@
{
bool correctSyntax = true;
unsigned int i;
- int n;
/*
* namespace declaration is variable
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-16 09:56:01
|
Revision: 10208
http://sbml.svn.sourceforge.net/sbml/?rev=10208&view=rev
Author: sarahkeating
Date: 2009-10-16 09:55:52 +0000 (Fri, 16 Oct 2009)
Log Message:
-----------
Tracker issue #2878770
The code that checked uniqueness of metaids was not checking all of them.
Thanks to Frank Bergmann for spotting this.
Modified Paths:
--------------
branches/libsbml-3.4/src/validator/constraints/UniqueMetaId.cpp
Added Paths:
-----------
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-09.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-10.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-11.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-12.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-13.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-14.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-15.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-16.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-17.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-18.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-19.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-20.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-21.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-22.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-23.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-24.xml
branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-25.xml
Modified: branches/libsbml-3.4/src/validator/constraints/UniqueMetaId.cpp
===================================================================
--- branches/libsbml-3.4/src/validator/constraints/UniqueMetaId.cpp 2009-10-16 09:54:40 UTC (rev 10207)
+++ branches/libsbml-3.4/src/validator/constraints/UniqueMetaId.cpp 2009-10-16 09:55:52 UTC (rev 10208)
@@ -195,45 +195,127 @@
void
UniqueMetaId::doCheck (const Model& m)
{
- unsigned int n, size;
+ unsigned int n, size, j, num;
+ /* check any metaid on the sbml container */
+ doCheckMetaId(*m.getSBMLDocument());
+
doCheckMetaId( m );
size = m.getNumFunctionDefinitions();
+ if (size > 0) doCheckMetaId(*m.getListOfFunctionDefinitions());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getFunctionDefinition(n) );
size = m.getNumUnitDefinitions();
- for (n = 0; n < size; ++n) doCheckMetaId( *m.getUnitDefinition(n) );
+ if (size > 0) doCheckMetaId(*m.getListOfUnitDefinitions());
+ for (n = 0; n < size; ++n)
+ {
+ const UnitDefinition *ud = m.getUnitDefinition(n);
+ doCheckMetaId( *ud );
+ num = ud->getNumUnits();
+ if (num > 0) doCheckMetaId(*ud->getListOfUnits());
+ for (j = 0; j < num; j++)
+ {
+ doCheckMetaId(*ud->getUnit(j));
+ }
+ }
size = m.getNumCompartmentTypes();
+ if (size > 0) doCheckMetaId(*m.getListOfCompartmentTypes());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getCompartmentType(n) );
size = m.getNumSpeciesTypes();
+ if (size > 0) doCheckMetaId(*m.getListOfSpeciesTypes());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getSpeciesType(n) );
size = m.getNumCompartments();
+ if (size > 0) doCheckMetaId(*m.getListOfCompartments());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getCompartment(n) );
size = m.getNumSpecies();
+ if (size > 0) doCheckMetaId(*m.getListOfSpecies());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getSpecies(n) );
size = m.getNumParameters();
+ if (size > 0) doCheckMetaId(*m.getListOfParameters());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getParameter(n) );
size = m.getNumInitialAssignments();
+ if (size > 0) doCheckMetaId(*m.getListOfInitialAssignments());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getInitialAssignment(n) );
size = m.getNumRules();
+ if (size > 0) doCheckMetaId(*m.getListOfRules());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getRule(n) );
size = m.getNumConstraints();
+ if (size > 0) doCheckMetaId(*m.getListOfConstraints());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getConstraint(n) );
size = m.getNumReactions();
- for (n = 0; n < size; ++n) doCheckMetaId( *m.getReaction(n) );
+ if (size > 0) doCheckMetaId(*m.getListOfReactions());
+ for (n = 0; n < size; ++n)
+ {
+ const Reaction *r = m.getReaction(n);
+ doCheckMetaId( *r );
+ if (r->isSetKineticLaw())
+ {
+ doCheckMetaId(*r->getKineticLaw());
+ num = r->getKineticLaw()->getNumParameters();
+ if (num > 0) doCheckMetaId(*r->getKineticLaw()->getListOfParameters());
+ for (j = 0; j < num; j++)
+ {
+ doCheckMetaId(*r->getKineticLaw()->getParameter(j));
+ }
+ }
+
+ num = r->getNumReactants();
+ if (num > 0) doCheckMetaId(*r->getListOfReactants());
+ for (j = 0; j < num; j++)
+ {
+ doCheckMetaId(*r->getReactant(j));
+ }
+
+ num = r->getNumProducts();
+ if (num > 0) doCheckMetaId(*r->getListOfProducts());
+ for (j = 0; j < num; j++)
+ {
+ doCheckMetaId(*r->getProduct(j));
+ }
+
+ num = r->getNumModifiers();
+ if (num > 0) doCheckMetaId(*r->getListOfModifiers());
+ for (j = 0; j < num; j++)
+ {
+ doCheckMetaId(*r->getModifier(j));
+ }
+ }
+
size = m.getNumEvents();
- for (n = 0; n < size; ++n) doCheckMetaId( *m.getEvent(n) );
+ if (size > 0) doCheckMetaId(*m.getListOfEvents());
+ for (n = 0; n < size; ++n)
+ {
+ const Event *e = m.getEvent(n);
+ doCheckMetaId( *e );
+
+ if (e->isSetTrigger())
+ {
+ doCheckMetaId( *e->getTrigger());
+ }
+ if (e->isSetDelay())
+ {
+ doCheckMetaId( *e->getDelay());
+ }
+
+ num = e->getNumEventAssignments();
+ if (num > 0) doCheckMetaId(*e->getListOfEventAssignments());
+ for (j = 0; j < num; j++)
+ {
+ doCheckMetaId(*e->getEventAssignment(j));
+ }
+ }
+
reset();
}
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-09.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-09.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-09.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4" metaid="mg">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment metaid="cg" id="c"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species metaid="sg" id="s" compartment="c"/>
+ </listOfSpecies>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-10.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-10.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-10.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfUnitDefinitions>
+ <unitDefinition id="kk">
+ <listOfUnits>
+ <unit kind="mole" scale="0" multiplier="1" exponent="1" metaid="mg"/>
+ </listOfUnits>
+ </unitDefinition>
+ </listOfUnitDefinitions>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-11.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-11.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-11.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants>
+ <speciesReference species="ABA"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference species="enzyme1"/>
+ </listOfModifiers>
+ <kineticLaw metaid="mg">
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-12.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-12.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-12.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants>
+ <speciesReference species="ABA" metaid="mg"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference species="enzyme1"/>
+ </listOfModifiers>
+ <kineticLaw>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-13.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-13.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-13.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants>
+ <speciesReference species="ABA"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H" metaid="mg"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference species="enzyme1"/>
+ </listOfModifiers>
+ <kineticLaw>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-14.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-14.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-14.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants>
+ <speciesReference species="ABA"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference species="enzyme1" metaid="mg"/>
+ </listOfModifiers>
+ <kineticLaw>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-15.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-15.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-15.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfEvents>
+ <event>
+ <trigger metaid="mg"/>
+ <listOfEventAssignments>
+ <eventAssignment variable="ABA"/>
+ </listOfEventAssignments>
+ </event>
+ </listOfEvents>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-16.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-16.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-16.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfEvents>
+ <event>
+ <trigger/>
+ <listOfEventAssignments>
+ <eventAssignment variable="ABA" metaid="mg"/>
+ </listOfEventAssignments>
+ </event>
+ </listOfEvents>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-17.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-17.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-17.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfEvents>
+ <event>
+ <trigger/>
+ <delay metaid="mg"/>
+ <listOfEventAssignments>
+ <eventAssignment variable="ABA"/>
+ </listOfEventAssignments>
+ </event>
+ </listOfEvents>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-18.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-18.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-18.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants>
+ <speciesReference species="ABA"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference species="enzyme1"/>
+ </listOfModifiers>
+ <kineticLaw>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ <listOfParameters>
+ <parameter id="k" metaid="mg"/>
+ </listOfParameters>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-19.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-19.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-19.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments metaid="mg">
+ <compartment metaid="cg" id="c"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species metaid="sg" id="s" compartment="c"/>
+ </listOfSpecies>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-20.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-20.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-20.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment metaid="cg" id="c"/>
+ </listOfCompartments>
+ <listOfSpecies metaid="mg">
+ <species metaid="sg" id="s" compartment="c"/>
+ </listOfSpecies>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-21.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-21.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-21.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfUnitDefinitions>
+ <unitDefinition id="kk">
+ <listOfUnits metaid="mg">
+ <unit kind="mole"/>
+ </listOfUnits>
+ </unitDefinition>
+ </listOfUnitDefinitions>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-22.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-22.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-22.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfEvents>
+ <event>
+ <trigger/>
+ <listOfEventAssignments>
+ <eventAssignment variable="ABA" metaid="mg"/>
+ </listOfEventAssignments>
+ </event>
+ </listOfEvents>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-23.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-23.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-23.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants>
+ <speciesReference species="ABA"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference species="enzyme1"/>
+ </listOfModifiers>
+ <kineticLaw>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ <listOfParameters metaid="mg">
+ <parameter id="k"/>
+ </listOfParameters>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-24.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-24.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-24.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants metaid="mg">
+ <speciesReference species="ABA"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference species="enzyme1"/>
+ </listOfModifiers>
+ <kineticLaw>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ <listOfParameters>
+ <parameter id="k"/>
+ </listOfParameters>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
Added: branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-25.xml
===================================================================
--- branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-25.xml (rev 0)
+++ branches/libsbml-3.4/src/validator/test/test-data/10307-fail-01-25.xml 2009-10-16 09:55:52 UTC (rev 10208)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants>
+ <speciesReference species="ABA"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H"/>
+ </listOfProducts>
+ <listOfModifiers metaid="mg">
+ <modifierSpeciesReference species="enzyme1"/>
+ </listOfModifiers>
+ <kineticLaw>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ <listOfParameters>
+ <parameter id="k"/>
+ </listOfParameters>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-16 09:54:47
|
Revision: 10207
http://sbml.svn.sourceforge.net/sbml/?rev=10207&view=rev
Author: sarahkeating
Date: 2009-10-16 09:54:40 +0000 (Fri, 16 Oct 2009)
Log Message:
-----------
Tracker issue #2878770
The code that checked uniqueness of metaids was not checking all of them.
Thanks to Frank Bergmann for spotting this.
Modified Paths:
--------------
trunk/libsbml/src/validator/constraints/UniqueMetaId.cpp
Added Paths:
-----------
trunk/libsbml/src/validator/test/test-data/10307-fail-01-09.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-10.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-11.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-12.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-13.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-14.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-15.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-16.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-17.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-18.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-19.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-20.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-21.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-22.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-23.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-24.xml
trunk/libsbml/src/validator/test/test-data/10307-fail-01-25.xml
Modified: trunk/libsbml/src/validator/constraints/UniqueMetaId.cpp
===================================================================
--- trunk/libsbml/src/validator/constraints/UniqueMetaId.cpp 2009-10-15 12:26:51 UTC (rev 10206)
+++ trunk/libsbml/src/validator/constraints/UniqueMetaId.cpp 2009-10-16 09:54:40 UTC (rev 10207)
@@ -196,46 +196,128 @@
void
UniqueMetaId::doCheck (const Model& m)
{
- unsigned int n, size;
+ unsigned int n, size, j, num;
+ /* check any metaid on the sbml container */
+ doCheckMetaId(*m.getSBMLDocument());
+
doCheckMetaId( m );
size = m.getNumFunctionDefinitions();
+ if (size > 0) doCheckMetaId(*m.getListOfFunctionDefinitions());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getFunctionDefinition(n) );
size = m.getNumUnitDefinitions();
- for (n = 0; n < size; ++n) doCheckMetaId( *m.getUnitDefinition(n) );
+ if (size > 0) doCheckMetaId(*m.getListOfUnitDefinitions());
+ for (n = 0; n < size; ++n)
+ {
+ const UnitDefinition *ud = m.getUnitDefinition(n);
+ doCheckMetaId( *ud );
+ num = ud->getNumUnits();
+ if (num > 0) doCheckMetaId(*ud->getListOfUnits());
+ for (j = 0; j < num; j++)
+ {
+ doCheckMetaId(*ud->getUnit(j));
+ }
+ }
size = m.getNumCompartmentTypes();
+ if (size > 0) doCheckMetaId(*m.getListOfCompartmentTypes());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getCompartmentType(n) );
size = m.getNumSpeciesTypes();
+ if (size > 0) doCheckMetaId(*m.getListOfSpeciesTypes());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getSpeciesType(n) );
size = m.getNumCompartments();
+ if (size > 0) doCheckMetaId(*m.getListOfCompartments());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getCompartment(n) );
size = m.getNumSpecies();
+ if (size > 0) doCheckMetaId(*m.getListOfSpecies());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getSpecies(n) );
size = m.getNumParameters();
+ if (size > 0) doCheckMetaId(*m.getListOfParameters());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getParameter(n) );
size = m.getNumInitialAssignments();
+ if (size > 0) doCheckMetaId(*m.getListOfInitialAssignments());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getInitialAssignment(n) );
size = m.getNumRules();
+ if (size > 0) doCheckMetaId(*m.getListOfRules());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getRule(n) );
size = m.getNumConstraints();
+ if (size > 0) doCheckMetaId(*m.getListOfConstraints());
for (n = 0; n < size; ++n) doCheckMetaId( *m.getConstraint(n) );
size = m.getNumReactions();
- for (n = 0; n < size; ++n) doCheckMetaId( *m.getReaction(n) );
+ if (size > 0) doCheckMetaId(*m.getListOfReactions());
+ for (n = 0; n < size; ++n)
+ {
+ const Reaction *r = m.getReaction(n);
+ doCheckMetaId( *r );
+ if (r->isSetKineticLaw())
+ {
+ doCheckMetaId(*r->getKineticLaw());
+ num = r->getKineticLaw()->getNumParameters();
+ if (num > 0) doCheckMetaId(*r->getKineticLaw()->getListOfParameters());
+ for (j = 0; j < num; j++)
+ {
+ doCheckMetaId(*r->getKineticLaw()->getParameter(j));
+ }
+ }
+
+ num = r->getNumReactants();
+ if (num > 0) doCheckMetaId(*r->getListOfReactants());
+ for (j = 0; j < num; j++)
+ {
+ doCheckMetaId(*r->getReactant(j));
+ }
+
+ num = r->getNumProducts();
+ if (num > 0) doCheckMetaId(*r->getListOfProducts());
+ for (j = 0; j < num; j++)
+ {
+ doCheckMetaId(*r->getProduct(j));
+ }
+
+ num = r->getNumModifiers();
+ if (num > 0) doCheckMetaId(*r->getListOfModifiers());
+ for (j = 0; j < num; j++)
+ {
+ doCheckMetaId(*r->getModifier(j));
+ }
+ }
+
size = m.getNumEvents();
- for (n = 0; n < size; ++n) doCheckMetaId( *m.getEvent(n) );
+ if (size > 0) doCheckMetaId(*m.getListOfEvents());
+ for (n = 0; n < size; ++n)
+ {
+ const Event *e = m.getEvent(n);
+ doCheckMetaId( *e );
+
+ if (e->isSetTrigger())
+ {
+ doCheckMetaId( *e->getTrigger());
+ }
+ if (e->isSetDelay())
+ {
+ doCheckMetaId( *e->getDelay());
+ }
+
+ num = e->getNumEventAssignments();
+ if (num > 0) doCheckMetaId(*e->getListOfEventAssignments());
+ for (j = 0; j < num; j++)
+ {
+ doCheckMetaId(*e->getEventAssignment(j));
+ }
+ }
+
reset();
}
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-09.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-09.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-09.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4" metaid="mg">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment metaid="cg" id="c"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species metaid="sg" id="s" compartment="c"/>
+ </listOfSpecies>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-10.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-10.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-10.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfUnitDefinitions>
+ <unitDefinition id="kk">
+ <listOfUnits>
+ <unit kind="mole" scale="0" multiplier="1" exponent="1" metaid="mg"/>
+ </listOfUnits>
+ </unitDefinition>
+ </listOfUnitDefinitions>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-11.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-11.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-11.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants>
+ <speciesReference species="ABA"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference species="enzyme1"/>
+ </listOfModifiers>
+ <kineticLaw metaid="mg">
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-12.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-12.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-12.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants>
+ <speciesReference species="ABA" metaid="mg"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference species="enzyme1"/>
+ </listOfModifiers>
+ <kineticLaw>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-13.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-13.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-13.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants>
+ <speciesReference species="ABA"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H" metaid="mg"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference species="enzyme1"/>
+ </listOfModifiers>
+ <kineticLaw>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-14.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-14.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-14.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants>
+ <speciesReference species="ABA"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference species="enzyme1" metaid="mg"/>
+ </listOfModifiers>
+ <kineticLaw>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-15.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-15.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-15.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfEvents>
+ <event>
+ <trigger metaid="mg"/>
+ <listOfEventAssignments>
+ <eventAssignment variable="ABA"/>
+ </listOfEventAssignments>
+ </event>
+ </listOfEvents>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-16.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-16.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-16.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfEvents>
+ <event>
+ <trigger/>
+ <listOfEventAssignments>
+ <eventAssignment variable="ABA" metaid="mg"/>
+ </listOfEventAssignments>
+ </event>
+ </listOfEvents>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-17.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-17.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-17.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfEvents>
+ <event>
+ <trigger/>
+ <delay metaid="mg"/>
+ <listOfEventAssignments>
+ <eventAssignment variable="ABA"/>
+ </listOfEventAssignments>
+ </event>
+ </listOfEvents>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-18.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-18.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-18.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants>
+ <speciesReference species="ABA"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference species="enzyme1"/>
+ </listOfModifiers>
+ <kineticLaw>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ <listOfParameters>
+ <parameter id="k" metaid="mg"/>
+ </listOfParameters>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-19.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-19.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-19.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments metaid="mg">
+ <compartment metaid="cg" id="c"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species metaid="sg" id="s" compartment="c"/>
+ </listOfSpecies>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-20.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-20.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-20.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment metaid="cg" id="c"/>
+ </listOfCompartments>
+ <listOfSpecies metaid="mg">
+ <species metaid="sg" id="s" compartment="c"/>
+ </listOfSpecies>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-21.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-21.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-21.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfUnitDefinitions>
+ <unitDefinition id="kk">
+ <listOfUnits metaid="mg">
+ <unit kind="mole"/>
+ </listOfUnits>
+ </unitDefinition>
+ </listOfUnitDefinitions>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-22.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-22.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-22.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfEvents>
+ <event>
+ <trigger/>
+ <listOfEventAssignments>
+ <eventAssignment variable="ABA" metaid="mg"/>
+ </listOfEventAssignments>
+ </event>
+ </listOfEvents>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-23.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-23.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-23.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants>
+ <speciesReference species="ABA"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference species="enzyme1"/>
+ </listOfModifiers>
+ <kineticLaw>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ <listOfParameters metaid="mg">
+ <parameter id="k"/>
+ </listOfParameters>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-24.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-24.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-24.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants metaid="mg">
+ <speciesReference species="ABA"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference species="enzyme1"/>
+ </listOfModifiers>
+ <kineticLaw>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ <listOfParameters>
+ <parameter id="k"/>
+ </listOfParameters>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
Added: trunk/libsbml/src/validator/test/test-data/10307-fail-01-25.xml
===================================================================
--- trunk/libsbml/src/validator/test/test-data/10307-fail-01-25.xml (rev 0)
+++ trunk/libsbml/src/validator/test/test-data/10307-fail-01-25.xml 2009-10-16 09:54:40 UTC (rev 10207)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+ <model metaid="mg" id="m">
+ <listOfCompartments>
+ <compartment id="default_compartment" size="1"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="enzyme1" compartment="default_compartment"/>
+ <species id="ABA" compartment="default_compartment"/>
+ <species id="ABA80H" compartment="default_compartment"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="hydroxylation8">
+ <listOfReactants>
+ <speciesReference species="ABA"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference species="ABA80H"/>
+ </listOfProducts>
+ <listOfModifiers metaid="mg">
+ <modifierSpeciesReference species="enzyme1"/>
+ </listOfModifiers>
+ <kineticLaw>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <cn> 2 </cn>
+ </math>
+ <listOfParameters>
+ <parameter id="k"/>
+ </listOfParameters>
+ </kineticLaw>
+ </reaction>
+ </listOfReactions>
+ </model>
+</sbml>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ajo...@us...> - 2009-10-15 12:26:59
|
Revision: 10206
http://sbml.svn.sourceforge.net/sbml/?rev=10206&view=rev
Author: ajouraku
Date: 2009-10-15 12:26:51 +0000 (Thu, 15 Oct 2009)
Log Message:
-----------
1. Fixed a bug (tracker issue #2877381: 'issetstoichiometry' makes biomodels40
fail) by which the "stoichiometry" attribute and the "stoichiometrymath"
subelement of the SpeciesReference (SBML Level 2) have not been exclusively
manipulated in some functions.
Thanks to Lucian Smith for reporting this bug.
2. Added notes about setStoichiometry(), setStoichiometryMath(),
unsetStoichiometry(), and unsetStoichiometryMath() to SpeciesReference.h.
Modified Paths:
--------------
trunk/libsbml/src/sbml/SBase.cpp
trunk/libsbml/src/sbml/SpeciesReference.cpp
trunk/libsbml/src/sbml/SpeciesReference.h
trunk/libsbml/src/validator/constraints/ConsistencyConstraints.cpp
Modified: trunk/libsbml/src/sbml/SBase.cpp
===================================================================
--- trunk/libsbml/src/sbml/SBase.cpp 2009-10-06 14:49:35 UTC (rev 10205)
+++ trunk/libsbml/src/sbml/SBase.cpp 2009-10-15 12:26:51 UTC (rev 10206)
@@ -2666,9 +2666,14 @@
if ( !stream.isGood() ) break;
if (object->getTypeCode() == SBML_SPECIES_REFERENCE
- && object->getLevel() > 1)
+ && object->getLevel() == 2)
{
- static_cast <SpeciesReference *> (object)->sortMath();
+ SpeciesReference* spr = static_cast <SpeciesReference *> (object);
+ //
+ // initL2Stoichiometry() must be invoked before sortMath().
+ //
+ spr->initL2Stoichiometry();
+ spr->sortMath();
}
checkListOfPopulated(object);
}
Modified: trunk/libsbml/src/sbml/SpeciesReference.cpp
===================================================================
--- trunk/libsbml/src/sbml/SpeciesReference.cpp 2009-10-06 14:49:35 UTC (rev 10205)
+++ trunk/libsbml/src/sbml/SpeciesReference.cpp 2009-10-15 12:26:51 UTC (rev 10206)
@@ -745,21 +745,19 @@
int
SpeciesReference::setStoichiometryMath (const StoichiometryMath* math)
{
- if ( (getLevel() < 2))
+ if ( getLevel() != 2 )
{
return LIBSBML_UNEXPECTED_ATTRIBUTE;
}
else if (mStoichiometryMath == math)
{
- mStoichiometry = 1;
+ mIsSetStoichiometry = false;
+ mStoichiometry = 1.0;
return LIBSBML_OPERATION_SUCCESS;
}
else if (math == NULL)
{
- mStoichiometry = 1;
- delete mStoichiometryMath;
- mStoichiometryMath = 0;
- return LIBSBML_OPERATION_SUCCESS;
+ return unsetStoichiometryMath();
}
else if (getLevel() != math->getLevel())
{
@@ -771,7 +769,9 @@
}
else
{
- mStoichiometry = 1;
+ mIsSetStoichiometry = false;
+ mStoichiometry = 1.0;
+
delete mStoichiometryMath;
mStoichiometryMath = static_cast<StoichiometryMath*>(math->clone());
if (mStoichiometryMath) mStoichiometryMath->setSBMLDocument(mSBML);
@@ -822,6 +822,17 @@
delete mStoichiometryMath;
mStoichiometryMath = 0;
+ if ( getLevel() == 2 && !mIsSetStoichiometry)
+ {
+ //
+ // In SBML Level2, "stoichiometry" attribute is set to 1 (default value)
+ // if neither the "stoichiometry" attribute and the "stoichiometryMath"
+ // element are present.
+ //
+ mIsSetStoichiometry = true;
+ mStoichiometry = 1.0;
+ }
+
if (mStoichiometryMath == NULL)
{
return LIBSBML_OPERATION_SUCCESS;
@@ -836,16 +847,51 @@
int
SpeciesReference::unsetStoichiometry ()
{
- mStoichiometry = numeric_limits<double>::quiet_NaN();
- mIsSetStoichiometry = false;
- if (!isSetStoichiometry())
+ const int level = getLevel();
+
+ if ( level > 2 )
{
- return LIBSBML_OPERATION_SUCCESS;
+ mStoichiometry = numeric_limits<double>::quiet_NaN();
+ mIsSetStoichiometry = false;
+ if (!isSetStoichiometry())
+ {
+ return LIBSBML_OPERATION_SUCCESS;
+ }
+ else
+ {
+ return LIBSBML_OPERATION_FAILED;
+ }
}
else
{
- return LIBSBML_OPERATION_FAILED;
+ mStoichiometry = 1.0;
+
+ if ( level == 2 )
+ {
+ //
+ // In SBML Level2, "stoichiometry" attribute is set to 1 (default value)
+ // if neither the "stoichiometry" attribute and the "stoichiometryMath"
+ // element are present.
+ //
+ if (!isSetStoichiometryMath())
+ {
+ mIsSetStoichiometry = true;
+ }
+ else
+ {
+ mIsSetStoichiometry = false;
+ }
+ }
+ else
+ {
+ //
+ // In SBML Level 1, "stoichiometry" is always set (default is 1.0).
+ //
+ mIsSetStoichiometry = true;
+ }
}
+
+ return LIBSBML_OPERATION_SUCCESS;
}
@@ -1076,6 +1122,25 @@
mStoichiometryMath = 0;
}
}
+
+
+/*
+ * Sets the "stoichiometry" attribute of SBML Level 2 to 1.0 (default)
+ * if neither the "stoichiometry" attribute nor the "stoichiometrymath"
+ * subelement are present.
+ * (This function is internally invoked in SBase::read().)
+ */
+void
+SpeciesReference::initL2Stoichiometry()
+{
+ if (getLevel() != 2) return;
+
+ if (!isSetStoichiometry() && !isSetStoichiometryMath())
+ {
+ setStoichiometry(1.0);
+ }
+}
+
/** @endcond doxygen-libsbml-internal */
@@ -1113,8 +1178,16 @@
SBMLDocument::getDefaultLevel(),
SBMLDocument::getDefaultVersion());
}
+
// clear the default value for stoichiometry
- unsetStoichiometry();
+ //
+ // unsetStoichiometry();
+ //
+ // unsetStoichiometry() must not be invoked here to validate
+ // an error in which the both of stoichiometry attribute and
+ // stoichiometryMath element defined in this speciesreference object.
+ //
+
return mStoichiometryMath;
}
else
@@ -1266,19 +1339,37 @@
{
SimpleSpeciesReference::readAttributes(attributes);
+ const int level = getLevel();
+
//
// stoichiometry: integer { use="optional" default="1" } (L1v1, L1v2)
// stoichiometry: double { use="optional" default="1" } (L2v1->)
//
- if (getLevel() < 3)
+ mIsSetStoichiometry = attributes.readInto("stoichiometry", mStoichiometry);
+ if (!mIsSetStoichiometry)
{
- attributes.readInto("stoichiometry", mStoichiometry);
+ //
+ // setting default value
+ //
+ if (level == 1)
+ {
+ mStoichiometry = 1;
+ mIsSetStoichiometry = true;
+ }
+
+ //
+ // (NOTICE)
+ //
+ // In Level 2, setting default value will be done in SBase::read()
+ // by invoking initL2Stoichiometry() if neither "stoichiometry" attribute
+ // nor "stoichiometrymath" subelement are present in this SpeciesReference.
+ //
+ // This trick is needed because it is impossible to detect if the
+ // "stoichiometrymath" subelement are present in the target model
+ // in this function (SpeciesReference::createObject() will be invoked
+ // after this function when reading an SBML file/string).
+ //
}
- else
- {
- mIsSetStoichiometry = attributes.readInto("stoichiometry",
- mStoichiometry);
- }
//
// denominator: integer { use="optional" default="1" } (L1v1, L1v2)
Modified: trunk/libsbml/src/sbml/SpeciesReference.h
===================================================================
--- trunk/libsbml/src/sbml/SpeciesReference.h 2009-10-06 14:49:35 UTC (rev 10205)
+++ trunk/libsbml/src/sbml/SpeciesReference.h 2009-10-15 12:26:51 UTC (rev 10206)
@@ -785,6 +785,11 @@
*
* @param value the new value of the "stoichiometry" attribute
*
+ * @note In SBML Level 2, the "stoichiometryMath" subelement of this
+ * SpeciesReference object will be unset because the "stoichiometry"
+ * attribute and the stoichiometryMath" subelement are mutually
+ * exclusive.
+ *
* @return integer value indicating success/failure of the
* function. @if clike The value is drawn from the
* enumeration #OperationReturnValues_t. @endif The possible values
@@ -820,6 +825,12 @@
* @param math the StoichiometryMath expression that is to be copied as the
* content of the "stoichiometryMath" subelement.
*
+ * @note In SBML Level 2, the "stoichiometry" attribute of this
+ * SpeciesReference object will be unset (isSetStoichiometry() will
+ * return @c false although getStoichiometry() will return 1.0) if the
+ * given math is not null because the "stoichiometry" attribute and the
+ * stoichiometryMath" subelement are mutually exclusive.
+ *
* @return integer value indicating success/failure of the
* function. @if clike The value is drawn from the
* enumeration #OperationReturnValues_t. @endif The possible values
@@ -903,6 +914,10 @@
* attribute should be used in preference to "stoichiometryMath" when a
* species' stoichiometry is a simple scalar number (integer or
* decimal).
+ *
+ * @note In SBML Level 2, the "stoichiometry" attribute of this
+ * SpeciesReference object will be reset to default (1.0) if the
+ * "stoichiometry" attribute has not been set.
*
*/
int unsetStoichiometryMath ();
@@ -918,6 +933,18 @@
* @li LIBSBML_OPERATION_SUCCESS
* @li LIBSBML_OPERATION_FAILED
*
+ * @note In SBML Level 1, the "stoichiometry" attribute of this
+ * SpeciesReference object will be just reset to default (1.0) and
+ * isSetStoichiometry() will still return @c true.
+ * In SBML Level 2, the "stoichiometry" attribute of this object will
+ * be unset (isSetStoichiometry() will return @c false although
+ * getStoichiometry() will return 1.0) if the "stoichiometryMath"
+ * subelement has been set, otherwise the attribute will be just reset
+ * to default (1.0) (isSetStoichiometry() will still return @c true).
+ * In SBML Level 3, the "stoichiometry" attribute of this object will
+ * be set to NaN and isSetStoichiometry() will return @c false.
+ *
+ *
*/
int unsetStoichiometry ();
@@ -1082,6 +1109,15 @@
* a rational and produces values for stoichiometry and denominator
*/
void sortMath();
+
+
+ /*
+ * Sets the "stoichiometry" attribute of SBML Level 2 to 1.0 (default)
+ * if neither the "stoichiometry" attribute nor the "stoichiometrymath"
+ * subelement are present.
+ * (This function is internally invoked in SBase::read().)
+ */
+ void initL2Stoichiometry();
/** @endcond doxygen-libsbml-internal */
Modified: trunk/libsbml/src/validator/constraints/ConsistencyConstraints.cpp
===================================================================
--- trunk/libsbml/src/validator/constraints/ConsistencyConstraints.cpp 2009-10-06 14:49:35 UTC (rev 10205)
+++ trunk/libsbml/src/validator/constraints/ConsistencyConstraints.cpp 2009-10-15 12:26:51 UTC (rev 10206)
@@ -1645,7 +1645,7 @@
// "Section 4.9.5; L2V2 Section 4.13.3; L2V3 Section 4.13.3.)";
- inv( sr.getStoichiometry() == 1.0 );
+ inv( !sr.isSetStoichiometry() );
}
END_CONSTRAINT
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-06 14:49:44
|
Revision: 10205
http://sbml.svn.sourceforge.net/sbml/?rev=10205&view=rev
Author: sarahkeating
Date: 2009-10-06 14:49:35 +0000 (Tue, 06 Oct 2009)
Log Message:
-----------
turned on svn keywords
Modified Paths:
--------------
trunk/sbmldemo/src/read/GetStructure.m
Property Changed:
----------------
trunk/sbmldemo/src/read/GetStructure.m
Modified: trunk/sbmldemo/src/read/GetStructure.m
===================================================================
--- trunk/sbmldemo/src/read/GetStructure.m 2009-10-06 14:48:46 UTC (rev 10204)
+++ trunk/sbmldemo/src/read/GetStructure.m 2009-10-06 14:49:35 UTC (rev 10205)
@@ -1,307 +1,307 @@
-function object = getStructure(name, sbmlInfo)
-%
-% getStructure(name, sbmlInfo)
-% Returns a structure representing the element 'name' of an
-% SBML model based on the level/version information supplied.
-%
-% Note: returns an empty structure if the level/version are not
-% supported.
-%
-
-% @file getStructure.m
-% @brief Creates SBML type structure.
-% @author Sarah Keating
-%
-% $Id: $
-% $HeadURL: $
-%
-%<!---------------------------------------------------------------------------
-%
-
-% this function needs to contain all possible element names from an SBML file
-modelStructure = loadAttributes(sbmlInfo);
-
-% check that a valid model has been generated
-if (isempty(modelStructure))
- object = struct();
- return;
-end;
-
-if (strcmp(name, 'model'))
- object = struct();
- parent = modelStructure.model;
- for i=1:length(parent.names)
- if (ischar(parent.values{i}))
- object.(parent.names{i}) = parent.values{i};
- else
- object.(parent.names{i}) = getStructure(parent.names{i}, sbmlInfo);
- end;
- end;
- return;
-end;
-
-switch name
- case 'listOfFunctionDefinitions'
- object = 'functionDefinition';
- case 'listOfUnits'
- object = 'unit';
- case 'listOfUnitDefinitions'
- object = 'unitDefinition';
- case 'listOfCompartments'
- object = 'compartment';
- case 'listOfSpecies'
- object = 'species';
- case 'listOfParameters'
- object = 'parameter';
- case 'listOfInitialAssignments'
- object = 'initialAssignment';
- case 'listOfRules'
- object = 'rule';
- case 'listOfConstraints'
- object = 'constraint';
- case 'listOfReactions'
- object = 'reaction';
- case 'listOfEvents'
- object = 'event';
- case 'listOfEventAssignments'
- object = 'eventAssignment';
- case 'listOfProducts'
- object = 'product';
- case 'listOfReactants'
- object = 'reactant';
- case 'listOfModifiers'
- object = 'modifier';
- case 'listOfLocalParameters'
- object = 'localParameter';
- case 'math'
- object = 'math';
- case 'functionDefinition'
- object = struct();
- parent = modelStructure.listOfFunctionDefinitions.functionDefinition;
- case 'unit'
- object = struct();
- parent = modelStructure.listOfUnitDefinitions.unitDefinition.values{3};
- case 'unitDefinition'
- object = struct();
- parent = modelStructure.listOfUnitDefinitions.unitDefinition;
- case 'compartment'
- object = struct();
- parent = modelStructure.listOfCompartments.compartment;
- case 'species'
- object = struct();
- parent = modelStructure.listOfSpecies.species;
- case 'parameter'
- object = struct();
- parent = modelStructure.listOfParameters.parameter;
- case 'initialAssignment'
- object = struct();
- parent = modelStructure.listOfInitialAssignments.initialAssignment;
- case 'rule'
- object = struct();
- parent = modelStructure.listOfRules.rule;
- case 'assignmentRule'
- object = struct();
- parent = modelStructure.listOfRules.rule;
- case 'rateRule'
- object = struct();
- parent = modelStructure.listOfRules.rule;
- case 'algebraicRule'
- object = struct();
- parent = modelStructure.listOfRules.rule;
- case 'constraint'
- object = struct();
- parent = modelStructure.listOfConstraints.constraint;
- case 'reactant'
- object = struct();
- parent = modelStructure.listOfReactions.reaction.values{6};
- case 'product'
- object = struct();
- parent = modelStructure.listOfReactions.reaction.values{7};
- case 'modifier'
- object = struct();
- parent = modelStructure.listOfReactions.reaction.values{8};
- case 'kineticLaw'
- object = struct();
- parent = modelStructure.listOfReactions.reaction.values{9};
- case 'localParameter'
- object = struct();
- parent = modelStructure.listOfReactions.reaction.values{9}.values{2};
- case 'reaction'
- object = struct();
- parent = modelStructure.listOfReactions.reaction;
- case 'event'
- object = struct();
- parent = modelStructure.listOfEvents.event;
- case 'eventAssignment'
- object = struct();
- parent = modelStructure.listOfEvents.event.values{6};
- case 'trigger'
- object = struct();
- parent = modelStructure.listOfEvents.event.values{4};
- case 'delay'
- object = struct();
- parent = modelStructure.listOfEvents.event.values{5};
- otherwise
-end;
-
-if (isstruct(object))
- for i=1:length(parent.names)
- if (isstruct(parent.values{i}))
- object.(parent.names{i}) = getStructure(parent.names{i}, sbmlInfo);
- else
- object.(parent.names{i}) = parent.values{i};
- end;
- end;
-end;
-
-%%
-function modelStructure = loadAttributes(sbmlInfo)
-% this function needs to detail the structures for all possible levels
-% versions packages
-
-% currently there is no information for anything except L3V1Core
-
-if (sbmlInfo.level ~= '3')
- modelStructure = [];
- return;
-elseif (sbmlInfo.version ~= '1')
- modelStructure = [];
- return;
-end;
-functionDefinition = struct();
-functionDefinition.names = {'id', 'name', 'math'};
-functionDefinition.values = {'', '', ''};
-
-unit = struct();
-unit.names = {'kind', 'exponent', 'scale', 'multiplier'};
-unit.values = {'', NaN, NaN, NaN};
-
-unitDefinition = struct();
-unitDefinition.names = {'id', 'name', 'unit'};
-unitDefinition.values = {'', '', unit};
-
-compartment = struct();
-compartment.names = {'id', 'name', 'spatialDimensions', 'size', ...
- 'units', 'constant'};
-compartment.values = {'', '', NaN, NaN, '', ''};
-
-species = struct();
-species.names = {'id', 'name', 'compartment', 'initialAmount', ...
- 'initialConcentration', 'substanceUnits','hasOnlySubstanceUnits', ...
- 'boundaryCondition', 'constant'};
-species.values = {'', '', '', NaN, NaN, '', '', '', ''};
-
-parameter = struct();
-parameter.names = {'id', 'name', 'value', 'units', 'constant'};
-parameter.values = {'', '', NaN, '', ''};
-
-initialAssignment = struct();
-initialAssignment.names = {'symbol', 'math'};
-initialAssignment.values = {'', ''};
-
-constraint = struct();
-constraint.names = {'math'};
-constraint.values = {''};
-
-product = struct();
-product.names = {'id', 'name', 'species', 'stoichiometry' ...
- 'conversionFactor'};
-product.values = {'', '', '', NaN, ''};
-
-reactant = struct();
-reactant.names = {'id', 'name', 'species', 'stoichiometry' ...
- 'conversionFactor'};
-reactant.values = {'', '', '', NaN, ''};
-
-modifier = struct();
-modifier.names = {'id', 'name', 'species'};
-modifier.values = {'', '', ''};
-
-localParameter = struct();
-localParameter.names = {'id', 'name', 'value', 'units'};
-localParameter.values = {'', '', NaN, ''};
-
-kineticLaw = struct();
-kineticLaw.names = {'math', 'localParameter'};
-kineticLaw.values = {'', localParameter};
-
-reaction = struct();
-reaction.names = {'id', 'name', 'reversible', 'fast', 'compartment', ...
- 'reactant', 'product', 'modifier', 'kineticLaw'};
-reaction.values = {'', '', '', '', '', reactant, product, ...
- modifier, kineticLaw};
-
-trigger = struct();
-trigger.names = {'math'};
-trigger.values = {''};
-
-delay = struct();
-delay.names = {'math'};
-delay.values = {''};
-
-
-eventAssignment = struct();
-eventAssignment.names = {'variable', 'math'};
-eventAssignment.values = {'', ''};
-
-event = struct();
-event.names = {'id', 'name', 'useValuesFromTriggerTime', 'trigger', ...
- 'delay', 'eventAssignment'};
-event.values = {'', '', '', trigger, delay, eventAssignment};
-
-rule = struct();
-rule.names = {'variable', 'math'};
-rule.values = {'', ''};
-
-model = struct();
-model.names = {'id', 'name', 'substanceUnits', 'timeUnits', 'volumeUnits', ...
- 'areaUnits', 'lengthUnits', 'extentUnits', 'functionDefinition', ...
- 'unitDefinition', 'compartment', 'species', 'parameter', ...
- 'initialAssignment', 'rule', 'constraint', 'reaction', 'event'};
-model.values = {'', '', '', '', '', '', '', '', functionDefinition, ...
- unitDefinition, compartment, species, parameter, initialAssignment, ...
- rule, constraint, reaction, event};
-
-listOfFunctionDefinitions = struct();
-listOfFunctionDefinitions.functionDefinition = functionDefinition;
-
-listOfUnitDefinitions = struct();
-listOfUnitDefinitions.unitDefinition = unitDefinition;
-
-listOfCompartments = struct();
-listOfCompartments.compartment = compartment;
-
-listOfSpecies = struct();
-listOfSpecies.species = species;
-
-listOfParameters = struct();
-listOfParameters.parameter = parameter;
-
-listOfInitialAssignments = struct();
-listOfInitialAssignments.initialAssignment = initialAssignment;
-
-listOfRules = struct();
-listOfRules.rule = rule;
-
-listOfConstraints = struct();
-listOfConstraints.constraint = constraint;
-
-listOfReactions = struct();
-listOfReactions.reaction = reaction;
-
-listOfEvents = struct();
-listOfEvents.event = event;
-
-
-modelStructure = struct();
-modelStructure.listOfFunctionDefinitions = listOfFunctionDefinitions;
-modelStructure.listOfUnitDefinitions = listOfUnitDefinitions;
-modelStructure.listOfCompartments = listOfCompartments;
-modelStructure.listOfSpecies = listOfSpecies;
-modelStructure.listOfParameters = listOfParameters;
-modelStructure.listOfInitialAssignments = listOfInitialAssignments;
-modelStructure.listOfRules = listOfRules;
-modelStructure.listOfConstraints = listOfConstraints;
-modelStructure.listOfReactions = listOfReactions;
-modelStructure.listOfEvents = listOfEvents;
-modelStructure.model = model;
+function object = getStructure(name, sbmlInfo)
+%
+% getStructure(name, sbmlInfo)
+% Returns a structure representing the element 'name' of an
+% SBML model based on the level/version information supplied.
+%
+% Note: returns an empty structure if the level/version are not
+% supported.
+%
+
+% @file getStructure.m
+% @brief Creates SBML type structure.
+% @author Sarah Keating
+%
+% $Id$
+% $HeadURL$
+%
+%<!---------------------------------------------------------------------------
+%
+
+% this function needs to contain all possible element names from an SBML file
+modelStructure = loadAttributes(sbmlInfo);
+
+% check that a valid model has been generated
+if (isempty(modelStructure))
+ object = struct();
+ return;
+end;
+
+if (strcmp(name, 'model'))
+ object = struct();
+ parent = modelStructure.model;
+ for i=1:length(parent.names)
+ if (ischar(parent.values{i}))
+ object.(parent.names{i}) = parent.values{i};
+ else
+ object.(parent.names{i}) = getStructure(parent.names{i}, sbmlInfo);
+ end;
+ end;
+ return;
+end;
+
+switch name
+ case 'listOfFunctionDefinitions'
+ object = 'functionDefinition';
+ case 'listOfUnits'
+ object = 'unit';
+ case 'listOfUnitDefinitions'
+ object = 'unitDefinition';
+ case 'listOfCompartments'
+ object = 'compartment';
+ case 'listOfSpecies'
+ object = 'species';
+ case 'listOfParameters'
+ object = 'parameter';
+ case 'listOfInitialAssignments'
+ object = 'initialAssignment';
+ case 'listOfRules'
+ object = 'rule';
+ case 'listOfConstraints'
+ object = 'constraint';
+ case 'listOfReactions'
+ object = 'reaction';
+ case 'listOfEvents'
+ object = 'event';
+ case 'listOfEventAssignments'
+ object = 'eventAssignment';
+ case 'listOfProducts'
+ object = 'product';
+ case 'listOfReactants'
+ object = 'reactant';
+ case 'listOfModifiers'
+ object = 'modifier';
+ case 'listOfLocalParameters'
+ object = 'localParameter';
+ case 'math'
+ object = 'math';
+ case 'functionDefinition'
+ object = struct();
+ parent = modelStructure.listOfFunctionDefinitions.functionDefinition;
+ case 'unit'
+ object = struct();
+ parent = modelStructure.listOfUnitDefinitions.unitDefinition.values{3};
+ case 'unitDefinition'
+ object = struct();
+ parent = modelStructure.listOfUnitDefinitions.unitDefinition;
+ case 'compartment'
+ object = struct();
+ parent = modelStructure.listOfCompartments.compartment;
+ case 'species'
+ object = struct();
+ parent = modelStructure.listOfSpecies.species;
+ case 'parameter'
+ object = struct();
+ parent = modelStructure.listOfParameters.parameter;
+ case 'initialAssignment'
+ object = struct();
+ parent = modelStructure.listOfInitialAssignments.initialAssignment;
+ case 'rule'
+ object = struct();
+ parent = modelStructure.listOfRules.rule;
+ case 'assignmentRule'
+ object = struct();
+ parent = modelStructure.listOfRules.rule;
+ case 'rateRule'
+ object = struct();
+ parent = modelStructure.listOfRules.rule;
+ case 'algebraicRule'
+ object = struct();
+ parent = modelStructure.listOfRules.rule;
+ case 'constraint'
+ object = struct();
+ parent = modelStructure.listOfConstraints.constraint;
+ case 'reactant'
+ object = struct();
+ parent = modelStructure.listOfReactions.reaction.values{6};
+ case 'product'
+ object = struct();
+ parent = modelStructure.listOfReactions.reaction.values{7};
+ case 'modifier'
+ object = struct();
+ parent = modelStructure.listOfReactions.reaction.values{8};
+ case 'kineticLaw'
+ object = struct();
+ parent = modelStructure.listOfReactions.reaction.values{9};
+ case 'localParameter'
+ object = struct();
+ parent = modelStructure.listOfReactions.reaction.values{9}.values{2};
+ case 'reaction'
+ object = struct();
+ parent = modelStructure.listOfReactions.reaction;
+ case 'event'
+ object = struct();
+ parent = modelStructure.listOfEvents.event;
+ case 'eventAssignment'
+ object = struct();
+ parent = modelStructure.listOfEvents.event.values{6};
+ case 'trigger'
+ object = struct();
+ parent = modelStructure.listOfEvents.event.values{4};
+ case 'delay'
+ object = struct();
+ parent = modelStructure.listOfEvents.event.values{5};
+ otherwise
+end;
+
+if (isstruct(object))
+ for i=1:length(parent.names)
+ if (isstruct(parent.values{i}))
+ object.(parent.names{i}) = getStructure(parent.names{i}, sbmlInfo);
+ else
+ object.(parent.names{i}) = parent.values{i};
+ end;
+ end;
+end;
+
+%%
+function modelStructure = loadAttributes(sbmlInfo)
+% this function needs to detail the structures for all possible levels
+% versions packages
+
+% currently there is no information for anything except L3V1Core
+
+if (sbmlInfo.level ~= '3')
+ modelStructure = [];
+ return;
+elseif (sbmlInfo.version ~= '1')
+ modelStructure = [];
+ return;
+end;
+functionDefinition = struct();
+functionDefinition.names = {'id', 'name', 'math'};
+functionDefinition.values = {'', '', ''};
+
+unit = struct();
+unit.names = {'kind', 'exponent', 'scale', 'multiplier'};
+unit.values = {'', NaN, NaN, NaN};
+
+unitDefinition = struct();
+unitDefinition.names = {'id', 'name', 'unit'};
+unitDefinition.values = {'', '', unit};
+
+compartment = struct();
+compartment.names = {'id', 'name', 'spatialDimensions', 'size', ...
+ 'units', 'constant'};
+compartment.values = {'', '', NaN, NaN, '', ''};
+
+species = struct();
+species.names = {'id', 'name', 'compartment', 'initialAmount', ...
+ 'initialConcentration', 'substanceUnits','hasOnlySubstanceUnits', ...
+ 'boundaryCondition', 'constant'};
+species.values = {'', '', '', NaN, NaN, '', '', '', ''};
+
+parameter = struct();
+parameter.names = {'id', 'name', 'value', 'units', 'constant'};
+parameter.values = {'', '', NaN, '', ''};
+
+initialAssignment = struct();
+initialAssignment.names = {'symbol', 'math'};
+initialAssignment.values = {'', ''};
+
+constraint = struct();
+constraint.names = {'math'};
+constraint.values = {''};
+
+product = struct();
+product.names = {'id', 'name', 'species', 'stoichiometry' ...
+ 'conversionFactor'};
+product.values = {'', '', '', NaN, ''};
+
+reactant = struct();
+reactant.names = {'id', 'name', 'species', 'stoichiometry' ...
+ 'conversionFactor'};
+reactant.values = {'', '', '', NaN, ''};
+
+modifier = struct();
+modifier.names = {'id', 'name', 'species'};
+modifier.values = {'', '', ''};
+
+localParameter = struct();
+localParameter.names = {'id', 'name', 'value', 'units'};
+localParameter.values = {'', '', NaN, ''};
+
+kineticLaw = struct();
+kineticLaw.names = {'math', 'localParameter'};
+kineticLaw.values = {'', localParameter};
+
+reaction = struct();
+reaction.names = {'id', 'name', 'reversible', 'fast', 'compartment', ...
+ 'reactant', 'product', 'modifier', 'kineticLaw'};
+reaction.values = {'', '', '', '', '', reactant, product, ...
+ modifier, kineticLaw};
+
+trigger = struct();
+trigger.names = {'math'};
+trigger.values = {''};
+
+delay = struct();
+delay.names = {'math'};
+delay.values = {''};
+
+
+eventAssignment = struct();
+eventAssignment.names = {'variable', 'math'};
+eventAssignment.values = {'', ''};
+
+event = struct();
+event.names = {'id', 'name', 'useValuesFromTriggerTime', 'trigger', ...
+ 'delay', 'eventAssignment'};
+event.values = {'', '', '', trigger, delay, eventAssignment};
+
+rule = struct();
+rule.names = {'variable', 'math'};
+rule.values = {'', ''};
+
+model = struct();
+model.names = {'id', 'name', 'substanceUnits', 'timeUnits', 'volumeUnits', ...
+ 'areaUnits', 'lengthUnits', 'extentUnits', 'functionDefinition', ...
+ 'unitDefinition', 'compartment', 'species', 'parameter', ...
+ 'initialAssignment', 'rule', 'constraint', 'reaction', 'event'};
+model.values = {'', '', '', '', '', '', '', '', functionDefinition, ...
+ unitDefinition, compartment, species, parameter, initialAssignment, ...
+ rule, constraint, reaction, event};
+
+listOfFunctionDefinitions = struct();
+listOfFunctionDefinitions.functionDefinition = functionDefinition;
+
+listOfUnitDefinitions = struct();
+listOfUnitDefinitions.unitDefinition = unitDefinition;
+
+listOfCompartments = struct();
+listOfCompartments.compartment = compartment;
+
+listOfSpecies = struct();
+listOfSpecies.species = species;
+
+listOfParameters = struct();
+listOfParameters.parameter = parameter;
+
+listOfInitialAssignments = struct();
+listOfInitialAssignments.initialAssignment = initialAssignment;
+
+listOfRules = struct();
+listOfRules.rule = rule;
+
+listOfConstraints = struct();
+listOfConstraints.constraint = constraint;
+
+listOfReactions = struct();
+listOfReactions.reaction = reaction;
+
+listOfEvents = struct();
+listOfEvents.event = event;
+
+
+modelStructure = struct();
+modelStructure.listOfFunctionDefinitions = listOfFunctionDefinitions;
+modelStructure.listOfUnitDefinitions = listOfUnitDefinitions;
+modelStructure.listOfCompartments = listOfCompartments;
+modelStructure.listOfSpecies = listOfSpecies;
+modelStructure.listOfParameters = listOfParameters;
+modelStructure.listOfInitialAssignments = listOfInitialAssignments;
+modelStructure.listOfRules = listOfRules;
+modelStructure.listOfConstraints = listOfConstraints;
+modelStructure.listOfReactions = listOfReactions;
+modelStructure.listOfEvents = listOfEvents;
+modelStructure.model = model;
Property changes on: trunk/sbmldemo/src/read/GetStructure.m
___________________________________________________________________
Added: svn:keywords
+ Id Date Author HeadURL URL Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-06 14:48:56
|
Revision: 10204
http://sbml.svn.sourceforge.net/sbml/?rev=10204&view=rev
Author: sarahkeating
Date: 2009-10-06 14:48:46 +0000 (Tue, 06 Oct 2009)
Log Message:
-----------
added code to gracefully decline to deal with SBML levels that are not Level 3
Modified Paths:
--------------
trunk/sbmldemo/src/read/GetStructure.m
trunk/sbmldemo/src/read/readMath.m
trunk/sbmldemo/src/read/readSBML.m
trunk/sbmldemo/src/read/test/test-data/testFunctionDefinition.xml
trunk/sbmldemo/src/read/test/testRead.m
trunk/sbmldemo/src/read/test/testReadFunctionDefinition.m
trunk/sbmldemo/src/read/test/testReadRule.m
Added Paths:
-----------
trunk/sbmldemo/src/read/test/test-data/testLevel2.xml
trunk/sbmldemo/src/read/test/testReadLevel2.m
Modified: trunk/sbmldemo/src/read/GetStructure.m
===================================================================
--- trunk/sbmldemo/src/read/GetStructure.m 2009-10-06 14:27:53 UTC (rev 10203)
+++ trunk/sbmldemo/src/read/GetStructure.m 2009-10-06 14:48:46 UTC (rev 10204)
@@ -1,5 +1,23 @@
function object = getStructure(name, sbmlInfo)
+%
+% getStructure(name, sbmlInfo)
+% Returns a structure representing the element 'name' of an
+% SBML model based on the level/version information supplied.
+%
+% Note: returns an empty structure if the level/version are not
+% supported.
+%
+% @file getStructure.m
+% @brief Creates SBML type structure.
+% @author Sarah Keating
+%
+% $Id: $
+% $HeadURL: $
+%
+%<!---------------------------------------------------------------------------
+%
+
% this function needs to contain all possible element names from an SBML file
modelStructure = loadAttributes(sbmlInfo);
Modified: trunk/sbmldemo/src/read/readMath.m
===================================================================
--- trunk/sbmldemo/src/read/readMath.m 2009-10-06 14:27:53 UTC (rev 10203)
+++ trunk/sbmldemo/src/read/readMath.m 2009-10-06 14:48:46 UTC (rev 10204)
@@ -1,5 +1,25 @@
function strngs = readMath(mathStructure, sbmlInfo)
+%
+% readMath(mathStructure, sbmlInfo)
+% Parses a math element from an SBML file and returns a structure with two elements
+% the first representing a humanly readable form of the math,
+% the second respresenting a compatible implementation.
+%
+% 'mathStructure' must be the name of an SBML file.
+%
+% @file readMath.m
+% @brief Parses a structure from a math element.
+% @author Sarah Keating
+% @author Andrew Davis
+%
+% $Id: $
+% $HeadURL: $
+%
+%<!---------------------------------------------------------------------------
+%
+
+
math1=parseMath(mathStructure);
math2=makeUserReadable(math1);
@@ -8,6 +28,7 @@
end
+%%
function math = makeUserReadable(M)
% log -> ln
@@ -47,6 +68,7 @@
end
+%%
function math = parseMath(mathStructure)
foundApply = 0;
@@ -156,6 +178,7 @@
end
+%%
function M=convertToRead(math,stack)
% convert to infix
@@ -198,6 +221,7 @@
M=removeExtraPara(M);
end
+%%
function math=removeExtraPara(M)
if isempty(M), math=M; return; end
@@ -314,6 +338,7 @@
end
end
+%%
function math = dealWithLambda(pieceStruct,math)
N=length(pieceStruct.lambda);
P=cell(1,N);
@@ -341,6 +366,7 @@
math=strcat(math,P{N});
end
+%%
function parts = dealWithPiecewise(pieceStruct)
parts=cell(1); p=1;
@@ -355,17 +381,20 @@
end
end
+%%
function m=dealWithOtherwise(pieceStrct)
m=readMath(pieceStrct.otherwise);
m=strcat('else,',m);
end
+%%
function m=dealWithPiece(pieceStrct)
m1=parseMath(pieceStrct.piece(1));
m2=parseMath(pieceStrct.piece(2));
m=strcat('if(',m2,'),',m1);
end
+%%
function math = dealWithApply(applyStruct, math)
base=''; % only needed for logbase case -> empty otherwise
@@ -393,6 +422,7 @@
end
end
+%%
function math = dealWithFunc(applyStruct, math)
name = fieldnames(applyStruct);
@@ -469,6 +499,7 @@
end;
end
+%%
function math = dealWithCn(cnStruct, math)
% cn nodes might have a type in which case there is a cell
@@ -510,6 +541,7 @@
end;
end
+%%
function math = dealWithCSymbol(csymbolStruct, math)
% csymbol nodes contain a cell
Modified: trunk/sbmldemo/src/read/readSBML.m
===================================================================
--- trunk/sbmldemo/src/read/readSBML.m 2009-10-06 14:27:53 UTC (rev 10203)
+++ trunk/sbmldemo/src/read/readSBML.m 2009-10-06 14:48:46 UTC (rev 10204)
@@ -78,6 +78,11 @@
function model = dealWithModel(modelCell, sbmlInfo)
model = getStructure('model', sbmlInfo);
+% check a structure was returned
+if (isEmptyStruct(model))
+ model.message='Cannot deal with this Level/Version of SBML';
+ return;
+end;
for i=1:length(modelCell)
names = fieldnames(modelCell{i});
for j=1:length(names)
@@ -204,5 +209,17 @@
end;
parent.package(index) = package;
+%%
+function a = isEmptyStruct(structA)
+names = fieldnames(structA);
+len = length(names);
+if (len > 0)
+ a = 0;
+else
+ a = 1;
+end;
+
+
+
Modified: trunk/sbmldemo/src/read/test/test-data/testFunctionDefinition.xml
===================================================================
--- trunk/sbmldemo/src/read/test/test-data/testFunctionDefinition.xml 2009-10-06 14:27:53 UTC (rev 10203)
+++ trunk/sbmldemo/src/read/test/test-data/testFunctionDefinition.xml 2009-10-06 14:48:46 UTC (rev 10204)
@@ -23,10 +23,13 @@
<bvar>
<ci> x </ci>
</bvar>
+ <bvar>
+ <ci> y </ci>
+ </bvar>
<apply>
- <power/>
+ <times/>
<ci> x </ci>
- <cn type="integer"> 3 </cn>
+ <ci> y </ci>
</apply>
</lambda>
</math>
Added: trunk/sbmldemo/src/read/test/test-data/testLevel2.xml
===================================================================
--- trunk/sbmldemo/src/read/test/test-data/testLevel2.xml (rev 0)
+++ trunk/sbmldemo/src/read/test/test-data/testLevel2.xml 2009-10-06 14:48:46 UTC (rev 10204)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2" level="2" version="1"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ <model>
+ <listOfFunctionDefinitions>
+ <functionDefinition id="fd">
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <lambda>
+ <bvar>
+ <ci> x </ci>
+ </bvar>
+ <apply>
+ <power/>
+ <ci> x </ci>
+ <cn type="integer"> 3 </cn>
+ </apply>
+ </lambda>
+ </math>
+ </functionDefinition>
+ <functionDefinition id="fd1">
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <lambda>
+ <bvar>
+ <ci> x </ci>
+ </bvar>
+ <bvar>
+ <ci> y </ci>
+ </bvar>
+ <apply>
+ <times/>
+ <ci> x </ci>
+ <ci> y </ci>
+ </apply>
+ </lambda>
+ </math>
+ </functionDefinition>
+ </listOfFunctionDefinitions>
+ </model>
+</sbml>
Modified: trunk/sbmldemo/src/read/test/testRead.m
===================================================================
--- trunk/sbmldemo/src/read/test/testRead.m 2009-10-06 14:27:53 UTC (rev 10203)
+++ trunk/sbmldemo/src/read/test/testRead.m 2009-10-06 14:48:46 UTC (rev 10204)
@@ -2,7 +2,6 @@
numTests = 0;
numPasses = 0;
-%testReadFunctionDefinition();
numPasses = numPasses + testReadUnitDefinition();
numTests = numTests + 1;
@@ -20,6 +19,13 @@
numTests = numTests + 1;
numPasses = numPasses + testReadEvent();
numTests = numTests + 1;
+numPasses = numPasses + testReadRule();
+numTests = numTests + 1;
+numPasses = numPasses + testReadFunctionDefinition();
+numTests = numTests + 1;
+numPasses = numPasses + testReadLevel2();
+numTests = numTests + 1;
+
disp(sprintf('\n******************************\n%g%% tests passed', ...
(numPasses/numTests)*100));
Modified: trunk/sbmldemo/src/read/test/testReadFunctionDefinition.m
===================================================================
--- trunk/sbmldemo/src/read/test/testReadFunctionDefinition.m 2009-10-06 14:27:53 UTC (rev 10203)
+++ trunk/sbmldemo/src/read/test/testReadFunctionDefinition.m 2009-10-06 14:48:46 UTC (rev 10204)
@@ -1,4 +1,4 @@
-function testReadFunctionDefinition
+function pass = testReadFunctionDefinition
filename = fullfile(pwd, 'test-data', 'testFunctionDefinition.xml');
s = readSBML(filename);
@@ -8,25 +8,38 @@
testName = {'Number FunctionDefinitions'
'FunctionDefinition(1) id'
'FunctionDefinition(1) name'
+ 'FunctionDefinition(1) math equation'
+ 'FunctionDefinition(1) math implementation'
'FunctionDefinition(2) id'
'FunctionDefinition(2) name'
+ 'FunctionDefinition(2) math equation'
+ 'FunctionDefinition(2) math implementation'
};
tests = {{'fail_unless_equal', length(m.functionDefinition), 2}
{'fail_unless_equal', m.functionDefinition(1).id, 'fd'}
+ {'fail_unless_equal', m.functionDefinition(1).name, ''}
+ {'fail_unless_equal', m.functionDefinition(1).math.equation, 'fd(x)=x^3'}
+ {'fail_unless_equal', m.functionDefinition(1).math.implementation, 'x^3'}
{'fail_unless_equal', m.functionDefinition(2).id, 'fd1'}
- {'fail_unless_equal', m.functionDefinition(1).name, ''}
{'fail_unless_equal', m.functionDefinition(2).name, ''}
+ {'fail_unless_equal', m.functionDefinition(2).math.equation, 'fd1(x,y)=x*y'}
+ {'fail_unless_equal', m.functionDefinition(2).math.implementation, 'x*y'}
};
% run tests
numTests = 0;
passes = 0;
-disp('Test FunctionDefinition');
+disp(sprintf('\n*****************\nTest FunctionDefinition'));
for i=1:length(tests)
input1 = tests{i};
- input1{4} = numTests;
- input1{5} = passes;
+ if (length(input1) == 3)
+ input1{4} = numTests;
+ input1{5} = passes;
+ else
+ input1{3} = numTests;
+ input1{4} = passes;
+ end;
[passes, numTests, fail] = testFunction(input1);
if (fail == 1)
disp(sprintf('%s failed', testName{i}));
@@ -36,3 +49,9 @@
end;
disp(sprintf('%g%% tests passed', (passes/numTests)*100));
+
+if (passes == numTests)
+ pass = 1;
+else
+ pass = 0;
+end;
Added: trunk/sbmldemo/src/read/test/testReadLevel2.m
===================================================================
--- trunk/sbmldemo/src/read/test/testReadLevel2.m (rev 0)
+++ trunk/sbmldemo/src/read/test/testReadLevel2.m 2009-10-06 14:48:46 UTC (rev 10204)
@@ -0,0 +1,41 @@
+function pass = testReadLevel2
+
+filename = fullfile(pwd, 'test-data', 'testLevel2.xml');
+s = readSBML(filename);
+
+m = s.model;
+% list the tests to be made
+testName = {'Invalid message'
+ };
+tests = {{'fail_unless_equal', m.message, 'Cannot deal with this Level/Version of SBML'}
+ };
+
+
+% run tests
+numTests = 0;
+passes = 0;
+disp(sprintf('\n*****************\nTest Level 2'));
+for i=1:length(tests)
+ input1 = tests{i};
+ if (length(input1) == 3)
+ input1{4} = numTests;
+ input1{5} = passes;
+ else
+ input1{3} = numTests;
+ input1{4} = passes;
+ end;
+ [passes, numTests, fail] = testFunction(input1);
+ if (fail == 1)
+ disp(sprintf('%s failed', testName{i}));
+ else
+ disp(sprintf('%s passed', testName{i}));
+ end;
+ end;
+
+disp(sprintf('%g%% tests passed', (passes/numTests)*100));
+
+if (passes == numTests)
+ pass = 1;
+else
+ pass = 0;
+end;
Modified: trunk/sbmldemo/src/read/test/testReadRule.m
===================================================================
--- trunk/sbmldemo/src/read/test/testReadRule.m 2009-10-06 14:27:53 UTC (rev 10203)
+++ trunk/sbmldemo/src/read/test/testReadRule.m 2009-10-06 14:48:46 UTC (rev 10204)
@@ -7,19 +7,25 @@
% list the tests to be made
testName = {'Number Rules'
'Rule(1) variable'
- 'Rule(1) math'
+ 'Rule(1) math equation'
+ 'Rule(1) math implementation'
'Rule(2) variable'
- 'Rule(2) math'
+ 'Rule(2) math equation'
+ 'Rule(2) math implementation'
'Rule(3) variable'
- 'Rule(3) math'
+ 'Rule(3) math equation'
+ 'Rule(3) math implementation'
};
tests = {{'fail_unless_equal', length(m.rule), 3}
{'fail_unless_equal', m.rule(1).variable, ''}
- {'fail_unless_equal', m.rule(1).math, 'power(x,3)'}
+ {'fail_unless_equal', m.rule(1).math.equation, 'x^3'}
+ {'fail_unless_equal', m.rule(1).math.implementation, 'x^3'}
{'fail_unless_equal', m.rule(2).variable, 'p2'}
- {'fail_unless_equal', m.rule(2).math, 'times(x,p3)'}
+ {'fail_unless_equal', m.rule(2).math.equation, 'x*p3'}
+ {'fail_unless_equal', m.rule(2).math.implementation, 'x*p3'}
{'fail_unless_equal', m.rule(3).variable, 'p3'}
- {'fail_unless_equal', m.rule(3).math, 'divide(p1,p)'}
+ {'fail_unless_equal', m.rule(3).math.equation, 'p1/p'}
+ {'fail_unless_equal', m.rule(3).math.implementation, 'p1/p'}
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-06 14:28:04
|
Revision: 10203
http://sbml.svn.sourceforge.net/sbml/?rev=10203&view=rev
Author: sarahkeating
Date: 2009-10-06 14:27:53 +0000 (Tue, 06 Oct 2009)
Log Message:
-----------
took the SBML specific code (i.e. code that depends on level/version/packages) and put it in a separate file
Modified Paths:
--------------
trunk/sbmldemo/src/read/readSBML.m
Added Paths:
-----------
trunk/sbmldemo/src/read/GetStructure.m
Added: trunk/sbmldemo/src/read/GetStructure.m
===================================================================
--- trunk/sbmldemo/src/read/GetStructure.m (rev 0)
+++ trunk/sbmldemo/src/read/GetStructure.m 2009-10-06 14:27:53 UTC (rev 10203)
@@ -0,0 +1,289 @@
+function object = getStructure(name, sbmlInfo)
+
+% this function needs to contain all possible element names from an SBML file
+modelStructure = loadAttributes(sbmlInfo);
+
+% check that a valid model has been generated
+if (isempty(modelStructure))
+ object = struct();
+ return;
+end;
+
+if (strcmp(name, 'model'))
+ object = struct();
+ parent = modelStructure.model;
+ for i=1:length(parent.names)
+ if (ischar(parent.values{i}))
+ object.(parent.names{i}) = parent.values{i};
+ else
+ object.(parent.names{i}) = getStructure(parent.names{i}, sbmlInfo);
+ end;
+ end;
+ return;
+end;
+
+switch name
+ case 'listOfFunctionDefinitions'
+ object = 'functionDefinition';
+ case 'listOfUnits'
+ object = 'unit';
+ case 'listOfUnitDefinitions'
+ object = 'unitDefinition';
+ case 'listOfCompartments'
+ object = 'compartment';
+ case 'listOfSpecies'
+ object = 'species';
+ case 'listOfParameters'
+ object = 'parameter';
+ case 'listOfInitialAssignments'
+ object = 'initialAssignment';
+ case 'listOfRules'
+ object = 'rule';
+ case 'listOfConstraints'
+ object = 'constraint';
+ case 'listOfReactions'
+ object = 'reaction';
+ case 'listOfEvents'
+ object = 'event';
+ case 'listOfEventAssignments'
+ object = 'eventAssignment';
+ case 'listOfProducts'
+ object = 'product';
+ case 'listOfReactants'
+ object = 'reactant';
+ case 'listOfModifiers'
+ object = 'modifier';
+ case 'listOfLocalParameters'
+ object = 'localParameter';
+ case 'math'
+ object = 'math';
+ case 'functionDefinition'
+ object = struct();
+ parent = modelStructure.listOfFunctionDefinitions.functionDefinition;
+ case 'unit'
+ object = struct();
+ parent = modelStructure.listOfUnitDefinitions.unitDefinition.values{3};
+ case 'unitDefinition'
+ object = struct();
+ parent = modelStructure.listOfUnitDefinitions.unitDefinition;
+ case 'compartment'
+ object = struct();
+ parent = modelStructure.listOfCompartments.compartment;
+ case 'species'
+ object = struct();
+ parent = modelStructure.listOfSpecies.species;
+ case 'parameter'
+ object = struct();
+ parent = modelStructure.listOfParameters.parameter;
+ case 'initialAssignment'
+ object = struct();
+ parent = modelStructure.listOfInitialAssignments.initialAssignment;
+ case 'rule'
+ object = struct();
+ parent = modelStructure.listOfRules.rule;
+ case 'assignmentRule'
+ object = struct();
+ parent = modelStructure.listOfRules.rule;
+ case 'rateRule'
+ object = struct();
+ parent = modelStructure.listOfRules.rule;
+ case 'algebraicRule'
+ object = struct();
+ parent = modelStructure.listOfRules.rule;
+ case 'constraint'
+ object = struct();
+ parent = modelStructure.listOfConstraints.constraint;
+ case 'reactant'
+ object = struct();
+ parent = modelStructure.listOfReactions.reaction.values{6};
+ case 'product'
+ object = struct();
+ parent = modelStructure.listOfReactions.reaction.values{7};
+ case 'modifier'
+ object = struct();
+ parent = modelStructure.listOfReactions.reaction.values{8};
+ case 'kineticLaw'
+ object = struct();
+ parent = modelStructure.listOfReactions.reaction.values{9};
+ case 'localParameter'
+ object = struct();
+ parent = modelStructure.listOfReactions.reaction.values{9}.values{2};
+ case 'reaction'
+ object = struct();
+ parent = modelStructure.listOfReactions.reaction;
+ case 'event'
+ object = struct();
+ parent = modelStructure.listOfEvents.event;
+ case 'eventAssignment'
+ object = struct();
+ parent = modelStructure.listOfEvents.event.values{6};
+ case 'trigger'
+ object = struct();
+ parent = modelStructure.listOfEvents.event.values{4};
+ case 'delay'
+ object = struct();
+ parent = modelStructure.listOfEvents.event.values{5};
+ otherwise
+end;
+
+if (isstruct(object))
+ for i=1:length(parent.names)
+ if (isstruct(parent.values{i}))
+ object.(parent.names{i}) = getStructure(parent.names{i}, sbmlInfo);
+ else
+ object.(parent.names{i}) = parent.values{i};
+ end;
+ end;
+end;
+
+%%
+function modelStructure = loadAttributes(sbmlInfo)
+% this function needs to detail the structures for all possible levels
+% versions packages
+
+% currently there is no information for anything except L3V1Core
+
+if (sbmlInfo.level ~= '3')
+ modelStructure = [];
+ return;
+elseif (sbmlInfo.version ~= '1')
+ modelStructure = [];
+ return;
+end;
+functionDefinition = struct();
+functionDefinition.names = {'id', 'name', 'math'};
+functionDefinition.values = {'', '', ''};
+
+unit = struct();
+unit.names = {'kind', 'exponent', 'scale', 'multiplier'};
+unit.values = {'', NaN, NaN, NaN};
+
+unitDefinition = struct();
+unitDefinition.names = {'id', 'name', 'unit'};
+unitDefinition.values = {'', '', unit};
+
+compartment = struct();
+compartment.names = {'id', 'name', 'spatialDimensions', 'size', ...
+ 'units', 'constant'};
+compartment.values = {'', '', NaN, NaN, '', ''};
+
+species = struct();
+species.names = {'id', 'name', 'compartment', 'initialAmount', ...
+ 'initialConcentration', 'substanceUnits','hasOnlySubstanceUnits', ...
+ 'boundaryCondition', 'constant'};
+species.values = {'', '', '', NaN, NaN, '', '', '', ''};
+
+parameter = struct();
+parameter.names = {'id', 'name', 'value', 'units', 'constant'};
+parameter.values = {'', '', NaN, '', ''};
+
+initialAssignment = struct();
+initialAssignment.names = {'symbol', 'math'};
+initialAssignment.values = {'', ''};
+
+constraint = struct();
+constraint.names = {'math'};
+constraint.values = {''};
+
+product = struct();
+product.names = {'id', 'name', 'species', 'stoichiometry' ...
+ 'conversionFactor'};
+product.values = {'', '', '', NaN, ''};
+
+reactant = struct();
+reactant.names = {'id', 'name', 'species', 'stoichiometry' ...
+ 'conversionFactor'};
+reactant.values = {'', '', '', NaN, ''};
+
+modifier = struct();
+modifier.names = {'id', 'name', 'species'};
+modifier.values = {'', '', ''};
+
+localParameter = struct();
+localParameter.names = {'id', 'name', 'value', 'units'};
+localParameter.values = {'', '', NaN, ''};
+
+kineticLaw = struct();
+kineticLaw.names = {'math', 'localParameter'};
+kineticLaw.values = {'', localParameter};
+
+reaction = struct();
+reaction.names = {'id', 'name', 'reversible', 'fast', 'compartment', ...
+ 'reactant', 'product', 'modifier', 'kineticLaw'};
+reaction.values = {'', '', '', '', '', reactant, product, ...
+ modifier, kineticLaw};
+
+trigger = struct();
+trigger.names = {'math'};
+trigger.values = {''};
+
+delay = struct();
+delay.names = {'math'};
+delay.values = {''};
+
+
+eventAssignment = struct();
+eventAssignment.names = {'variable', 'math'};
+eventAssignment.values = {'', ''};
+
+event = struct();
+event.names = {'id', 'name', 'useValuesFromTriggerTime', 'trigger', ...
+ 'delay', 'eventAssignment'};
+event.values = {'', '', '', trigger, delay, eventAssignment};
+
+rule = struct();
+rule.names = {'variable', 'math'};
+rule.values = {'', ''};
+
+model = struct();
+model.names = {'id', 'name', 'substanceUnits', 'timeUnits', 'volumeUnits', ...
+ 'areaUnits', 'lengthUnits', 'extentUnits', 'functionDefinition', ...
+ 'unitDefinition', 'compartment', 'species', 'parameter', ...
+ 'initialAssignment', 'rule', 'constraint', 'reaction', 'event'};
+model.values = {'', '', '', '', '', '', '', '', functionDefinition, ...
+ unitDefinition, compartment, species, parameter, initialAssignment, ...
+ rule, constraint, reaction, event};
+
+listOfFunctionDefinitions = struct();
+listOfFunctionDefinitions.functionDefinition = functionDefinition;
+
+listOfUnitDefinitions = struct();
+listOfUnitDefinitions.unitDefinition = unitDefinition;
+
+listOfCompartments = struct();
+listOfCompartments.compartment = compartment;
+
+listOfSpecies = struct();
+listOfSpecies.species = species;
+
+listOfParameters = struct();
+listOfParameters.parameter = parameter;
+
+listOfInitialAssignments = struct();
+listOfInitialAssignments.initialAssignment = initialAssignment;
+
+listOfRules = struct();
+listOfRules.rule = rule;
+
+listOfConstraints = struct();
+listOfConstraints.constraint = constraint;
+
+listOfReactions = struct();
+listOfReactions.reaction = reaction;
+
+listOfEvents = struct();
+listOfEvents.event = event;
+
+
+modelStructure = struct();
+modelStructure.listOfFunctionDefinitions = listOfFunctionDefinitions;
+modelStructure.listOfUnitDefinitions = listOfUnitDefinitions;
+modelStructure.listOfCompartments = listOfCompartments;
+modelStructure.listOfSpecies = listOfSpecies;
+modelStructure.listOfParameters = listOfParameters;
+modelStructure.listOfInitialAssignments = listOfInitialAssignments;
+modelStructure.listOfRules = listOfRules;
+modelStructure.listOfConstraints = listOfConstraints;
+modelStructure.listOfReactions = listOfReactions;
+modelStructure.listOfEvents = listOfEvents;
+modelStructure.model = model;
Modified: trunk/sbmldemo/src/read/readSBML.m
===================================================================
--- trunk/sbmldemo/src/read/readSBML.m 2009-10-06 09:51:50 UTC (rev 10202)
+++ trunk/sbmldemo/src/read/readSBML.m 2009-10-06 14:27:53 UTC (rev 10203)
@@ -204,279 +204,5 @@
end;
parent.package(index) = package;
-%%
-function object = getStructure(name, sbmlInfo)
-% this function needs to contain all possible element names from an SBML file
-modelStructure = loadAttributes(sbmlInfo);
-if (strcmp(name, 'model'))
- object = struct();
- parent = modelStructure.model;
- for i=1:length(parent.names)
- if (ischar(parent.values{i}))
- object.(parent.names{i}) = parent.values{i};
- else
- object.(parent.names{i}) = getStructure(parent.names{i}, sbmlInfo);
- end;
- end;
- return;
-end;
-switch name
- case 'listOfFunctionDefinitions'
- object = 'functionDefinition';
- case 'listOfUnits'
- object = 'unit';
- case 'listOfUnitDefinitions'
- object = 'unitDefinition';
- case 'listOfCompartments'
- object = 'compartment';
- case 'listOfSpecies'
- object = 'species';
- case 'listOfParameters'
- object = 'parameter';
- case 'listOfInitialAssignments'
- object = 'initialAssignment';
- case 'listOfRules'
- object = 'rule';
- case 'listOfConstraints'
- object = 'constraint';
- case 'listOfReactions'
- object = 'reaction';
- case 'listOfEvents'
- object = 'event';
- case 'listOfEventAssignments'
- object = 'eventAssignment';
- case 'listOfProducts'
- object = 'product';
- case 'listOfReactants'
- object = 'reactant';
- case 'listOfModifiers'
- object = 'modifier';
- case 'listOfLocalParameters'
- object = 'localParameter';
- case 'math'
- object = 'math';
- case 'functionDefinition'
- object = struct();
- parent = modelStructure.listOfFunctionDefinitions.functionDefinition;
- case 'unit'
- object = struct();
- parent = modelStructure.listOfUnitDefinitions.unitDefinition.values{3};
- case 'unitDefinition'
- object = struct();
- parent = modelStructure.listOfUnitDefinitions.unitDefinition;
- case 'compartment'
- object = struct();
- parent = modelStructure.listOfCompartments.compartment;
- case 'species'
- object = struct();
- parent = modelStructure.listOfSpecies.species;
- case 'parameter'
- object = struct();
- parent = modelStructure.listOfParameters.parameter;
- case 'initialAssignment'
- object = struct();
- parent = modelStructure.listOfInitialAssignments.initialAssignment;
- case 'rule'
- object = struct();
- parent = modelStructure.listOfRules.rule;
- case 'assignmentRule'
- object = struct();
- parent = modelStructure.listOfRules.rule;
- case 'rateRule'
- object = struct();
- parent = modelStructure.listOfRules.rule;
- case 'algebraicRule'
- object = struct();
- parent = modelStructure.listOfAlgebraicRules.algebraicRule;
- case 'constraint'
- object = struct();
- parent = modelStructure.listOfConstraints.constraint;
- case 'reactant'
- object = struct();
- parent = modelStructure.listOfReactions.reaction.values{6};
- case 'product'
- object = struct();
- parent = modelStructure.listOfReactions.reaction.values{7};
- case 'modifier'
- object = struct();
- parent = modelStructure.listOfReactions.reaction.values{8};
- case 'kineticLaw'
- object = struct();
- parent = modelStructure.listOfReactions.reaction.values{9};
- case 'localParameter'
- object = struct();
- parent = modelStructure.listOfReactions.reaction.values{9}.values{2};
- case 'reaction'
- object = struct();
- parent = modelStructure.listOfReactions.reaction;
- case 'event'
- object = struct();
- parent = modelStructure.listOfEvents.event;
- case 'eventAssignment'
- object = struct();
- parent = modelStructure.listOfEvents.event.values{6};
- case 'trigger'
- object = struct();
- parent = modelStructure.listOfEvents.event.values{4};
- case 'delay'
- object = struct();
- parent = modelStructure.listOfEvents.event.values{5};
- otherwise
-end;
-
-if (isstruct(object))
- for i=1:length(parent.names)
- if (isstruct(parent.values{i}))
- object.(parent.names{i}) = getStructure(parent.names{i}, sbmlInfo);
- else
- object.(parent.names{i}) = parent.values{i};
- end;
- end;
-end;
-
-%%
-function modelStructure = loadAttributes(sbmlInfo)
-% this function needs to detail the structures for all possible levels
-% versions packages
-
-functionDefinition = struct();
-functionDefinition.names = {'id', 'name', 'math'};
-functionDefinition.values = {'', '', ''};
-
-unit = struct();
-unit.names = {'kind', 'exponent', 'scale', 'multiplier'};
-unit.values = {'', NaN, NaN, NaN};
-
-unitDefinition = struct();
-unitDefinition.names = {'id', 'name', 'unit'};
-unitDefinition.values = {'', '', unit};
-
-compartment = struct();
-compartment.names = {'id', 'name', 'spatialDimensions', 'size', ...
- 'units', 'constant'};
-compartment.values = {'', '', NaN, NaN, '', ''};
-
-species = struct();
-species.names = {'id', 'name', 'compartment', 'initialAmount', ...
- 'initialConcentration', 'substanceUnits','hasOnlySubstanceUnits', ...
- 'boundaryCondition', 'constant'};
-species.values = {'', '', '', NaN, NaN, '', '', '', ''};
-
-parameter = struct();
-parameter.names = {'id', 'name', 'value', 'units', 'constant'};
-parameter.values = {'', '', NaN, '', ''};
-
-initialAssignment = struct();
-initialAssignment.names = {'symbol', 'math'};
-initialAssignment.values = {'', ''};
-
-constraint = struct();
-constraint.names = {'math'};
-constraint.values = {''};
-
-product = struct();
-product.names = {'id', 'name', 'species', 'stoichiometry' ...
- 'conversionFactor'};
-product.values = {'', '', '', NaN, ''};
-
-reactant = struct();
-reactant.names = {'id', 'name', 'species', 'stoichiometry' ...
- 'conversionFactor'};
-reactant.values = {'', '', '', NaN, ''};
-
-modifier = struct();
-modifier.names = {'id', 'name', 'species'};
-modifier.values = {'', '', ''};
-
-localParameter = struct();
-localParameter.names = {'id', 'name', 'value', 'units'};
-localParameter.values = {'', '', NaN, ''};
-
-kineticLaw = struct();
-kineticLaw.names = {'math', 'localParameter'};
-kineticLaw.values = {'', localParameter};
-
-reaction = struct();
-reaction.names = {'id', 'name', 'reversible', 'fast', 'compartment', ...
- 'reactant', 'product', 'modifier', 'kineticLaw'};
-reaction.values = {'', '', '', '', '', reactant, product, ...
- modifier, kineticLaw};
-
-trigger = struct();
-trigger.names = {'math'};
-trigger.values = {''};
-
-delay = struct();
-delay.names = {'math'};
-delay.values = {''};
-
-
-eventAssignment = struct();
-eventAssignment.names = {'variable', 'math'};
-eventAssignment.values = {'', ''};
-
-event = struct();
-event.names = {'id', 'name', 'useValuesFromTriggerTime', 'trigger', ...
- 'delay', 'eventAssignment'};
-event.values = {'', '', '', trigger, delay, eventAssignment};
-
-rule = struct();
-rule.names = {'variable', 'math'};
-rule.values = {'', ''};
-
-model = struct();
-model.names = {'id', 'name', 'substanceUnits', 'timeUnits', 'volumeUnits', ...
- 'areaUnits', 'lengthUnits', 'extentUnits', 'functionDefinition', ...
- 'unitDefinition', 'compartment', 'species', 'parameter', ...
- 'initialAssignment', 'rule', 'constraint', 'reaction', 'event'};
-model.values = {'', '', '', '', '', '', '', '', functionDefinition, ...
- unitDefinition, compartment, species, parameter, initialAssignment, ...
- rule, constraint, reaction, event};
-
-listOfFunctionDefinitions = struct();
-listOfFunctionDefinitions.functionDefinition = functionDefinition;
-
-listOfUnitDefinitions = struct();
-listOfUnitDefinitions.unitDefinition = unitDefinition;
-
-listOfCompartments = struct();
-listOfCompartments.compartment = compartment;
-
-listOfSpecies = struct();
-listOfSpecies.species = species;
-
-listOfParameters = struct();
-listOfParameters.parameter = parameter;
-
-listOfInitialAssignments = struct();
-listOfInitialAssignments.initialAssignment = initialAssignment;
-
-listOfRules = struct();
-listOfRules.rule = rule;
-
-listOfConstraints = struct();
-listOfConstraints.constraint = constraint;
-
-listOfReactions = struct();
-listOfReactions.reaction = reaction;
-
-listOfEvents = struct();
-listOfEvents.event = event;
-
-
-modelStructure = struct();
-modelStructure.listOfFunctionDefinitions = listOfFunctionDefinitions;
-modelStructure.listOfUnitDefinitions = listOfUnitDefinitions;
-modelStructure.listOfCompartments = listOfCompartments;
-modelStructure.listOfSpecies = listOfSpecies;
-modelStructure.listOfParameters = listOfParameters;
-modelStructure.listOfInitialAssignments = listOfInitialAssignments;
-modelStructure.listOfRules = listOfRules;
-modelStructure.listOfConstraints = listOfConstraints;
-modelStructure.listOfReactions = listOfReactions;
-modelStructure.listOfEvents = listOfEvents;
-modelStructure.model = model;
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2009-10-06 09:51:59
|
Revision: 10202
http://sbml.svn.sourceforge.net/sbml/?rev=10202&view=rev
Author: sarahkeating
Date: 2009-10-06 09:51:50 +0000 (Tue, 06 Oct 2009)
Log Message:
-----------
in Level 2 stoichiometry has a default value which may be absent in the file BUT is still technically set and so isSetStoichiometry should return true.
Thanks to Frank Bergmann for reporting this.
Modified Paths:
--------------
trunk/libsbml/src/sbml/SpeciesReference.cpp
Modified: trunk/libsbml/src/sbml/SpeciesReference.cpp
===================================================================
--- trunk/libsbml/src/sbml/SpeciesReference.cpp 2009-10-05 03:48:41 UTC (rev 10201)
+++ trunk/libsbml/src/sbml/SpeciesReference.cpp 2009-10-06 09:51:50 UTC (rev 10202)
@@ -489,6 +489,12 @@
{
mStoichiometry = numeric_limits<double>::quiet_NaN();
}
+
+ // if level 1/2 stoichiometry is set by default
+ if (level < 3)
+ {
+ setStoichiometry(1.0);
+ }
}
SpeciesReference::SpeciesReference (SBMLNamespaces *sbmlns) :
@@ -508,6 +514,12 @@
{
mStoichiometry = numeric_limits<double>::quiet_NaN();
}
+
+ // if level 1/2 stoichiometry is set by default
+ if (sbmlns->getLevel() < 3)
+ {
+ setStoichiometry(1.0);
+ }
}
/** @cond doxygen-libsbml-internal */
@@ -1101,6 +1113,8 @@
SBMLDocument::getDefaultLevel(),
SBMLDocument::getDefaultVersion());
}
+ // clear the default value for stoichiometry
+ unsetStoichiometry();
return mStoichiometryMath;
}
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|