ODESFunc.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_ODESFunc_h)
00024 #define octave_ODESFunc_h 1
00025 
00026 #include "dMatrix.h"
00027 
00028 class
00029 ODESFunc
00030 {
00031 public:
00032 
00033   struct DAEJac
00034     {
00035       Matrix *dfdxdot;
00036       Matrix *dfdx;
00037     };
00038 
00039   typedef ColumnVector (*ODES_fsub) (const ColumnVector& x, double,
00040                                      const ColumnVector& theta);
00041 
00042   typedef ColumnVector (*ODES_bsub) (const ColumnVector& x, double,
00043                                      const ColumnVector& theta, int column);
00044 
00045   typedef Matrix (*ODES_jsub) (const ColumnVector& x, double,
00046                                const ColumnVector& theta);
00047 
00048   ODESFunc (void)
00049     : fsub (0), bsub (0), jsub (0) { }
00050 
00051   ODESFunc (ODES_fsub f)
00052     : fsub (f), bsub (0), jsub (0) { }
00053 
00054   ODESFunc (ODES_fsub f, ODES_bsub b)
00055     : fsub (f), bsub (b), jsub (0) { }
00056 
00057   ODESFunc (ODES_fsub f, ODES_bsub b, ODES_jsub j)
00058     : fsub (f), bsub (b), jsub (j) { }
00059 
00060   ODESFunc (const ODESFunc& a)
00061     : fsub (a.fsub), bsub (a.bsub), jsub (a.jsub) { }
00062 
00063   ODESFunc& operator = (const ODESFunc& a)
00064     {
00065       if (this != &a)
00066         {
00067           fsub = a.fsub;
00068           bsub = a.bsub;
00069           jsub = a.jsub;
00070         }
00071       return *this;
00072     }
00073 
00074   virtual ~ODESFunc (void) { }
00075 
00076   ODES_fsub fsub_function (void) const { return fsub; }
00077 
00078   ODESFunc& set_fsub_function (ODES_fsub f)
00079     {
00080       fsub = f;
00081       return *this;
00082     }
00083 
00084   ODES_bsub bsub_function (void) const { return bsub; }
00085 
00086   ODESFunc& set_bsub_function (ODES_bsub b)
00087     {
00088       bsub = b;
00089       return *this;
00090     }
00091 
00092   ODES_jsub jsub_function (void) const { return jsub; }
00093 
00094   ODESFunc& set_jsub_function (ODES_jsub j)
00095     {
00096       jsub = j;
00097       return *this;
00098     }
00099 
00100 protected:
00101 
00102   ODES_fsub fsub;
00103   ODES_bsub bsub;
00104   ODES_jsub jsub;
00105 };
00106 
00107 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines