From: Rainer M. <ra...@tb...> - 2010-04-16 16:10:35
|
Thanks! I will integrate it into CVS code. Would you want to have developer access to our sourceforge CVS? Please send me your CVS account name (in a private email!). Ben, would you want a developer access? If yes, please also send me your CVS account (private email). Before submitting major changes, they should be discussed on this list. Of course we can also integrate changes you send to this list ourselves, if you prefer. Rainer On 04/15/2010 12:39 PM, Takeshi Abe wrote: > Hi all, > > After reading SBML's specification, I have realized that events > are significant as much as ODEs/assginments in its simulation > semantics. > Thanks to SOSlib, odeModel.h exposes some API to access the parsed > discontinuity objects, but they seem to be not yet implemented: > SBML_ODESOLVER_API int ODEModel_getNumPiecewise(odeModel_t *); > SBML_ODESOLVER_API int ODEModel_getNumEvents(odeModel_t *); > SBML_ODESOLVER_API const ASTNode_t *ODEModel_getEventTrigger(odeModel_t *, int); > SBML_ODESOLVER_API const ASTNode_t *ODEModel_getEventAssignment(odeModel_t *, int, int); > > The below patch may provide them plus 2 more utils. > If no problem it would be nice applying this to HEAD. > > --- > Index: src/odeModel.c > =================================================================== > RCS file: /cvsroot/sbmlsolver/SBML_odeSolver/src/odeModel.c,v > retrieving revision 1.130 > diff -u -r1.130 odeModel.c > --- src/odeModel.c 12 Apr 2010 08:29:38 -0000 1.130 > +++ src/odeModel.c 15 Apr 2010 10:32:18 -0000 > @@ -1738,6 +1738,44 @@ > > /** @} */ > > +SBML_ODESOLVER_API int ODEModel_getNumPiecewise(odeModel_t *om) > +{ > + return om->npiecewise; > +} > + > +SBML_ODESOLVER_API int ODEModel_getNumEvents(odeModel_t *om) > +{ > + return om->nevents; > +} > + > +SBML_ODESOLVER_API int ODEModel_getNumEventAssignments(odeModel_t *om, int i) > +{ > + if (i < om->nevents) return om->neventAss[i]; > + else return -1; > +} > + > +SBML_ODESOLVER_API const ASTNode_t *ODEModel_getEventTrigger(odeModel_t *om, int i) > +{ > + if (i < om->nevents) return (const ASTNode_t *) om->event[i]; > + else return NULL; > +} > + > +SBML_ODESOLVER_API const ASTNode_t *ODEModel_getEventAssignment(odeModel_t *om, int i, int j) > +{ > + if ( i < om->nevents && j < om->neventAss[i] ) > + return (const ASTNode_t *) om->eventAssignment[i][j]; > + else return NULL; > +} > + > +SBML_ODESOLVER_API const char *ODEModel_getEventAssignmentName(odeModel_t *om, int i, int j) > +{ > + if ( i < om->nevents && j < om->neventAss[i] ) { > + int k = om->eventIndex[i][j]; > + if ( 0 <= k && k < (om->neq+om->nass+om->nconst+om->nalg) ) > + return (const char *)om->names[k]; > + } > + return NULL; > +} > > /*! \defgroup jacobian Jacobian Matrix: J = df(x)/dx > \ingroup odeModel > Index: src/sbmlsolver/odeModel.h > =================================================================== > RCS file: /cvsroot/sbmlsolver/SBML_odeSolver/src/sbmlsolver/odeModel.h,v > retrieving revision 1.55 > diff -u -r1.55 odeModel.h > --- src/sbmlsolver/odeModel.h 27 Mar 2009 15:55:03 -0000 1.55 > +++ src/sbmlsolver/odeModel.h 15 Apr 2010 10:32:18 -0000 > @@ -356,8 +356,10 @@ > /* Discontinuities */ > SBML_ODESOLVER_API int ODEModel_getNumPiecewise(odeModel_t *); > SBML_ODESOLVER_API int ODEModel_getNumEvents(odeModel_t *); > + SBML_ODESOLVER_API int ODEModel_getNumEventAssignments(odeModel_t *, int); > SBML_ODESOLVER_API const ASTNode_t *ODEModel_getEventTrigger(odeModel_t *, int); > SBML_ODESOLVER_API const ASTNode_t *ODEModel_getEventAssignment(odeModel_t *, int, int); > + SBML_ODESOLVER_API const char *ODEModel_getEventAssignmentName(odeModel_t *, int, int); > > > /* ODE Jacobi matrix */ > --- > > Cheers, > -- Takeshi Abe > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > sbmlsolver-discuss mailing list > sbm...@li... > https://lists.sourceforge.net/lists/listinfo/sbmlsolver-discuss |