DASRT.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_DASRT_h)
00024 #define octave_DASRT_h 1
00025 
00026 #include <cfloat>
00027 
00028 #include "DASRT-opts.h"
00029 #include "lo-math.h"
00030 
00031 class
00032 DASRT_result
00033 {
00034 public:
00035 
00036   DASRT_result (void)
00037     : x (), xdot (), t () { }
00038 
00039   DASRT_result (const Matrix& xx, const Matrix& xxdot, const ColumnVector& tt)
00040     : x (xx), xdot (xxdot), t (tt) { }
00041 
00042   DASRT_result (const DASRT_result& r)
00043     : x (r.x), xdot (r.xdot), t (r.t) { }
00044 
00045   DASRT_result& operator = (const DASRT_result& r)
00046     {
00047       if (this != &r)
00048         {
00049           x = r.x;
00050           xdot = r.xdot;
00051           t = r.t;
00052         }
00053       return *this;
00054     }
00055 
00056   ~DASRT_result (void) { }
00057 
00058   Matrix state (void) const { return x; }
00059   Matrix deriv (void) const { return xdot; }
00060   ColumnVector times (void) const { return t; }
00061 
00062 private:
00063 
00064   Matrix x;
00065   Matrix xdot;
00066   ColumnVector t;
00067 };
00068 
00069 class
00070 OCTAVE_API
00071 DASRT : public DAERT, public DASRT_options
00072 {
00073 public:
00074 
00075   DASRT (void)
00076     : DAERT (), DASRT_options (), initialized (false),
00077       liw (0), lrw (0), ng (0), info (), iwork (), jroot (), rwork (),
00078       abs_tol (), rel_tol ()
00079     { }
00080 
00081   DASRT (const ColumnVector& s, double tm, DAERTFunc& f)
00082     : DAERT (s, tm, f), DASRT_options (), initialized (false),
00083       liw (0), lrw (0), ng (0), info (), iwork (), jroot (), rwork (),
00084       abs_tol (), rel_tol ()
00085     { }
00086 
00087   DASRT (const ColumnVector& s, const ColumnVector& deriv,
00088          double tm, DAERTFunc& f)
00089     : DAERT (s, deriv, tm, f), DASRT_options (), initialized (false),
00090       liw (0), lrw (0), ng (0), info (), iwork (), jroot (), rwork (),
00091       abs_tol (), rel_tol ()
00092     { }
00093 
00094   ~DASRT (void) { }
00095 
00096   DASRT_result integrate (const ColumnVector& tout);
00097 
00098   DASRT_result integrate (const ColumnVector& tout,
00099                           const ColumnVector& tcrit);
00100 
00101   std::string error_message (void) const;
00102 
00103 private:
00104 
00105   bool initialized;
00106 
00107   octave_idx_type liw;
00108   octave_idx_type lrw;
00109 
00110   octave_idx_type ng;
00111 
00112   Array<octave_idx_type> info;
00113   Array<octave_idx_type> iwork;
00114   Array<octave_idx_type> jroot;
00115 
00116   Array<double> rwork;
00117 
00118   Array<double> abs_tol;
00119   Array<double> rel_tol;
00120 
00121   void integrate (double t);
00122 };
00123 
00124 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines