00001 #ifndef INDII_ML_ODE_PARAMETERCOLLECTION_HPP
00002 #define INDII_ML_ODE_PARAMETERCOLLECTION_HPP
00003
00004 #include <vector>
00005
00006 #include "boost/serialization/serialization.hpp"
00007
00008 namespace indii {
00009 namespace ml {
00010 namespace ode {
00011
00012
00013
00014
00015
00016
00017
00018
00019 class ParameterCollection {
00020 public:
00021
00022
00023
00024 ParameterCollection();
00025
00026
00027
00028
00029
00030
00031 ParameterCollection(const unsigned int N);
00032
00033
00034
00035
00036 virtual ~ParameterCollection();
00037
00038
00039
00040
00041
00042
00043
00044
00045 virtual double getParameter(const unsigned int index) const;
00046
00047
00048
00049
00050
00051
00052
00053 virtual void setParameter(const unsigned int index, const double value);
00054
00055 private:
00056
00057
00058
00059 unsigned int N;
00060
00061
00062
00063
00064 std::vector<double> ps;
00065
00066
00067
00068
00069 template<class Archive>
00070 void serialize(Archive& ar, const unsigned int version);
00071
00072
00073
00074
00075 friend class boost::serialization::access;
00076
00077 };
00078
00079 }
00080 }
00081 }
00082
00083 #include <assert.h>
00084
00085 inline
00086 double indii::ml::ode::ParameterCollection::getParameter(
00087 const unsigned int index) const {
00088
00089 assert (index < N);
00090
00091 return ps[index];
00092 }
00093
00094 template<class Archive>
00095 void indii::ml::ode::ParameterCollection::serialize(Archive& ar,
00096 const unsigned int version) {
00097 ar & N;
00098 ar & ps;
00099 }
00100
00101 #endif
00102