ODES.h

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 2002-2012 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #if !defined (octave_ODES_h)
00024 #define octave_ODES_h 1
00025 
00026 #include "ODESFunc.h"
00027 #include "base-de.h"
00028 
00029 class
00030 ODES : public base_diff_eqn, public ODESFunc
00031 {
00032 public:
00033 
00034   ODES (void)
00035     : base_diff_eqn (), ODESFunc (), xdot (), theta () { }
00036 
00037   ODES (const ColumnVector& s, double tm, ODESFunc& f)
00038     : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.length (), 0.0), theta () { }
00039 
00040   ODES (const ColumnVector& s, const ColumnVector& xtheta, double tm,
00041         ODESFunc& f)
00042     : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.length (), 0.0),
00043       theta (xtheta) { }
00044 
00045   ODES (const ODES& a)
00046     : base_diff_eqn (a), ODESFunc (a), xdot (a.xdot), theta (a.theta) { }
00047 
00048   ODES& operator = (const ODES& a)
00049     {
00050       if (this != &a)
00051         {
00052           base_diff_eqn::operator = (a);
00053           ODESFunc::operator = (a);
00054 
00055           xdot = a.xdot;
00056           theta = a.theta;
00057         }
00058       return *this;
00059     }
00060 
00061   ~ODES (void) { }
00062 
00063   ColumnVector parameter_vector (void) { return theta; }
00064 
00065   void initialize (const ColumnVector& x, double t);
00066 
00067   void initialize (const ColumnVector& x, double t,
00068                    const ColumnVector& theta);
00069 
00070 protected:
00071 
00072   // State vector time derivatives.
00073   ColumnVector xdot;
00074 
00075   // Parameter vector.
00076   ColumnVector theta;
00077 };
00078 
00079 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines