Qucs-core  0.0.19
integrator.h
Go to the documentation of this file.
00001 /*
00002  * integrator.h - integrator class definitions
00003  *
00004  * Copyright (C) 2004, 2005, 2006 Stefan Jahn <stefan@lkcc.org>
00005  *
00006  * This is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2, or (at your option)
00009  * any later version.
00010  *
00011  * This software is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this package; see the file COPYING.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  *
00021  * $Id$
00022  *
00023  */
00024 
00025 #ifndef __INTEGRATOR_H__
00026 #define __INTEGRATOR_H__
00027 
00028 #include "states.h"
00029 
00030 #define MODE_NONE 0
00031 #define MODE_INIT 1
00032 
00033 namespace qucs {
00034 
00035 class integrator : public states<nr_double_t>
00036 {
00037  public:
00038   // constructor and destructor set
00039   integrator ();
00040   integrator (const integrator &);
00041   ~integrator ();
00042 
00043   // integration specific
00044   typedef void (* integrate_func_t)
00045     (integrator *, int, nr_double_t, nr_double_t&, nr_double_t&);
00046   void setIntegration (integrate_func_t f) { integrate_func = f; }
00047   typedef void (* conductor_func_t)
00048     (integrator *, nr_double_t, nr_double_t&);
00049   void setConductance (conductor_func_t f) { conductor_func = f; }
00050   void integrate (int, nr_double_t, nr_double_t&, nr_double_t&);
00051   void conductor (nr_double_t, nr_double_t&);
00052   void setOrder (int o) { order = o; }
00053   int  getOrder (void) { return order; }
00054   void setMode (int s) { state = s; }
00055   int  getMode (void) { return state; }
00056   void setCoefficients (nr_double_t * c) { coefficients = c; }
00057   nr_double_t * getCoefficients (void) { return coefficients; }
00058 
00059  private:
00060   int order;
00061   int state;
00062   nr_double_t * coefficients;
00063   integrate_func_t integrate_func;
00064   conductor_func_t conductor_func;
00065 };
00066 
00067 } // namespace qucs
00068 
00069 #endif /* __INTEGRATOR_H__ */