My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
analysis.h
Go to the documentation of this file.
1 /*
2  * analysis.h - analysis class definitions
3  *
4  * Copyright (C) 2003, 2004, 2005, 2006, 2007 Stefan Jahn <stefan@lkcc.org>
5  *
6  * This is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This software is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this package; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * $Id: analysis.h 1825 2011-03-11 20:42:14Z ela $
22  *
23  */
24 
25 #ifndef __ANALYSIS_H__
26 #define __ANALYSIS_H__
27 
28 #define SAVE_OPS 1 // save operating points
29 #define SAVE_ALL 2 // also save subcircuit nodes and operating points
30 #define SAVE_CVS 4 // save characteristic values
31 
32 #define ACREATOR(val) \
33  val (); \
34  static analysis * create (void) { return new val (); } \
35  static struct define_t anadef; \
36  static struct define_t * definition (void) { return &anadef; }
37 
38 class dataset;
39 class net;
40 class object;
41 class environment;
42 class sweep;
43 template <class type_t> class ptrlist;
44 
53 };
54 
55 class analysis : public object
56 {
57  public:
58  analysis ();
59  analysis (char *);
60  analysis (analysis &);
61  ~analysis ();
62  virtual int solve (void) { return 0; }
63  virtual int initialize (void) { return 0; }
64  virtual int cleanup (void) { return 0; }
65  dataset * getData (void) { return data; }
66  void setData (dataset * d) { data = d; }
67  net * getNet (void) { return subnet; }
68  void setNet (net * netlist) { subnet = netlist; }
69  environment * getEnv (void) { return env; }
70  void setEnv (environment * e) { env = e; }
71  ptrlist<analysis> * getAnalysis (void) { return actions; }
73  void addAnalysis (analysis *);
74  void delAnalysis (analysis *);
75  int getType (void) { return type; }
76  void setType (int t) { type = t; }
77  sweep * createSweep (const char *);
78  void saveVariable (const char *, nr_complex_t, vector *);
79  bool getProgress (void) { return progress; }
80  void setProgress (bool p) { progress = p; }
81 
82  protected:
83  int runs;
84  int type;
89  bool progress;
90 };
91 
92 #endif /* __ANALYSIS_H__ */