|
From: <mor...@us...> - 2010-09-08 10:47:32
|
Revision: 3855
http://ecell.svn.sourceforge.net/ecell/?rev=3855&view=rev
Author: moriyoshi
Date: 2010-09-08 10:47:26 +0000 (Wed, 08 Sep 2010)
Log Message:
-----------
* Fix Stepper so that setStepInterval() can be overridden in the subclass.
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/DifferentialStepper.cpp
ecell3/trunk/ecell/libecs/DifferentialStepper.hpp
ecell3/trunk/ecell/libecs/Stepper.cpp
ecell3/trunk/ecell/libecs/Stepper.hpp
Modified: ecell3/trunk/ecell/libecs/DifferentialStepper.cpp
===================================================================
--- ecell3/trunk/ecell/libecs/DifferentialStepper.cpp 2010-09-08 08:56:43 UTC (rev 3854)
+++ ecell3/trunk/ecell/libecs/DifferentialStepper.cpp 2010-09-08 10:47:26 UTC (rev 3855)
@@ -407,5 +407,11 @@
return new DifferentialStepper::Interpolant( aVariable, this );
}
+SET_METHOD_DEF( Real, StepInterval, DifferentialStepper )
+{
+ Stepper::setStepInterval( value );
+ setTolerableStepInterval( value );
+ setNextStepInterval( value );
+}
} // namespace libecs
Modified: ecell3/trunk/ecell/libecs/DifferentialStepper.hpp
===================================================================
--- ecell3/trunk/ecell/libecs/DifferentialStepper.hpp 2010-09-08 08:56:43 UTC (rev 3854)
+++ ecell3/trunk/ecell/libecs/DifferentialStepper.hpp 2010-09-08 10:47:26 UTC (rev 3855)
@@ -36,6 +36,7 @@
#include "libecs/Stepper.hpp"
#include <boost/multi_array.hpp>
+#include <iostream>
namespace libecs
{
@@ -114,12 +115,7 @@
return theTolerableStepInterval;
}
- virtual void setStepInterval( Real aStepInterval )
- {
- Stepper::setStepInterval( aStepInterval );
- setTolerableStepInterval( aStepInterval );
- setNextStepInterval( aStepInterval );
- }
+ virtual SET_METHOD( Real, StepInterval );
void resetAll();
Modified: ecell3/trunk/ecell/libecs/Stepper.cpp
===================================================================
--- ecell3/trunk/ecell/libecs/Stepper.cpp 2010-09-08 08:56:43 UTC (rev 3854)
+++ ecell3/trunk/ecell/libecs/Stepper.cpp 2010-09-08 10:47:26 UTC (rev 3855)
@@ -572,6 +572,10 @@
}
}
+SET_METHOD_DEF( Real, StepInterval, Stepper )
+{
+ setNextTime( getCurrentTime() + value );
+}
SET_METHOD_DEF( String, RngSeed, Stepper )
{
Modified: ecell3/trunk/ecell/libecs/Stepper.hpp
===================================================================
--- ecell3/trunk/ecell/libecs/Stepper.hpp 2010-09-08 08:56:43 UTC (rev 3854)
+++ ecell3/trunk/ecell/libecs/Stepper.hpp 2010-09-08 10:47:26 UTC (rev 3855)
@@ -146,7 +146,7 @@
@return the step interval of this Stepper
*/
- virtual GET_METHOD( Real, StepInterval )
+ GET_METHOD( Real, StepInterval )
{
const Real aNextTime( getNextTime() );
const Real aCurrentTime( getCurrentTime() );
@@ -157,10 +157,7 @@
return aNextTime - aCurrentTime;
}
- SET_METHOD( Real, StepInterval )
- {
- setNextTime( getCurrentTime() + value );
- }
+ virtual SET_METHOD( Real, StepInterval );
/**
This may be overridden in dynamically scheduled steppers.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|