Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 1869 2013-03-06 12:50:21Z crobarcro $
22  *
23  */
24 
31 #ifndef __ANALYSIS_H__
32 #define __ANALYSIS_H__
33 
34 #include "object.h"
35 
36 #define SAVE_OPS 1 // save operating points
37 #define SAVE_ALL 2 // also save subcircuit nodes and operating points
38 #define SAVE_CVS 4 // save characteristic values
39 
40 #define ACREATOR(val) \
41  val (); \
42  static analysis * create (void) { return new val (); } \
43  static struct define_t anadef; \
44  static struct define_t * definition (void) { return &anadef; }
45 
46 namespace qucs {
47 
48 class dataset;
49 class net;
50 class environment;
51 class sweep;
52 class vector;
53 template <class type_t> class ptrlist;
54 
62 {
71 };
72 
82 class analysis : public object
83 {
84 public:
85 
91  analysis ();
92 
98  analysis (char *);
99 
106  analysis (analysis &);
107 
113  ~analysis ();
114 
121  virtual int solve (void)
122  {
123  return 0;
124  }
125 
132  virtual int initialize (void)
133  {
134  return 0;
135  }
136 
143  virtual int cleanup (void)
144  {
145  return 0;
146  }
147 
155  virtual bool isExternal (void)
156  {
157  return false;
158  }
159 
160  dataset * getData (void)
161  {
162  return data;
163  }
164 
165  void setData (dataset * d)
166  {
167  data = d;
168  }
169 
170  net * getNet (void)
171  {
172  return subnet;
173  }
174 
175  void setNet (net * netlist)
176  {
177  subnet = netlist;
178  }
179 
180  environment * getEnv (void)
181  {
182  return env;
183  }
184 
185  void setEnv (environment * e)
186  {
187  env = e;
188  }
189 
191  {
192  return actions;
193  }
194 
196  {
197  actions = a;
198  }
199 
206  void addAnalysis (analysis *);
207 
214  void delAnalysis (analysis *);
215 
216  int getType (void)
217  {
218  return type;
219  }
220 
221  void setType (int t)
222  {
223  type = t;
224  }
225 
236  sweep * createSweep (const char *);
237 
247  void saveVariable (const char *, nr_complex_t, qucs::vector *);
248 
254  bool getProgress (void)
255  {
256  return progress;
257  }
258 
265  void setProgress (bool p)
266  {
267  progress = p;
268  }
269 
270 protected:
271  int runs;
272  int type;
273  net * subnet;
274  dataset * data;
275  environment * env;
277  bool progress;
278 };
279 
280 } // namespace qucs
281 
282 #endif /* __ANALYSIS_H__ */
std::complex< nr_double_t > nr_complex_t
Definition: complex.h:31
net * subnet
Definition: analysis.h:273
void setProgress(bool p)
Sets the progress.
Definition: analysis.h:265
void saveVariable(const char *, nr_complex_t, qucs::vector *)
Save variable into analysis dataset.
Definition: analysis.cpp:151
void delAnalysis(analysis *)
Definition: analysis.cpp:100
virtual int initialize(void)
placehoder for initialization function
Definition: analysis.h:132
void setEnv(environment *e)
Definition: analysis.h:185
t
Definition: parse_vcd.y:290
analysis()
Constructor (Unnamed)
Definition: analysis.cpp:53
bool getProgress(void)
get
Definition: analysis.h:254
~analysis()
Destructor.
Definition: analysis.cpp:75
int getType(void)
Definition: analysis.h:216
environment * env
Definition: analysis.h:275
analysis_type
enumerates the analysis types available.
Definition: analysis.h:61
void setData(dataset *d)
Definition: analysis.h:165
virtual int cleanup(void)
placehoder for cleanup function
Definition: analysis.h:143
environment * getEnv(void)
Definition: analysis.h:180
ptrlist< analysis > * getAnalysis(void)
Definition: analysis.h:190
dataset * data
Definition: analysis.h:274
void setAnalysis(ptrlist< analysis > *a)
Definition: analysis.h:195
net * getNet(void)
Definition: analysis.h:170
void addAnalysis(analysis *)
Definition: analysis.cpp:93
void setType(int t)
Definition: analysis.h:221
class for performing circuit analyses.
Definition: analysis.h:82
sweep * createSweep(const char *)
create a named sweep object
Definition: analysis.cpp:107
virtual int solve(void)
placehoder for solution function
Definition: analysis.h:121
void setNet(net *netlist)
Definition: analysis.h:175
dataset * getData(void)
Definition: analysis.h:160
virtual bool isExternal(void)
informs whether this is an external sim
Definition: analysis.h:155
ptrlist< analysis > * actions
Definition: analysis.h:276