|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57225 - in sandbox/odeint/boost/numeric/odeint: . concepts
From: mario.mulansky_at_[hidden]
Date: 2009-10-29 10:40:52
Author: mariomulansky
Date: 2009-10-29 10:40:51 EDT (Thu, 29 Oct 2009)
New Revision: 57225
URL: http://svn.boost.org/trac/boost/changeset/57225
Log:
+resizer concept
Text files modified:
sandbox/odeint/boost/numeric/odeint/concepts/state_concept.hpp | 22 ++++++++++++++++++++++
sandbox/odeint/boost/numeric/odeint/euler.hpp | 1 -
sandbox/odeint/boost/numeric/odeint/resizer.hpp | 4 ++++
3 files changed, 26 insertions(+), 1 deletions(-)
Modified: sandbox/odeint/boost/numeric/odeint/concepts/state_concept.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/concepts/state_concept.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/concepts/state_concept.hpp 2009-10-29 10:40:51 EDT (Thu, 29 Oct 2009)
@@ -20,6 +20,7 @@
namespace numeric {
namespace odeint {
+ /* Concept StateType */
template<class X>
struct StateType {
@@ -45,6 +46,27 @@
};
+
+ /* Concept Resizable */
+ template<class X>
+ struct Resizable {
+
+ public:
+
+ //BOOST_CONCEPT_ASSERT((StateType<X>));
+
+ BOOST_CONCEPT_USAGE(Resizable)
+ {
+ state.resize(1); // state has resize function
+ size_t n = 2;
+ state.resize(n);
+ }
+
+ private:
+ X state;
+
+ };
+
} // namespace odeint
} // namespace numeric
} // namespace boost
Modified: sandbox/odeint/boost/numeric/odeint/euler.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/euler.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/euler.hpp 2009-10-29 10:40:51 EDT (Thu, 29 Oct 2009)
@@ -26,7 +26,6 @@
namespace numeric {
namespace odeint {
-
template<
class ContainerType ,
class ResizeType = resizer< ContainerType >
Modified: sandbox/odeint/boost/numeric/odeint/resizer.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/resizer.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/resizer.hpp 2009-10-29 10:40:51 EDT (Thu, 29 Oct 2009)
@@ -22,6 +22,9 @@
template< class ContainerType >
class resizer
{
+ // we need a resizable container here (obviously...)
+ BOOST_CLASS_REQUIRE( ContainerType , boost::numeric::odeint, Resizable );
+
public:
void resize( const ContainerType &x , ContainerType &dxdt ) const
{
@@ -34,6 +37,7 @@
}
};
+ /* Template Specialization for fixed size array - no resizing can happen */
template< class T , size_t N >
class resizer< std::tr1::array< T , N > >
{
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk