Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
evaluate.cpp
Go to the documentation of this file.
1 /*
2  * evaluate.cpp - the Qucs equation evaluator implementations
3  *
4  * Copyright (C) 2004-2011 Stefan Jahn <stefan@lkcc.org>
5  * Copyright (C) 2006 Gunther Kraut <gn.kraut@t-online.de>
6  *
7  * This is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this package; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  * $Id$
23  *
24  */
25 
26 #if HAVE_CONFIG_H
27 # include <config.h>
28 #endif
29 
30 #include <stdio.h>
31 #include <stdlib.h>
32 #include <string.h>
33 #include <ctype.h>
34 #include <cmath>
35 
36 #include "logging.h"
37 #include "complex.h"
38 #include "object.h"
39 #include "vector.h"
40 #include "matrix.h"
41 #include "poly.h"
42 #include "spline.h"
43 #include "fourier.h"
44 #include "receiver.h"
45 #include "constants.h"
46 #include "fspecial.h"
47 #include "circuit.h"
48 #include "range.h"
49 #include "equation.h"
50 #include "evaluate.h"
51 #include "exception.h"
52 #include "exceptionstack.h"
53 #include "strlist.h"
54 
55 using namespace qucs;
56 using namespace qucs::eqn;
57 using namespace qucs::fourier;
58 using namespace fspecial;
59 
60 // Short macros in order to obtain the correct constant value.
61 #define D(con) ((constant *) (con))->d
62 #define C(con) ((constant *) (con))->c
63 #define V(con) ((constant *) (con))->v
64 #define M(con) ((constant *) (con))->m
65 #define MV(con) ((constant *) (con))->mv
66 #define STR(con) ((constant *) (con))->s
67 #define CHR(con) ((constant *) (con))->chr
68 #define INT(con) ((int) D (con))
69 #define RNG(con) ((constant *) (con))->r
70 #define B(con) ((constant *) (con))->b
71 
72 #define A(a) ((assignment *) (a))
73 #define R(r) ((reference *) (r))
74 
75 // Argument macros.
76 #define _ARES(idx) args->getResult(idx)
77 #define _ARG(idx) args->get(idx)
78 
79 #define _D(var,idx) nr_double_t (var) = D (_ARES (idx));
80 #define _BO(var,idx) bool (var) = B (_ARES (idx));
81 #define _CX(var,idx) nr_complex_t * (var) = C (_ARES (idx));
82 #define _V(var,idx) qucs::vector * (var) = V (_ARES (idx));
83 #define _M(var,idx) matrix * (var) = M (_ARES (idx));
84 #define _MV(var,idx) matvec * (var) = MV (_ARES (idx));
85 #define _I(var,idx) int (var) = INT (_ARES (idx));
86 #define _R(var,idx) range * (var) = RNG (_ARES (idx));
87 
88 #define _ARR0(var) _R (var,0)
89 #define _ARR1(var) _R (var,1)
90 #define _ARR2(var) _R (var,2)
91 #define _ARI0(var) _I (var,0)
92 #define _ARI1(var) _I (var,1)
93 #define _ARI2(var) _I (var,2)
94 #define _ARD0(var) _D (var,0)
95 #define _ARD1(var) _D (var,1)
96 #define _ARD2(var) _D (var,2)
97 #define _ARB0(var) _BO (var,0)
98 #define _ARB1(var) _BO (var,1)
99 #define _ARB2(var) _BO (var,2)
100 #define _ARC0(var) _CX (var,0)
101 #define _ARC1(var) _CX (var,1)
102 #define _ARC2(var) _CX (var,2)
103 #define _ARM0(var) _M (var,0)
104 #define _ARM1(var) _M (var,1)
105 #define _ARM2(var) _M (var,2)
106 #define _ARV0(var) _V (var,0)
107 #define _ARV1(var) _V (var,1)
108 #define _ARV2(var) _V (var,2)
109 #define _ARMV0(var) _MV (var,0)
110 #define _ARMV1(var) _MV (var,1)
111 #define _ARMV2(var) _MV (var,2)
112 
113 // Return value definition macros.
114 #define _DEFD() constant * res = new constant (TAG_DOUBLE);
115 #define _DEFB() constant * res = new constant (TAG_BOOLEAN);
116 #define _DEFC() constant * res = new constant (TAG_COMPLEX);
117 #define _DEFV() constant * res = new constant (TAG_VECTOR);
118 #define _DEFM() constant * res = new constant (TAG_MATRIX);
119 #define _DEFMV() constant * res = new constant (TAG_MATVEC);
120 #define _DEFR() constant * res = new constant (TAG_RANGE);
121 
122 // Return value macros.
123 #define _RETD(var) res->d = (var); return res;
124 #define _RETD_QUCS(var) res->d = (qucs::var); return res;
125 #define _RETD_STD(var) res->d = (std::var); return res;
126 #define _RETD_SPECIAL(var) res->d = (fspecial::var); return res;
127 #define _RETB(var) res->b = (var); return res;
128 #define _RETC(var) res->c = new nr_complex_t (var); return res;
129 #define _RETV(var) res->v = new qucs::vector (var); return res;
130 #define _RETM(var) res->m = new matrix (var); return res;
131 #define _RETMV(var) res->mv = new matvec (var); return res;
132 #define _RETR(var) res->r = (var); return res;
133 
134 // Return value macros without arguments.
135 #define __RETC() res->c = new nr_complex_t (); return res;
136 #define __RETV() res->v = new qucs::vector (); return res;
137 #define __RETM() res->m = new matrix (); return res;
138 #define __RETMV() res->mv = new matvec (); return res;
139 
140 #define SOLVEE(idx) args->get(idx)->solvee
141 
142 // Throws a math exception.
143 #define THROW_MATH_EXCEPTION(txt) do { \
144  qucs::exception * e = new qucs::exception (EXCEPTION_MATH); \
145  e->setText (txt); throw_exception (e); } while (0)
146 
147 /* The QUCS_CONCAT macros create a new concatenated symbol for the
148  compiler in a portable way. It is essential to use these macros
149  like QUCS_CONCAT (a,b) and *not* like QUCS_CONCAT (a, b) or its
150  variants. */
151 #if defined (__STDC__) || defined (__cplusplus)
152 # define QUCS_CONCAT2(a, b) a##b
153 # define QUCS_CONCAT3(a, b, c) a##b##c
154 #else
155 # define QUCS_CONCAT2(a, b) a/* */b
156 # define QUCS_CONCAT3(a, b, c) a/* */b/* */c
157 #endif
158 
159 // The following macro is meant to be used for some simple functions.
160 #define MAKE_FUNC_DEFINITION_0(cfunc) \
161 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d) (constant * args) { \
162  _ARD0 (d); \
163  _DEFD (); \
164  _RETD (cfunc (d)); \
165 } \
166 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c) (constant * args) { \
167  _ARC0 (c); \
168  _DEFC (); \
169  _RETC (cfunc (*c)); \
170 } \
171 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v) (constant * args) { \
172  _ARV0 (v); \
173  _DEFV (); \
174  _RETV (cfunc (*v)); \
175 }
176 
177 // The following macro is meant to be used for some simple functions,
178 // which must explicitly use the double function from the std namespace
179 #define MAKE_FUNC_DEFINITION_0_STD(cfunc) \
180 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d) (constant * args) { \
181  _ARD0 (d); \
182  _DEFD (); \
183  _RETD_STD (cfunc (d)); \
184 } \
185 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c) (constant * args) { \
186  _ARC0 (c); \
187  _DEFC (); \
188  _RETC (cfunc (*c)); \
189 } \
190 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v) (constant * args) { \
191  _ARV0 (v); \
192  _DEFV (); \
193  _RETV (cfunc (*v)); \
194 }
195 
196 // The following macro is meant to be used for some simple functions,
197 // which must explicitly use the double function from the qucs namespace
198 #define MAKE_FUNC_DEFINITION_0_QUCS(cfunc) \
199 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d) (constant * args) { \
200  _ARD0 (d); \
201  _DEFD (); \
202  _RETD_QUCS (cfunc (d)); \
203 } \
204 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c) (constant * args) { \
205  _ARC0 (c); \
206  _DEFC (); \
207  _RETC (cfunc (*c)); \
208 } \
209 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v) (constant * args) { \
210  _ARV0 (v); \
211  _DEFV (); \
212  _RETV (cfunc (*v)); \
213 }
214 
215 // The following macro is meant to be used for some simple functions,
216 // which must explicitly use the double function from the fspecial namespace
217 #define MAKE_FUNC_DEFINITION_0_SPECIAL(cfunc) \
218 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d) (constant * args) { \
219  _ARD0 (d); \
220  _DEFD (); \
221  _RETD_SPECIAL (cfunc (d)); \
222 } \
223 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c) (constant * args) { \
224  _ARC0 (c); \
225  _DEFC (); \
226  _RETC (cfunc (*c)); \
227 } \
228 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v) (constant * args) { \
229  _ARV0 (v); \
230  _DEFV (); \
231  _RETV (cfunc (*v)); \
232 }
233 
234 #define MAKE_FUNC_DEFINITION_1(cfunc) \
235 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d) (constant * args) { \
236  _ARD0 (d); \
237  _DEFD (); \
238  _RETD (cfunc (d)); \
239 } \
240 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c) (constant * args) { \
241  _ARC0 (c); \
242  _DEFD (); \
243  res->d = cfunc (*c); return res; \
244 } \
245 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v) (constant * args) { \
246  _ARV0 (v); \
247  _DEFV (); \
248  _RETV (cfunc (*v)); \
249 } \
250 constant * evaluate:: QUCS_CONCAT2 (cfunc,_m) (constant * args) { \
251  _ARM0 (m); \
252  _DEFM (); \
253  _RETM (cfunc (*m)); \
254 } \
255 constant * evaluate:: QUCS_CONCAT2 (cfunc,_mv) (constant * args) {\
256  _ARMV0 (mv); \
257  _DEFMV (); \
258  _RETMV (cfunc (*mv)); \
259 }
260 
261 MAKE_FUNC_DEFINITION_0 (exp); // exponential function
262 MAKE_FUNC_DEFINITION_0 (limexp); // limited exponential function
263 MAKE_FUNC_DEFINITION_0 (sin); // sine
264 MAKE_FUNC_DEFINITION_0 (cos); // cosine
265 MAKE_FUNC_DEFINITION_0 (tan); // tangent
266 MAKE_FUNC_DEFINITION_0 (sinh); // sine hyperbolicus
267 MAKE_FUNC_DEFINITION_0 (cosh); // cosine hyperbolicus
268 MAKE_FUNC_DEFINITION_0 (tanh); // tangent hyperbolicus
269 MAKE_FUNC_DEFINITION_0_QUCS (coth); // cotangent hyperbolicus
270 MAKE_FUNC_DEFINITION_0_QUCS (sech); // secans hyperbolicus
271 MAKE_FUNC_DEFINITION_0_QUCS (cosech); // cosecans hyperbolicus
272 MAKE_FUNC_DEFINITION_0_QUCS (signum); // signum function
273 MAKE_FUNC_DEFINITION_0_QUCS (sign); // sign function
274 MAKE_FUNC_DEFINITION_0_QUCS (sinc); // sin(x)/x aka sinc function
275 MAKE_FUNC_DEFINITION_0 (sqr); // square value
276 
277 MAKE_FUNC_DEFINITION_1 (real); // real value
278 MAKE_FUNC_DEFINITION_1 (imag); // imaginary value
279 MAKE_FUNC_DEFINITION_1 (abs); // absolute value
280 
281 // ******************** unary plus *************************
283  _ARD0 (d1); _DEFD (); _RETD (d1);
284 }
285 
287  _ARC0 (c1); _DEFC (); _RETC (*c1);
288 }
289 
291  _ARV0 (v1); _DEFV (); _RETV (*v1);
292 }
293 
295  _ARM0 (m1); _DEFM (); _RETM (*m1);
296 }
297 
299  _ARMV0 (v1); _DEFMV (); _RETMV (*v1);
300 }
301 
302 // ****************** addition *****************************
304  _ARD0 (d1);
305  _ARD1 (d2);
306  _DEFD ();
307  _RETD (d1 + d2);
308 }
309 
311  _ARC0 (c1);
312  _ARC1 (c2);
313  _DEFC ();
314  _RETC (*c1 + *c2);
315 }
316 
318  _ARC0 (c1);
319  _ARD1 (d2);
320  _DEFC ();
321  _RETC (*c1 + d2);
322 }
323 
325  _ARD0 (d1);
326  _ARC1 (c2);
327  _DEFC ();
328  _RETC (d1 + *c2);
329 }
330 
332  _ARV0 (v1);
333  _ARD1 (d2);
334  _DEFV ();
335  _RETV (*v1 + d2);
336 }
337 
339  _ARD0 (d1);
340  _ARV1 (v2);
341  _DEFV ();
342  _RETV (d1 + *v2);
343 }
344 
346  _ARV0 (v1);
347  _ARC1 (c2);
348  _DEFV ();
349  _RETV (*v1 + *c2);
350 }
351 
353  _ARC0 (c1);
354  _ARV1 (v2);
355  _DEFV ();
356  _RETV (*v2 + *c1);
357 }
358 
360  _ARV0 (v1);
361  _ARV1 (v2);
362  _DEFV ();
363  _RETV (*v1 + *v2);
364 }
365 
367  _ARM0 (m1);
368  _ARM1 (m2);
369  _DEFM ();
370  _RETM (*m1 + *m2);
371 }
372 
374  _ARMV0 (v1);
375  _ARMV1 (v2);
376  _DEFMV ();
377  _RETMV (*v1 + *v2);
378 }
379 
381  _ARMV0 (v1);
382  _ARM1 (m2);
383  _DEFMV ();
384  _RETMV (*v1 + *m2);
385 }
386 
388  _ARM0 (m1);
389  _ARMV1 (v2);
390  _DEFMV ();
391  _RETMV (*m1 + *v2);
392 }
393 
395  _ARM0 (m1);
396  _ARD1 (d2);
397  _DEFM ();
398  _RETM (*m1 + d2);
399 }
400 
402  _ARD0 (d1);
403  _ARM1 (m2);
404  _DEFM ();
405  _RETM (d1 + *m2);
406 }
407 
409  _ARM0 (m1);
410  _ARC1 (c2);
411  _DEFM ();
412  _RETM (*m1 + *c2);
413 }
414 
416  _ARC0 (c1);
417  _ARM1 (m2);
418  _DEFM ();
419  _RETM (*c1 + *m2);
420 }
421 
423  _ARMV0 (m1);
424  _ARD1 (d2);
425  _DEFMV ();
426  _RETMV (*m1 + d2);
427 }
428 
430  _ARD0 (d1);
431  _ARMV1 (m2);
432  _DEFMV ();
433  _RETMV (d1 + *m2);
434 }
435 
437  _ARMV0 (m1);
438  _ARC1 (c2);
439  _DEFMV ();
440  _RETMV (*m1 + *c2);
441 }
442 
444  _ARC0 (c1);
445  _ARMV1 (m2);
446  _DEFMV ();
447  _RETMV (*c1 + *m2);
448 }
449 
451  _ARMV0 (m1);
452  _ARV1 (v2);
453  _DEFMV ();
454  _RETMV (*m1 + *v2);
455 }
456 
458  _ARV0 (v1);
459  _ARMV1 (m2);
460  _DEFMV ();
461  _RETMV (*v1 + *m2);
462 }
463 
465  char * s1 = STR (_ARES(0));
466  char * s2 = STR (_ARES(1));
467  constant * res = new constant (TAG_STRING);
468  char * p = (char *) malloc (strlen (s1) + strlen (s2) + 1);
469  strcpy (p, s1); strcat (p, s2);
470  res->s = p;
471  return res;
472 }
473 
475  char c1 = CHR (_ARES(0));
476  char * s2 = STR (_ARES(1));
477  constant * res = new constant (TAG_STRING);
478  char * p = (char *) malloc (strlen (s2) + 2);
479  p[0] = c1; strcpy (&p[1], s2);
480  res->s = p;
481  return res;
482 }
483 
485  char * s1 = STR (_ARES(0));
486  char c2 = CHR (_ARES(1));
487  constant * res = new constant (TAG_STRING);
488  char * p = (char *) malloc (strlen (s1) + 2);
489  strcpy (p, s1); p[strlen (s1)] = c2; p[strlen (s1) + 1] = '\0';
490  res->s = p;
491  return res;
492 }
493 
494 // ******************** unary minus ***************************
496  _ARD0 (d1); _DEFD (); _RETD (-d1);
497 }
498 
500  _ARC0 (c1); _DEFC (); _RETC (-*c1);
501 }
502 
504  _ARV0 (v1); _DEFV (); _RETV (-*v1);
505 }
506 
508  _ARM0 (m1); _DEFM (); _RETM (-*m1);
509 }
510 
512  _ARMV0 (v1); _DEFMV (); _RETMV (-*v1);
513 }
514 
515 // ****************** subtraction *****************************
517  _ARD0 (d1);
518  _ARD1 (d2);
519  _DEFD ();
520  _RETD (d1 - d2);
521 }
522 
524  _ARC0 (c1);
525  _ARC1 (c2);
526  _DEFC ();
527  _RETC (*c1 - *c2);
528 }
529 
531  _ARC0 (c1);
532  _ARD1 (d2);
533  _DEFC ();
534  _RETC (*c1 - d2);
535 }
536 
538  _ARD0 (d1);
539  _ARC1 (c2);
540  _DEFC ();
541  _RETC (d1 - *c2);
542 }
543 
545  _ARV0 (v1);
546  _ARD1 (d2);
547  _DEFV ();
548  _RETV (*v1 - d2);
549 }
550 
552  _ARD0 (d1);
553  _ARV1 (v2);
554  _DEFV ();
555  _RETV (d1 - *v2);
556 }
557 
559  _ARV0 (v1);
560  _ARC1 (c2);
561  _DEFV ();
562  _RETV (*v1 - *c2);
563 }
564 
566  _ARC0 (c1);
567  _ARV1 (v2);
568  _DEFV ();
569  _RETV (*c1 - *v2);
570 }
571 
573  _ARV0 (v1);
574  _ARV1 (v2);
575  _DEFV ();
576  _RETV (*v1 - *v2);
577 }
578 
580  _ARM0 (m1);
581  _ARM1 (m2);
582  _DEFM ();
583  _RETM (*m1 - *m2);
584 }
585 
587  _ARMV0 (v1);
588  _ARMV1 (v2);
589  _DEFMV ();
590  _RETMV (*v1 - *v2);
591 }
592 
594  _ARMV0 (v1);
595  _ARM1 (m2);
596  _DEFMV ();
597  _RETMV (*v1 - *m2);
598 }
599 
601  _ARM0 (m1);
602  _ARMV1 (v2);
603  _DEFMV ();
604  _RETMV (*m1 - *v2);
605 }
606 
608  _ARM0 (m1);
609  _ARD1 (d2);
610  _DEFM ();
611  _RETM (*m1 - d2);
612 }
613 
615  _ARD0 (d1);
616  _ARM1 (m2);
617  _DEFM ();
618  _RETM (d1 - *m2);
619 }
620 
622  _ARM0 (m1);
623  _ARC1 (c2);
624  _DEFM ();
625  _RETM (*m1 - *c2);
626 }
627 
629  _ARC0 (c1);
630  _ARM1 (m2);
631  _DEFM ();
632  _RETM (*c1 - *m2);
633 }
634 
636  _ARMV0 (m1);
637  _ARD1 (d2);
638  _DEFMV ();
639  _RETMV (*m1 - d2);
640 }
641 
643  _ARD0 (d1);
644  _ARMV1 (m2);
645  _DEFMV ();
646  _RETMV (d1 - *m2);
647 }
648 
650  _ARMV0 (m1);
651  _ARC1 (c2);
652  _DEFMV ();
653  _RETMV (*m1 - *c2);
654 }
655 
657  _ARC0 (c1);
658  _ARMV1 (m2);
659  _DEFMV ();
660  _RETMV (*c1 - *m2);
661 }
662 
664  _ARMV0 (m1);
665  _ARV1 (v2);
666  _DEFMV ();
667  _RETMV (*m1 - *v2);
668 }
669 
671  _ARV0 (v1);
672  _ARMV1 (m2);
673  _DEFMV ();
674  _RETMV (*v1 - *m2);
675 }
676 
677 // ****************** multiplication *************************
679  _ARD0 (d1);
680  _ARD1 (d2);
681  _DEFD ();
682  _RETD (d1 * d2);
683 }
684 
686  _ARC0 (c1);
687  _ARC1 (c2);
688  _DEFC ();
689  _RETC ((*c1) * (*c2));
690 }
691 
693  _ARC0 (c1);
694  _ARD1 (d2);
695  _DEFC ();
696  _RETC ((*c1) * d2);
697 }
698 
700  _ARD0 (d1);
701  _ARC1 (c2);
702  _DEFC ();
703  _RETC (d1 * (*c2));
704 }
705 
707  _ARV0 (v1);
708  _ARD1 (d2);
709  _DEFV ();
710  _RETV (*v1 * d2);
711  return res;
712 }
713 
715  _ARD0 (d1);
716  _ARV1 (v2);
717  _DEFV ();
718  _RETV (d1 * *v2);
719 }
720 
722  _ARV0 (v1);
723  _ARC1 (c2);
724  _DEFV ();
725  _RETV (*v1 * *c2);
726 }
727 
729  _ARC0 (c1);
730  _ARV1 (v2);
731  _DEFV ();
732  _RETV (*c1 * *v2);
733 }
734 
736  _ARV0 (v1);
737  _ARV1 (v2);
738  _DEFV ();
739  _RETV (*v1 * *v2);
740 }
741 
743  _ARM0 (m1);
744  _ARM1 (m2);
745  _DEFM ();
746  if (m1->getCols () != m2->getRows ()) {
747  THROW_MATH_EXCEPTION ("nonconformant arguments in matrix multiplication");
748  res->m = new matrix (m1->getRows (), m2->getCols ());
749  } else {
750  res->m = new matrix (*m1 * *m2);
751  }
752  return res;
753 }
754 
756  _ARM0 (m1);
757  _ARC1 (c2);
758  _DEFM ();
759  _RETM (*m1 * *c2);
760 }
761 
763  _ARC0 (c1);
764  _ARM1 (m2);
765  _DEFM ();
766  _RETM (*c1 * *m2);
767 }
768 
770  _ARM0 (m1);
771  _ARD1 (d2);
772  _DEFM ();
773  _RETM (*m1 * d2);
774 }
775 
777  _ARD0 (d1);
778  _ARM1 (m2);
779  _DEFM ();
780  _RETM (d1 * *m2);
781 }
782 
784  _ARMV0 (v1);
785  _ARMV1 (v2);
786  _DEFMV ();
787  if (v1->getCols () != v2->getRows ()) {
788  THROW_MATH_EXCEPTION ("nonconformant arguments in matrix multiplication");
789  res->mv = new matvec (v1->getSize (), v1->getRows (), v2->getCols ());
790  } else {
791  res->mv = new matvec (*v1 * *v2);
792  }
793  return res;
794 }
795 
797  _ARMV0 (v1);
798  _ARC1 (c2);
799  _DEFMV ();
800  _RETMV (*v1 * *c2);
801 }
802 
804  _ARC0 (c1);
805  _ARMV1 (v2);
806  _DEFMV ();
807  _RETMV (*c1 * *v2);
808 }
809 
811  _ARMV0 (v1);
812  _ARD1 (d2);
813  _DEFMV ();
814  _RETMV (*v1 * d2);
815 }
816 
818  _ARD0 (d1);
819  _ARMV1 (v2);
820  _DEFMV ();
821  _RETMV (d1 * *v2);
822 }
823 
825  _ARMV0 (v1);
826  _ARM1 (m2);
827  _DEFMV ();
828  if (v1->getCols () != m2->getRows ()) {
829  THROW_MATH_EXCEPTION ("nonconformant arguments in matrix multiplication");
830  res->mv = new matvec (v1->getSize (), v1->getRows (), m2->getCols ());
831  } else {
832  res->mv = new matvec (*v1 * *m2);
833  }
834  return res;
835 }
836 
838  _ARM0 (m1);
839  _ARMV1 (v2);
840  _DEFMV ();
841  if (m1->getCols () != v2->getRows ()) {
842  THROW_MATH_EXCEPTION ("nonconformant arguments in matrix multiplication");
843  res->mv = new matvec (v2->getSize (), m1->getRows (), v2->getCols ());
844  } else {
845  res->mv = new matvec (*m1 * *v2);
846  }
847  return res;
848 }
849 
851  _ARMV0 (v1);
852  _ARV1 (v2);
853  _DEFMV ();
854  _RETMV (*v1 * *v2);
855 }
856 
858  _ARV0 (v1);
859  _ARMV1 (v2);
860  _DEFMV ();
861  _RETMV (*v1 * *v2);
862 }
863 
864 // ****************** division *************************
866  _ARD0 (d1);
867  _ARD1 (d2);
868  _DEFD ();
869  if (d2 == 0.0) THROW_MATH_EXCEPTION ("division by zero");
870  _RETD (d1 / d2);
871 }
872 
874  _ARC0 (c1);
875  _ARC1 (c2);
876  _DEFC ();
877  if (*c2 == 0.0) THROW_MATH_EXCEPTION ("division by zero");
878  _RETC (*c1 / *c2);
879 }
880 
882  _ARC0 (c1);
883  _ARD1 (d2);
884  _DEFC ();
885  if (d2 == 0.0) THROW_MATH_EXCEPTION ("division by zero");
886  _RETC (*c1 / d2);
887 }
888 
890  _ARD0 (d1);
891  _ARC1 (c2);
892  _DEFC ();
893  if (*c2 == 0.0) THROW_MATH_EXCEPTION ("division by zero");
894  _RETC (d1 / *c2);
895 }
896 
898  _ARV0 (v1);
899  _ARD1 (d2);
900  _DEFV ();
901  if (d2 == 0.0) THROW_MATH_EXCEPTION ("division by zero");
902  _RETV (*v1 / d2);
903 }
904 
906  _ARD0 (d1);
907  _ARV1 (v2);
908  _DEFV ();
909  _RETV (d1 / *v2);
910 }
911 
913  _ARV0 (v1);
914  _ARC1 (c2);
915  _DEFV ();
916  if (*c2 == 0.0) THROW_MATH_EXCEPTION ("division by zero");
917  _RETV (*v1 / *c2);
918 }
919 
921  _ARC0 (c1);
922  _ARV1 (v2);
923  _DEFV ();
924  _RETV (*c1 / *v2);
925 }
926 
928  _ARV0 (v1);
929  _ARV1 (v2);
930  _DEFV ();
931  _RETV (*v1 / *v2);
932 }
933 
935  _ARM0 (m1);
936  _ARC1 (c2);
937  _DEFM ();
938  _RETM (*m1 / *c2);
939 }
940 
942  _ARM0 (m1);
943  _ARD1 (d2);
944  _DEFM ();
945  _RETM (*m1 / d2);
946 }
947 
949  _ARMV0 (v1);
950  _ARC1 (c2);
951  _DEFMV ();
952  _RETMV (*v1 / *c2);
953 }
954 
956  _ARMV0 (v1);
957  _ARD1 (d2);
958  _DEFMV ();
959  _RETMV (*v1 / d2);
960 }
961 
963  _ARMV0 (v1);
964  _ARV1 (v2);
965  _DEFMV ();
966  _RETMV (*v1 / *v2);
967 }
968 
969 // ****************** modulo *************************
971  _ARD0 (d1);
972  _ARD1 (d2);
973  _DEFD ();
974  _RETD (std::fmod (d1, d2));
975 }
976 
978  _ARC0 (c1);
979  _ARC1 (c2);
980  _DEFC ();
981  _RETC ((*c1) % (*c2));
982 }
983 
985  _ARC0 (c1);
986  _ARD1 (d2);
987  _DEFC ();
988  _RETC ((*c1) % d2);
989 }
990 
992  _ARD0 (d1);
993  _ARC1 (c2);
994  _DEFC ();
995  _RETC (d1 % (*c2));
996 }
997 
999  _ARV0 (v1);
1000  _ARD1 (d2);
1001  _DEFV ();
1002  _RETV (*v1 % d2);
1003 }
1004 
1006  _ARD0 (d1);
1007  _ARV1 (v2);
1008  _DEFV ();
1009  _RETV (d1 % *v2);
1010 }
1011 
1013  _ARV0 (v1);
1014  _ARC1 (c2);
1015  _DEFV ();
1016  _RETV (*v1 % *c2);
1017 }
1018 
1020  _ARC0 (c1);
1021  _ARV1 (v2);
1022  _DEFV ();
1023  _RETV (*c1 % *v2);
1024 }
1025 
1027  _ARV0 (v1);
1028  _ARV1 (v2);
1029  _DEFV ();
1030  _RETV (*v1 % *v2);
1031 }
1032 
1033 // ****************** power *************************
1035  _ARD0 (d1);
1036  _ARD1 (d2);
1037  _DEFD ();
1038  _RETD (std::pow (d1, d2));
1039 }
1040 
1042  _ARC0 (c1);
1043  _ARC1 (c2);
1044  _DEFC ();
1045  _RETC (std::pow (*c1, *c2));
1046 }
1047 
1049  _ARC0 (c1);
1050  _ARD1 (d2);
1051  _DEFC ();
1052  _RETC (pow (*c1, d2));
1053 }
1054 
1056  _ARD0 (d1);
1057  _ARC1 (c2);
1058  _DEFC ();
1059  _RETC (pow (d1, *c2));
1060 }
1061 
1063  _ARV0 (v1);
1064  _ARD1 (d2);
1065  _DEFV ();
1066  _RETV (pow (*v1, d2));
1067 }
1068 
1070  _ARD0 (d1);
1071  _ARV1 (v2);
1072  _DEFV ();
1073  _RETV (pow (d1, *v2));
1074 }
1075 
1077  _ARV0 (v1);
1078  _ARC1 (c2);
1079  _DEFV ();
1080  _RETV (pow (*v1, *c2));
1081 }
1082 
1084  _ARC0 (c1);
1085  _ARV1 (v2);
1086  _DEFV ();
1087  _RETV (pow (*c1, *v2));
1088 }
1089 
1091  _ARV0 (v1);
1092  _ARV1 (v2);
1093  _DEFV ();
1094  _RETV (pow (*v1, *v2));
1095 }
1096 
1098  _ARM0 (m1);
1099  _ARI1 (i2);
1100  _DEFM ();
1101  _RETM (pow (*m1, i2));
1102 }
1103 
1105  _ARM0 (m1);
1106  _ARC1 (c2);
1107  _DEFM ();
1108  _RETM (pow (*m1, (int) real (*c2)));
1109 }
1110 
1112  _ARMV0 (m1);
1113  _ARI1 (i2);
1114  _DEFMV ();
1115  _RETMV (pow (*m1, i2));
1116 }
1117 
1119  _ARMV0 (m1);
1120  _ARC1 (c2);
1121  _DEFMV ();
1122  _RETMV (pow (*m1, (int) real (*c2)));
1123 }
1124 
1126  _ARMV0 (m1);
1127  _ARV1 (v2);
1128  _DEFMV ();
1129  _RETMV (pow (*m1, *v2));
1130 }
1131 
1132 // ****************** hypotenuse *************************
1134  _ARD0 (d1);
1135  _ARD1 (d2);
1136  _DEFD ();
1137  _RETD (xhypot (d1, d2));
1138 }
1139 
1141  _ARC0 (c1);
1142  _ARC1 (c2);
1143  _DEFD ();
1144  _RETD (xhypot (*c1, *c2));
1145 }
1146 
1148  _ARC0 (c1);
1149  _ARD1 (d2);
1150  _DEFD ();
1151  _RETD (xhypot (*c1, d2));
1152 }
1153 
1155  _ARD0 (d1);
1156  _ARC1 (c2);
1157  _DEFD ();
1158  _RETD (xhypot (d1, *c2));
1159 }
1160 
1162  _ARV0 (v1);
1163  _ARD1 (d2);
1164  _DEFV ();
1165  _RETV (xhypot (*v1, d2));
1166 }
1167 
1169  _ARD0 (d1);
1170  _ARV1 (v2);
1171  _DEFV ();
1172  _RETV (xhypot (d1, *v2));
1173 }
1174 
1176  _ARV0 (v1);
1177  _ARC1 (c2);
1178  _DEFV ();
1179  _RETV (xhypot (*v1, *c2));
1180 }
1181 
1183  _ARC0 (c1);
1184  _ARV1 (v2);
1185  _DEFV ();
1186  _RETV (xhypot (*c1, *v2));
1187 }
1188 
1190  _ARV0 (v1);
1191  _ARV1 (v2);
1192  _DEFV ();
1193  _RETV (xhypot (*v1, *v2));
1194 }
1195 
1196 // ************** conjugate complex **********************
1198  _ARD0 (d1);
1199  _DEFD ();
1200  _RETD (d1);
1201 }
1202 
1204  _ARC0 (c1);
1205  _DEFC ();
1206  _RETC (conj (*c1));
1207 }
1208 
1210  _ARV0 (v1);
1211  _DEFV ();
1212  _RETV (conj (*v1));
1213 }
1214 
1216  _ARM0 (m);
1217  _DEFM ();
1218  _RETM (conj (*m));
1219 }
1220 
1222  _ARMV0 (mv);
1223  _DEFMV ();
1224  _RETMV (conj (*mv));
1225 }
1226 
1227 // ********** square of absolute value *****************
1229  _ARD0 (d1);
1230  _DEFD ();
1231  _RETD (d1 * d1);
1232 }
1233 
1235  _ARC0 (c1);
1236  _DEFD ();
1237  _RETD (norm (*c1));
1238 }
1239 
1241  _ARV0 (v1);
1242  _DEFV ();
1243  _RETV (norm (*v1));
1244 }
1245 
1246 // ********** phase in degrees *****************
1248  _ARD0 (d1);
1249  _DEFD ();
1250  _RETD (d1 < 0.0 ? 180.0 : 0.0);
1251 }
1252 
1254  _ARC0 (c1);
1255  _DEFD ();
1256  _RETD (deg (arg (*c1)));
1257 }
1258 
1260  _ARV0 (v1);
1261  _DEFV ();
1262  _RETV (deg (arg (*v1)));
1263 }
1264 
1266  _ARM0 (m1);
1267  _DEFM ();
1268  _RETM (deg (arg (*m1)));
1269 }
1270 
1272  _ARMV0 (v1);
1273  _DEFMV ();
1274  _RETMV (deg (arg (*v1)));
1275 }
1276 
1277 // ********** phase in radians *****************
1279  _ARD0 (d1);
1280  _DEFD ();
1281  _RETD (d1 < 0.0 ? M_PI : 0.0);
1282 }
1283 
1285  _ARC0 (c1);
1286  _DEFD ();
1287  _RETD (arg (*c1));
1288 }
1289 
1291  _ARV0 (v1);
1292  _DEFV ();
1293  _RETV (arg (*v1));
1294 }
1295 
1297  _ARM0 (m1);
1298  _DEFM ();
1299  _RETM (arg (*m1));
1300 }
1301 
1303  _ARMV0 (v1);
1304  _DEFMV ();
1305  _RETMV (arg (*v1));
1306 }
1307 
1308 // ******* unwrap phase in radians ************
1310  _ARV0 (v1);
1311  _DEFV ();
1312  _RETV (unwrap (*v1));
1313 }
1314 
1316  _ARV0 (v1);
1317  _ARD1 (d2);
1318  _DEFV ();
1319  _RETV (unwrap (*v1, fabs (d2)));
1320 }
1321 
1323  _ARV0 (v1);
1324  _ARD1 (d2);
1325  _ARD2 (d3);
1326  _DEFV ();
1327  _RETV (unwrap (*v1, fabs (d2), fabs (d3)));
1328 }
1329 
1330 // ******** radian/degree conversion **********
1332  _ARD0 (d1);
1333  _DEFD ();
1334  _RETD (rad (d1));
1335 }
1336 
1338  _ARC0 (c1);
1339  _DEFD ();
1340  _RETD (rad (real (*c1)));
1341 }
1342 
1344  _ARV0 (v1);
1345  _DEFV ();
1346  qucs::vector * v = new qucs::vector ();
1347  for (int i = 0; i < v1->getSize (); i++) v->add (rad (real (v1->get (i))));
1348  res->v = v;
1349  return res;
1350 }
1351 
1353  _ARD0 (d1);
1354  _DEFD ();
1355  _RETD (deg (d1));
1356 }
1357 
1359  _ARC0 (c1);
1360  _DEFD ();
1361  _RETD (deg (real (*c1)));
1362 }
1363 
1365  _ARV0 (v1);
1366  _DEFV ();
1367  qucs::vector * v = new qucs::vector ();
1368  for (int i = 0; i < v1->getSize (); i++) v->add (deg (real (v1->get (i))));
1369  res->v = v;
1370  return res;
1371 }
1372 
1373 // ********** voltage decibel *****************
1375  _ARD0 (d1);
1376  _DEFD ();
1377  _RETD (10.0 * std::log10 (std::fabs (d1)));
1378 }
1379 
1381  _ARC0 (c1);
1382  _DEFD ();
1383  _RETD (dB (*c1));
1384 }
1385 
1387  _ARV0 (v1);
1388  _DEFV ();
1389  _RETV (dB (*v1));
1390 }
1391 
1393  _ARM0 (m1);
1394  _DEFM ();
1395  _RETM (dB (*m1));
1396 }
1397 
1399  _ARMV0 (v1);
1400  _DEFMV ();
1401  _RETMV (dB (*v1));
1402 }
1403 
1404 // ********** square root *****************
1406  _ARD0 (d1);
1407  _DEFC ();
1408  if (d1 < 0.0)
1409  res->c = new nr_complex_t (0.0, std::sqrt (-d1));
1410  else
1411  res->c = new nr_complex_t (std::sqrt (d1));
1412  return res;
1413 }
1414 
1416  _ARC0 (c1);
1417  _DEFC ();
1418  _RETC (std::sqrt (*c1));
1419 }
1420 
1422  _ARV0 (v1);
1423  _DEFV ();
1424  _RETV (sqrt (*v1));
1425 }
1426 
1427 // ********** natural logarithm *****************
1429  _ARD0 (d1);
1430  _DEFC ();
1431  if (d1 < 0.0)
1432  res->c = new nr_complex_t (std::log (-d1), M_PI);
1433  else
1434  res->c = new nr_complex_t (std::log (d1));
1435  return res;
1436 }
1437 
1439  _ARC0 (c1);
1440  _DEFC ();
1441  _RETC (std::log (*c1));
1442 }
1443 
1445  _ARV0 (v1);
1446  _DEFV ();
1447  _RETV (log (*v1));
1448 }
1449 
1450 // ********** decimal logarithm *****************
1452  _ARD0 (d1);
1453  _DEFC ();
1454  if (d1 < 0.0)
1455  res->c = new nr_complex_t (std::log10 (-d1), M_PI * M_LOG10E);
1456  else
1457  res->c = new nr_complex_t (std::log10 (d1));
1458  return res;
1459 }
1460 
1462  _ARC0 (c1);
1463  _DEFC ();
1464  _RETC (std::log10 (*c1));
1465 }
1466 
1468  _ARV0 (v1);
1469  _DEFV ();
1470  _RETV (log10 (*v1));
1471 }
1472 
1473 // ********** binary logarithm *****************
1475  _ARD0 (d1);
1476  _DEFC ();
1477  if (d1 < 0.0)
1478  res->c = new nr_complex_t (std::log (-d1) * M_LOG2E, M_PI * M_LOG2E);
1479  else
1480  res->c = new nr_complex_t (std::log (d1) * M_LOG2E);
1481  return res;
1482 }
1483 
1485  _ARC0 (c1);
1486  _DEFC ();
1487  _RETC (qucs::log2 (*c1));
1488 }
1489 
1491  _ARV0 (v1);
1492  _DEFV ();
1493  _RETV (log2 (*v1));
1494 }
1495 
1496 // ************* arcus sine *********************
1498  _ARD0 (d1);
1499  _DEFD ();
1500  _RETD (std::asin (d1));
1501 }
1502 
1504  _ARC0 (c1);
1505  _DEFC ();
1506  _RETC (asin (*c1));
1507 }
1508 
1510  _ARV0 (v1);
1511  _DEFV ();
1512  _RETV (asin (*v1));
1513 }
1514 
1515 // ************* arcus cosine ******************
1517  _ARD0 (d1);
1518  _DEFD ();
1519  _RETD (std::acos (d1));
1520 }
1521 
1523  _ARC0 (c1);
1524  _DEFC ();
1525  _RETC (qucs::acos (*c1));
1526 }
1527 
1529  _ARV0 (v1);
1530  _DEFV ();
1531  _RETV (acos (*v1));
1532 }
1533 
1534 // ************** arcus tangent ******************
1536  _ARD0 (d1);
1537  _DEFD ();
1538  _RETD (std::atan (d1));
1539 }
1540 
1542  _ARC0 (c1);
1543  _DEFC ();
1544  _RETC (qucs::atan (*c1));
1545 }
1546 
1548  _ARV0 (v1);
1549  _DEFV ();
1550  _RETV (atan (*v1));
1551 }
1552 
1553 // *************** cotangent ********************
1555  _ARD0 (d1);
1556  _DEFD ();
1557  _RETD (1.0 / std::tan (d1));
1558 }
1559 
1561  _ARC0 (c1);
1562  _DEFC ();
1563  _RETC (qucs::cot (*c1));
1564 }
1565 
1567  _ARV0 (v1);
1568  _DEFV ();
1569  _RETV (cot (*v1));
1570 }
1571 
1572 // ************ arcus cotangent *****************
1574  _ARD0 (d1);
1575  _DEFD ();
1576  _RETD (M_PI_2 - std::atan (d1));
1577 }
1578 
1580  _ARC0 (c1);
1581  _DEFC ();
1582  _RETC (qucs::acot (*c1));
1583 }
1584 
1586  _ARV0 (v1);
1587  _DEFV ();
1588  _RETV (acot (*v1));
1589 }
1590 
1591 // ***************** secans *********************
1593  _ARD0 (d1);
1594  _DEFD ();
1595  _RETD (1.0 / std::cos (d1));
1596 }
1597 
1599  _ARC0 (c1);
1600  _DEFC ();
1601  _RETC (1.0 / std::cos (*c1));
1602 }
1603 
1605  _ARV0 (v1);
1606  _DEFV ();
1607  _RETV (1.0 / qucs::cos (*v1));
1608 }
1609 
1610 // *************** arcus secans *******************
1612  _ARD0 (d1);
1613  _DEFD ();
1614  _RETD (std::acos (1.0 / d1));
1615 }
1616 
1618  _ARC0 (c1);
1619  _DEFC ();
1620  _RETC (acos (1.0 / *c1));
1621 }
1622 
1624  _ARV0 (v1);
1625  _DEFV ();
1626  _RETV (acos (1.0 / *v1));
1627 }
1628 
1629 // ***************** cosecans *********************
1631  _ARD0 (d1);
1632  _DEFD ();
1633  _RETD (1.0 / sin (d1));
1634 }
1635 
1637  _ARC0 (c1);
1638  _DEFC ();
1639  _RETC (1.0 / sin (*c1));
1640 }
1641 
1643  _ARV0 (v1);
1644  _DEFV ();
1645  _RETV (1.0 / sin (*v1));
1646 }
1647 
1648 // ************* arcus cosecans *******************
1650  _ARD0 (d1);
1651  _DEFD ();
1652  _RETD (std::asin (1.0 / d1));
1653 }
1654 
1656  _ARC0 (c1);
1657  _DEFC ();
1658  _RETC (asin (1.0 / *c1));
1659 }
1660 
1662  _ARV0 (v1);
1663  _DEFV ();
1664  _RETV (asin (1.0 / *v1));
1665 }
1666 
1667 // ********** area sine hyperbolicus **************
1669  _ARD0 (d1);
1670  _DEFD ();
1671  _RETD (log (d1 + sqrt (d1 * d1 + 1)));
1672 }
1673 
1675  _ARC0 (c1);
1676  _DEFC ();
1677  _RETC (asinh (*c1));
1678 }
1679 
1681  _ARV0 (v1);
1682  _DEFV ();
1683  _RETV (asinh (*v1));
1684 }
1685 
1686 // ********** area cosecans hyperbolicus **************
1688  _ARD0 (d1);
1689  _DEFD ();
1690  d1 = 1 / d1;
1691  _RETD (log (d1 + sqrt (d1 * d1 + 1)));
1692 }
1693 
1695  _ARC0 (c1);
1696  _DEFC ();
1697  _RETC (asinh (1.0 / *c1));
1698 }
1699 
1701  _ARV0 (v1);
1702  _DEFV ();
1703  _RETV (asinh (1 / *v1));
1704 }
1705 
1706 // ********* area cosine hyperbolicus ************
1708  _ARD0 (d1);
1709  _DEFC ();
1710  _RETC (acosh (nr_complex_t (d1)));
1711 }
1712 
1714  _ARC0 (c1);
1715  _DEFC ();
1716  _RETC (acosh (*c1));
1717 }
1718 
1720  _ARV0 (v1);
1721  _DEFV ();
1722  _RETV (acosh (*v1));
1723 }
1724 
1725 // ********* area secans hyperbolicus ***********
1727  _ARD0 (d1);
1728  _DEFC ();
1729  _RETC (asech (nr_complex_t (d1)));
1730 }
1731 
1733  _ARC0 (c1);
1734  _DEFC ();
1735  _RETC (asech (*c1));
1736 }
1737 
1739  _ARV0 (v1);
1740  _DEFV ();
1741  _RETV (asech (*v1));
1742 }
1743 
1744 // ******* area tangent hyperbolicus **********
1746  _ARD0 (d1);
1747  _DEFD ();
1748  _RETD (0.5 * log ((1.0 + d1) / (1.0 - d1)));
1749 }
1750 
1752  _ARC0 (c1);
1753  _DEFC ();
1754  _RETC (atanh (*c1));
1755 }
1756 
1758  _ARV0 (v1);
1759  _DEFV ();
1760  _RETV (atanh (*v1));
1761 }
1762 
1763 // ******* area cotangent hyperbolicus **********
1765  _ARD0 (d1);
1766  _DEFD ();
1767  _RETD (0.5 * std::log ((d1 + 1.0) / (d1 - 1.0)));
1768 }
1769 
1771  _ARC0 (c1);
1772  _DEFC ();
1773  _RETC (qucs::acoth (*c1));
1774 }
1775 
1777  _ARV0 (v1);
1778  _DEFV ();
1779  _RETV (qucs::acoth (*v1));
1780 }
1781 
1782 // This is the rtoz, ztor, ytor, rtoy helper macro.
1783 #define MAKE_FUNC_DEFINITION_2(cfunc) \
1784 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d) (constant * args) { \
1785  _ARD0 (d); \
1786  _DEFD (); \
1787  _RETD (real (cfunc (nr_complex_t (d, 0)))); \
1788 } \
1789 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d_d) (constant * args) { \
1790  _ARD0 (d); \
1791  _ARD1 (z); \
1792  _DEFD (); \
1793  _RETD (real (cfunc (nr_complex_t (d, 0), z))); \
1794 } \
1795 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d_c) (constant * args) { \
1796  _ARD0 (d); \
1797  _ARC1 (z); \
1798  _DEFC (); \
1799  _RETC (cfunc (nr_complex_t (d, 0), *z)); \
1800 } \
1801 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c) (constant * args) { \
1802  _ARC0 (c); \
1803  _DEFC (); \
1804  _RETC (cfunc (*c)); \
1805 } \
1806 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c_d) (constant * args) { \
1807  _ARC0 (c); \
1808  _ARD1 (z); \
1809  _DEFC (); \
1810  _RETC (cfunc (*c, z)); \
1811 } \
1812 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c_c) (constant * args) { \
1813  _ARC0 (c); \
1814  _ARC1 (z); \
1815  _DEFC (); \
1816  _RETC (cfunc (*c, *z)); \
1817 } \
1818 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v) (constant * args) { \
1819  _ARV0 (v); \
1820  _DEFV (); \
1821  _RETV (cfunc (*v)); \
1822 } \
1823 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v_d) (constant * args) { \
1824  _ARV0 (v); \
1825  _ARD1 (z); \
1826  _DEFV (); \
1827  _RETV (cfunc (*v, z)); \
1828 } \
1829 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v_c) (constant * args) { \
1830  _ARV0 (v); \
1831  _ARC1 (z); \
1832  _DEFV (); \
1833  _RETV (cfunc (*v, *z)); \
1834 } \
1835 
1840 
1841 // ** convert reflexion coefficient to standing wave ratio **
1843  _ARD0 (d1);
1844  _DEFD ();
1845  _RETD ((1 + fabs (d1)) / (1 - fabs (d1)));
1846 }
1847 
1849  _ARC0 (c1);
1850  _DEFD ();
1851  _RETD ((1 + abs (*c1)) / (1 - abs (*c1)));
1852 }
1853 
1855  _ARV0 (v1);
1856  _DEFV ();
1857  res->v = new qucs::vector (v1->getSize ());
1858  for (int i = 0; i < v1->getSize (); i++)
1859  res->v->set ((1 + abs (v1->get (i))) / (1 - abs (v1->get (i))), i);
1860  return res;
1861 }
1862 
1863 // ** differentiate vector with respect to another vector **
1865  _ARV0 (v1);
1866  _ARV1 (v2);
1867  _DEFV ();
1868  _RETV (diff (*v1, *v2));
1869 }
1870 
1872  _ARV0 (v1);
1873  _ARV1 (v2);
1874  _ARI2 (i3);
1875  _DEFV ();
1876  _RETV (diff (*v1, *v2, i3));
1877 }
1878 
1879 // ***************** maximum *******************
1881  _ARD0 (d1);
1882  _DEFD ();
1883  _RETD (d1);
1884 }
1885 
1887  _ARC0 (c1);
1888  _DEFD ();
1889  if (fabs (arg (*c1)) < M_PI_2)
1890  res->d = abs (*c1);
1891  else
1892  res->d = -abs (*c1);
1893  return res;
1894 }
1895 
1897  _ARV0 (v1);
1898  _DEFD ();
1899  _RETD (v1->maximum ());
1900 }
1901 
1903  _ARD0 (d1);
1904  _ARD1 (d2);
1905  _DEFD ();
1906  _RETD (MAX (d1, d2));
1907 }
1908 
1910  _ARD0 (d1);
1911  _ARC1 (c2);
1912  _DEFC ();
1913  nr_double_t a = d1;
1914  nr_double_t b = fabs (arg (*c2)) < M_PI_2 ? abs (*c2) : -abs (*c2);
1915  nr_complex_t r = a > b ? d1 : *c2;
1916  _RETC (r);
1917 }
1918 
1920  _ARC0 (c1);
1921  _ARC1 (c2);
1922  _DEFC ();
1923  nr_double_t a = fabs (arg (*c1)) < M_PI_2 ? abs (*c1) : -abs (*c1);
1924  nr_double_t b = fabs (arg (*c2)) < M_PI_2 ? abs (*c2) : -abs (*c2);
1925  nr_complex_t r = a > b ? *c1 : *c2;
1926  _RETC (r);
1927 }
1928 
1930  _ARC0 (c1);
1931  _ARD1 (d2);
1932  _DEFC ();
1933  nr_double_t a = fabs (arg (*c1)) < M_PI_2 ? abs (*c1) : -abs (*c1);
1934  nr_double_t b = d2;
1935  nr_complex_t r = a > b ? *c1 : d2;
1936  _RETC (r);
1937 }
1938 
1939 // ***************** minimum *******************
1941  _ARD0 (d1);
1942  _DEFD ();
1943  _RETD (d1);
1944 }
1945 
1947  _ARC0 (c1);
1948  _DEFD ();
1949  if (fabs (arg (*c1)) < M_PI_2)
1950  res->d = abs (*c1);
1951  else
1952  res->d = -abs (*c1);
1953  return res;
1954 }
1955 
1957  _ARV0 (v1);
1958  _DEFD ();
1959  _RETD (v1->minimum ());
1960 }
1961 
1963  _ARD0 (d1);
1964  _ARD1 (d2);
1965  _DEFD ();
1966  _RETD (MIN (d1, d2));
1967 }
1968 
1970  _ARD0 (d1);
1971  _ARC1 (c2);
1972  _DEFC ();
1973  nr_double_t a = d1;
1974  nr_double_t b = fabs (arg (*c2)) < M_PI_2 ? abs (*c2) : -abs (*c2);
1975  nr_complex_t r = a < b ? d1 : *c2;
1976  _RETC (r);
1977 }
1978 
1980  _ARC0 (c1);
1981  _ARC1 (c2);
1982  _DEFC ();
1983  nr_double_t a = fabs (arg (*c1)) < M_PI_2 ? abs (*c1) : -abs (*c1);
1984  nr_double_t b = fabs (arg (*c2)) < M_PI_2 ? abs (*c2) : -abs (*c2);
1985  nr_complex_t r = a < b ? *c1 : *c2;
1986  _RETC (r);
1987 }
1988 
1990  _ARC0 (c1);
1991  _ARD1 (d2);
1992  _DEFC ();
1993  nr_double_t a = fabs (arg (*c1)) < M_PI_2 ? abs (*c1) : -abs (*c1);
1994  nr_double_t b = d2;
1995  nr_complex_t r = a < b ? *c1 : d2;
1996  _RETC (r);
1997 }
1998 
1999 // ******************** sum **********************
2001  _ARD0 (d1);
2002  _DEFD ();
2003  _RETD (d1);
2004 }
2005 
2007  _ARC0 (c1);
2008  _DEFC ();
2009  _RETC (*c1);
2010 }
2011 
2013  _ARV0 (v1);
2014  _DEFC ();
2015  _RETC (sum (*v1));
2016 }
2017 
2018 // ****************** product ********************
2020  _ARD0 (d1);
2021  _DEFD ();
2022  _RETD (d1);
2023 }
2024 
2026  _ARC0 (c1);
2027  _DEFC ();
2028  _RETC (*c1);
2029 }
2030 
2032  _ARV0 (v1);
2033  _DEFC ();
2034  _RETC (prod (*v1));
2035 }
2036 
2037 // ******************* average *********************
2039  _ARD0 (d1);
2040  _DEFD ();
2041  _RETD (d1);
2042 }
2043 
2045  _ARC0 (c1);
2046  _DEFC ();
2047  _RETC (*c1);
2048 }
2049 
2051  _ARV0 (v1);
2052  _DEFC ();
2053  _RETC (avg (*v1));
2054 }
2055 
2056 // ******************* lengths *********************
2058  _DEFD ();
2059  _RETD (1);
2060 }
2061 
2063  _DEFD ();
2064  _RETD (1);
2065 }
2066 
2068  _ARV0 (v1);
2069  _DEFD ();
2070  _RETD (v1->getSize ());
2071 }
2072 
2074  _DEFD ();
2075  _RETD (1);
2076 }
2077 
2079  _ARV0 (mv);
2080  _DEFD ();
2081  _RETD (mv->getSize ());
2082 }
2083 
2084 // ***************** array indices *****************
2086  _ARMV0 (mv);
2087  _ARI1 (r);
2088  _ARI2 (c);
2089  _DEFV ();
2090  if (r < 1 || r > mv->getRows () || c < 1 || c > mv->getCols ()) {
2091  char txt[256];
2092  sprintf (txt, "matvec indices [%d,%d] out of bounds [1-%d,1-%d]",
2093  r, c, mv->getRows (), mv->getCols ());
2094  THROW_MATH_EXCEPTION (txt);
2095  res->v = new qucs::vector (mv->getSize ());
2096  } else {
2097  res->v = new qucs::vector (mv->get (r - 1, c - 1));
2098  }
2099  return res;
2100 }
2101 
2103  _ARMV0 (mv);
2104  _ARI1 (i);
2105  _DEFM ();
2106  if (i < 1 || i > mv->getSize ()) {
2107  char txt[256];
2108  sprintf (txt, "matvec index [%d] out of bounds [1-%d]", i, mv->getSize ());
2109  THROW_MATH_EXCEPTION (txt);
2110  res->m = new matrix (mv->getRows (), mv->getCols ());
2111  } else {
2112  res->m = new matrix (mv->get (i - 1));
2113  }
2114  return res;
2115 }
2116 
2117 /* Little helper macros for the following functionality. */
2118 #define EQUATION_HAS_DEPS(v,n) \
2119  ((v)->getDataDependencies() != NULL && \
2120  (v)->getDataDependencies()->length() >= n)
2121 #define EQUATION_DEPS(v) \
2122  ((v)->getDataDependencies() ? (v)->getDataDependencies()->length() : 1)
2123 
2124 /* This following function is used to get a subset of data entries
2125  from a data vector with certain data dependencies. */
2126 void evaluate::extract_vector (constant * args, int idx, int &skip, int &size,
2127  constant * res) {
2128  _ARV0 (v);
2129  int i = INT (_ARES (idx));
2130  int type = _ARG(idx)->getType ();
2131  qucs::vector * vres;
2132  strlist * deps = _ARES(0)->getDataDependencies ();
2133  int didx = (deps ? deps->length () : 0) - idx;
2134  int dsize = SOLVEE(0)->getDependencySize (deps, idx);
2135 
2136  // all of the data vector
2137  if (type == TAG_RANGE) {
2138  if (dsize > 1) {
2139  // dependent vectors: only ':' possible
2140  vres = new qucs::vector (*(res->v));
2141  skip *= deps ? SOLVEE(0)->getDataSize (deps->get (didx - 1)) : 1;
2142  size *= deps ? SOLVEE(0)->getDataSize (deps->get (didx)) : 1;
2143  }
2144  else {
2145  // independent vectors
2146  range * r = RNG (_ARES (idx));
2147  int i, n, k;
2148  int len = res->v->getSize ();
2149  i = (int) r->lo ();
2150  if (i < 0 || i >= len) {
2151  char txt[256];
2152  sprintf (txt, "vector index %d out of bounds [%d,%d]", i, 0, len - 1);
2153  THROW_MATH_EXCEPTION (txt);
2154  }
2155  i = (int) r->hi ();
2156  if (i < 0 || i >= len) {
2157  char txt[256];
2158  sprintf (txt, "vector index %d out of bounds [%d,%d]", i, 0, len - 1);
2159  THROW_MATH_EXCEPTION (txt);
2160  }
2161  size = 0;
2162  for (n = 0; n < len; n++) if (r->inside (n)) size++;
2163  vres = new qucs::vector (size);
2164  for (k = 0, n = 0; n < len; n++) {
2165  if (r->inside (n))
2166  vres->set (res->v->get (n), k++);
2167  }
2168  }
2169  }
2170  // a subset
2171  else {
2172  vres = new qucs::vector (dsize * size);
2173  int len = deps ? SOLVEE(0)->getDataSize (deps->get (didx)) : v->getSize ();
2174  if (i < 0 || i >= len) {
2175  char txt[256];
2176  sprintf (txt, "vector index %d (%d) out of bounds [%d,%d]",
2177  idx, i, 0, len - 1);
2178  THROW_MATH_EXCEPTION (txt);
2179  } else {
2180  int k, n;
2181  for (n = k = 0; k < dsize * size; n += skip, k++) {
2182  vres->set (res->v->get (dsize * i + n), k);
2183  }
2184  }
2185  if (deps && didx >= 0) {
2186  res->addDropDependencies (deps->get (didx));
2187  }
2188  }
2189  if (res->v != NULL) delete res->v;
2190  res->v = vres;
2191 }
2192 
2194  _ARV0 (v);
2195  _DEFV ();
2196  int skip = 1, size = 1;
2197  res->v = new qucs::vector (*v);
2198  extract_vector (args, 1, skip, size, res);
2199  return res;
2200 }
2201 
2203  _ARV0 (v);
2204  _DEFV ();
2205  int skip = 1, size = 1;
2206  res->v = new qucs::vector (*v);
2207  if (!EQUATION_HAS_DEPS (_ARES(0), 2)) {
2208  char txt[256];
2209  sprintf (txt, "invalid number of vector indices (%d > %d)", 2,
2210  EQUATION_DEPS (_ARES(0)));
2211  THROW_MATH_EXCEPTION (txt);
2212  return res;
2213  }
2214  extract_vector (args, 1, skip, size, res);
2215  extract_vector (args, 2, skip, size, res);
2216  return res;
2217 }
2218 
2220  _ARM0 (m);
2221  _ARI1 (r);
2222  _ARI2 (c);
2223  _DEFC ();
2224  if (r < 1 || r > m->getRows () || c < 1 || c > m->getCols ()) {
2225  char txt[256];
2226  sprintf (txt, "matrix indices [%d,%d] out of bounds [1-%d,1-%d]",
2227  r, c, m->getRows (), m->getCols ());
2228  THROW_MATH_EXCEPTION (txt);
2229  res->c = new nr_complex_t ();
2230  } else {
2231  res->c = new nr_complex_t (m->get (r - 1, c - 1));
2232  }
2233  return res;
2234 }
2235 
2237  char * s = STR (_ARES(0));
2238  _ARI1 (i);
2239  constant * res = new constant (TAG_CHAR);
2240  res->chr = (i >= 0 && i < (int) strlen (s)) ? s[i] : ' ';
2241  return res;
2242 }
2243 
2244 // Interpolator helper macro without number of points given.
2245 #define INTERPOL_HELPER() \
2246  constant * arg = new constant (TAG_DOUBLE); \
2247  arg->d = 64; \
2248  arg->solvee = args->getResult(0)->solvee; \
2249  arg->evaluate (); \
2250  args->append (arg);
2251 
2252 // ***************** interpolation *****************
2254  INTERPOL_HELPER();
2255  return interpolate_v_v_d (args);
2256 }
2257 
2259  _ARV0 (v1);
2260  _ARV1 (v2);
2261  _ARI2 (n);
2262  _DEFV ();
2263  if (v1->getSize () < 3) {
2264  THROW_MATH_EXCEPTION ("interpolate: number of datapoints must be greater "
2265  "than 2");
2266  res->v = new qucs::vector ();
2267  return res;
2268  }
2269  nr_double_t last = real (v2->get (v2->getSize () - 1));
2270  nr_double_t first = real (v2->get (0));
2271  constant * arg = new constant (TAG_VECTOR);
2272  arg->v = new qucs::vector (qucs::linspace (first, last, n));
2273  arg->solvee = args->getResult(0)->solvee;
2274  arg->evaluate ();
2275  qucs::vector * val = new qucs::vector (n);
2276  spline spl (SPLINE_BC_NATURAL);
2277  spl.vectors (*v1, *v2);
2278  spl.construct ();
2279  for (int k = 0; k < arg->v->getSize (); k++) {
2280  val->set (spl.evaluate (real (arg->v->get (k))).f0, k);
2281  }
2282  res->v = val;
2283  node * gen = SOLVEE(0)->addGeneratedEquation (arg->v, "Interpolate");
2284  res->addPrepDependencies (A(gen)->result);
2285  res->dropdeps = 1;
2286  delete arg;
2287  return res;
2288 }
2289 
2290 // ***************** fourier transformations *****************
2291 #define FOURIER_HELPER_1(efunc,cfunc,isign,dep) \
2292 constant * evaluate:: QUCS_CONCAT2 (efunc,_v_v) (constant * args) { \
2293  _ARV0 (v); \
2294  _ARV1 (t); \
2295  _DEFV (); \
2296  qucs::vector * val = new qucs::vector (QUCS_CONCAT2 (cfunc,_1d) (*v)); \
2297  int k = val->getSize (); \
2298  *val = isign > 0 ? *val / k : *val * k; \
2299  res->v = val; \
2300  int n = t->getSize (); \
2301  if (k != n) { \
2302  THROW_MATH_EXCEPTION ("nonconformant vector lengths"); \
2303  return res; } \
2304  nr_double_t last = real (t->get (n - 1)); \
2305  nr_double_t first = real (t->get (0)); \
2306  nr_double_t delta = (last - first) / (n - 1); \
2307  constant * arg = new constant (TAG_VECTOR); \
2308  arg->v = new qucs::vector (qucs::linspace (0, 1.0 / delta, n)); \
2309  arg->solvee = args->getResult(0)->solvee; \
2310  arg->evaluate (); \
2311  node * gen = SOLVEE(0)->addGeneratedEquation (arg->v, dep); \
2312  res->addPrepDependencies (A(gen)->result); \
2313  res->dropdeps = 1; \
2314  args->append (arg); \
2315  return res; \
2316 }
2317 
2318 #define FOURIER_HELPER_2(cfunc) \
2319 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v) (constant * args) { \
2320  _ARV0 (v); \
2321  _DEFV (); \
2322  qucs::vector * val = new qucs::vector (QUCS_CONCAT2 (cfunc,_1d) (*v)); \
2323  res->v = val; \
2324  res->dropdeps = 1; \
2325  return res; \
2326 }
2327 
2328 FOURIER_HELPER_1 (time2freq,dft,1,"Frequency");
2329 FOURIER_HELPER_1 (freq2time,idft,-1,"Time");
2330 FOURIER_HELPER_2 (fft);
2331 FOURIER_HELPER_2 (ifft);
2332 FOURIER_HELPER_2 (dft);
2333 FOURIER_HELPER_2 (idft);
2334 
2335 // Shuffles values of FFT arounds.
2337  _ARV0 (v);
2338  _DEFV ();
2339  res->v = new qucs::vector (fftshift (*v));
2340  return res;
2341 }
2342 
2343 // This is the stoz, ztos, ytos, stoy helper macro.
2344 #define MAKE_FUNC_DEFINITION_3(cfunc) \
2345 constant * evaluate:: QUCS_CONCAT2 (cfunc,_m) (constant * args) { \
2346  _ARM0 (m); \
2347  _DEFM (); \
2348  _RETM (cfunc (*m)); \
2349 } \
2350 constant * evaluate:: QUCS_CONCAT2 (cfunc,_m_d) (constant * args) { \
2351  _ARM0 (m); \
2352  _ARD1 (z); \
2353  _DEFM (); \
2354  _RETM (cfunc (*m, nr_complex_t (z, 0))); \
2355 } \
2356 constant * evaluate:: QUCS_CONCAT2 (cfunc,_m_c) (constant * args) { \
2357  _ARM0 (m); \
2358  _ARC1 (z); \
2359  _DEFM (); \
2360  _RETM (cfunc (*m, *z)); \
2361 } \
2362 constant * evaluate:: QUCS_CONCAT2 (cfunc,_m_v) (constant * args) { \
2363  _ARM0 (m); \
2364  _ARV1 (z); \
2365  _DEFM (); \
2366  _RETM (cfunc (*m, *z)); \
2367 } \
2368 constant * evaluate:: QUCS_CONCAT2 (cfunc,_mv) (constant * args) { \
2369  _ARMV0 (m); \
2370  _DEFMV (); \
2371  _RETMV (cfunc (*m)); \
2372 } \
2373 constant * evaluate:: QUCS_CONCAT2 (cfunc,_mv_d) (constant * args) { \
2374  _ARMV0 (m); \
2375  _ARD1 (z); \
2376  _DEFMV (); \
2377  _RETMV (cfunc (*m, nr_complex_t (z, 0))); \
2378 } \
2379 constant * evaluate:: QUCS_CONCAT2 (cfunc,_mv_c) (constant * args) { \
2380  _ARMV0 (m); \
2381  _ARC1 (z); \
2382  _DEFMV (); \
2383  _RETMV (cfunc (*m, *z)); \
2384 } \
2385 constant * evaluate:: QUCS_CONCAT2 (cfunc,_mv_v) (constant * args) { \
2386  _ARMV0 (m); \
2387  _ARV1 (z); \
2388  _DEFMV (); \
2389  _RETMV (cfunc (*m, *z)); \
2390 } \
2391 
2396 
2397 // ***************** matrix conversions *****************
2399  _ARM0 (m);
2400  _DEFM ();
2401  _RETM (ytoz (*m));
2402 }
2403 
2405  _ARMV0 (mv);
2406  _DEFMV ();
2407  _RETMV (ytoz (*mv));
2408 }
2409 
2411  _ARM0 (m);
2412  _DEFM ();
2413  _RETM (ztoy (*m));
2414 }
2415 
2417  _ARMV0 (mv);
2418  _DEFMV ();
2419  _RETMV (ztoy (*mv));
2420 }
2421 
2422 // These are stos() helpers.
2423 #define _CHKM(m) /* check square matrix */ \
2424  if (m->getCols () != m->getRows ()) { \
2425  THROW_MATH_EXCEPTION ("stos: not a square matrix"); \
2426  res->m = new matrix (m->getRows (), m->getCols ()); \
2427  return res; }
2428 #define _CHKMV(mv) /* check square matrix vector */ \
2429  if (mv->getCols () != mv->getRows ()) { \
2430  THROW_MATH_EXCEPTION ("stos: not a square matrix"); \
2431  res->mv = new matvec (mv->getSize (), mv->getRows (), mv->getCols ()); \
2432  return res; }
2433 #define _CHKMA(m,cond) \
2434  if (!(cond)) { \
2435  THROW_MATH_EXCEPTION ("stos: nonconformant arguments"); \
2436  res->m = new matrix (m->getRows (), m->getCols ()); \
2437  return res; }
2438 #define _CHKMVA(mv,cond) \
2439  if (!(cond)) { \
2440  THROW_MATH_EXCEPTION ("stos: nonconformant arguments"); \
2441  res->mv = new matvec (mv->getSize (), mv->getRows (), mv->getCols ()); \
2442  return res; }
2443 
2444 // Function -- MATRIX stos (MATRIX, DOUBLE)
2446  _ARM0 (m); _ARD1 (zref); _DEFM ();
2447  _CHKM (m);
2448  _RETM (stos (*m, zref));
2449 }
2450 
2451 // Function -- MATRIX stos (MATRIX, COMPLEX)
2453  _ARM0 (m); _ARC1 (zref); _DEFM ();
2454  _CHKM (m);
2455  _RETM (stos (*m, *zref));
2456 }
2457 
2458 // Function -- MATRIX stos (MATRIX, DOUBLE, DOUBLE)
2460  _ARM0 (m); _ARD1 (zref); _ARD2 (z0); _DEFM ();
2461  _CHKM (m);
2462  _RETM (stos (*m, zref, z0));
2463 }
2464 
2465 // Function -- MATRIX stos (MATRIX, DOUBLE, COMPLEX)
2467  _ARM0 (m); _ARD1 (zref); _ARC2 (z0); _DEFM ();
2468  _CHKM (m);
2469  _RETM (stos (*m, nr_complex_t (zref, 0), *z0));
2470 }
2471 
2472 // Function -- MATRIX stos (MATRIX, COMPLEX, DOUBLE)
2474  _ARM0 (m); _ARC1 (zref); _ARD2 (z0); _DEFM ();
2475  _CHKM (m);
2476  _RETM (stos (*m, *zref, nr_complex_t (z0, 0)));
2477 }
2478 
2479 // Function -- MATRIX stos (MATRIX, COMPLEX, COMPLEX)
2481  _ARM0 (m); _ARC1 (zref); _ARC2 (z0); _DEFM ();
2482  _CHKM (m);
2483  _RETM (stos (*m, *zref, *z0));
2484 }
2485 
2486 // Function -- MATRIX stos (MATRIX, VECTOR)
2488  _ARM0 (m); _ARV1 (zref); _DEFM ();
2489  _CHKM (m); _CHKMA (m, m->getRows () == zref->getSize ());
2490  _RETM (stos (*m, *zref));
2491 }
2492 
2493 // Function -- MATRIX stos (MATRIX, VECTOR, DOUBLE)
2495  _ARM0 (m); _ARV1 (zref); _ARD2 (z0); _DEFM ();
2496  _CHKM (m); _CHKMA (m, m->getRows () == zref->getSize ());
2497  _RETM (stos (*m, *zref, nr_complex_t (z0, 0)));
2498 }
2499 
2500 // Function -- MATRIX stos (MATRIX, VECTOR, COMPLEX)
2502  _ARM0 (m); _ARV1 (zref); _ARC2 (z0); _DEFM ();
2503  _CHKM (m); _CHKMA (m, m->getRows () == zref->getSize ());
2504  _RETM (stos (*m, *zref, *z0));
2505 }
2506 
2507 // Function -- MATRIX stos (MATRIX, DOUBLE, VECTOR)
2509  _ARM0 (m); _ARD1 (zref); _ARV2 (z0); _DEFM ();
2510  _CHKM (m); _CHKMA (m, m->getRows () == z0->getSize ());
2511  _RETM (stos (*m, nr_complex_t (zref, 0), *z0));
2512 }
2513 
2514 // Function -- MATRIX stos (MATRIX, COMPLEX, VECTOR)
2516  _ARM0 (m); _ARC1 (zref); _ARV2 (z0); _DEFM ();
2517  _CHKM (m); _CHKMA (m, m->getRows () == z0->getSize ());
2518  _RETM (stos (*m, *zref, *z0));
2519 }
2520 
2521 // Function -- MATRIX stos (MATRIX, VECTOR, VECTOR)
2523  _ARM0 (m); _ARV1 (zref); _ARV2 (z0); _DEFM ();
2524  _CHKM (m); _CHKMA (m, m->getRows () == z0->getSize () &&
2525  m->getRows () == zref->getSize ());
2526  _RETM (stos (*m, *zref, *z0));
2527 }
2528 
2529 // Function -- MATVEC stos (MATVEC, DOUBLE)
2531  _ARMV0 (mv); _ARD1 (zref); _DEFMV ();
2532  _CHKMV (mv);
2533  _RETMV (stos (*mv, zref));
2534 }
2535 
2536 // Function -- MATVEC stos (MATVEC, COMPLEX)
2538  _ARMV0 (mv); _ARC1 (zref); _DEFMV ();
2539  _CHKMV (mv);
2540  _RETMV (stos (*mv, *zref));
2541 }
2542 
2543 // Function -- MATVEC stos (MATVEC, DOUBLE, DOUBLE)
2545  _ARMV0 (mv); _ARD1 (zref); _ARD2 (z0); _DEFMV ();
2546  _CHKMV (mv);
2547  _RETMV (stos (*mv, zref, z0));
2548 }
2549 
2550 // Function -- MATVEC stos (MATVEC, DOUBLE, COMPLEX)
2552  _ARMV0 (mv); _ARD1 (zref); _ARC2 (z0); _DEFMV ();
2553  _CHKMV (mv);
2554  _RETMV (stos (*mv, nr_complex_t (zref, 0), *z0));
2555 }
2556 
2557 // Function -- MATVEC stos (MATVEC, COMPLEX, DOUBLE)
2559  _ARMV0 (mv); _ARC1 (zref); _ARD2 (z0); _DEFMV ();
2560  _CHKMV (mv);
2561  _RETMV (stos (*mv, *zref, nr_complex_t (z0, 0)));
2562 }
2563 
2564 // Function -- MATVEC stos (MATVEC, COMPLEX, COMPLEX)
2566  _ARMV0 (mv); _ARC1 (zref); _ARC2 (z0); _DEFMV ();
2567  _CHKMV (mv);
2568  _RETMV (stos (*mv, *zref, *z0));
2569 }
2570 
2571 // Function -- MATVEC stos (MATVEC, VECTOR)
2573  _ARMV0 (mv); _ARV1 (zref); _DEFMV ();
2574  _CHKMV (mv); _CHKMVA (mv, mv->getRows () == zref->getSize ());
2575  _RETMV (stos (*mv, *zref));
2576 }
2577 
2578 // Function -- MATVEC stos (MATVEC, VECTOR, DOUBLE)
2580  _ARMV0 (mv); _ARV1 (zref); _ARD2 (z0); _DEFMV ();
2581  _CHKMV (mv); _CHKMVA (mv, mv->getRows () == zref->getSize ());
2582  _RETMV (stos (*mv, *zref, nr_complex_t (z0, 0)));
2583 }
2584 
2585 // Function -- MATVEC stos (MATVEC, VECTOR, COMPLEX)
2587  _ARMV0 (mv); _ARV1 (zref); _ARC2 (z0); _DEFMV ();
2588  _CHKMV (mv); _CHKMVA (mv, mv->getRows () == zref->getSize ());
2589  _RETMV (stos (*mv, *zref, *z0));
2590 }
2591 
2592 // Function -- MATVEC stos (MATVEC, DOUBLE, VECTOR)
2594  _ARMV0 (mv); _ARD1 (zref); _ARV2 (z0); _DEFMV ();
2595  _CHKMV (mv); _CHKMVA (mv, mv->getRows () == z0->getSize ());
2596  _RETMV (stos (*mv, nr_complex_t (zref, 0), *z0));
2597 }
2598 
2599 // Function -- MATVEC stos (MATVEC, COMPLEX, VECTOR)
2601  _ARMV0 (mv); _ARC1 (zref); _ARV2 (z0); _DEFMV ();
2602  _CHKMV (mv); _CHKMVA (mv, mv->getRows () == z0->getSize ());
2603  _RETMV (stos (*mv, *zref, *z0));
2604 }
2605 
2606 // Function -- MATVEC stos (MATVEC, VECTOR, VECTOR)
2608  _ARMV0 (mv); _ARV1 (zref); _ARV2 (z0); _DEFMV ();
2609  _CHKMV (mv); _CHKMVA (mv, mv->getRows () == z0->getSize () &&
2610  mv->getRows () == zref->getSize ());
2611  _RETMV (stos (*mv, *zref, *z0));
2612 }
2613 
2615  _ARM0 (m);
2616  char f = CHR (_ARES(1));
2617  char t = CHR (_ARES(2));
2618  _DEFM ();
2619  if (m->getRows () < 2 || m->getCols () < 2) {
2620  THROW_MATH_EXCEPTION ("invalid matrix dimensions for twoport "
2621  "transformation");
2622  _RETM (*m);
2623  }
2624  _RETM (twoport (*m, toupper (f), toupper (t)));
2625 }
2626 
2628  _ARMV0 (mv);
2629  char f = CHR (_ARES(1));
2630  char t = CHR (_ARES(2));
2631  _DEFMV ();
2632  if (mv->getRows () < 2 || mv->getCols () < 2) {
2633  THROW_MATH_EXCEPTION ("invalid matrix dimensions for twoport "
2634  "transformation");
2635  _RETMV (*mv);
2636  }
2637  _RETMV (twoport (*mv, toupper (f), toupper (t)));
2638 }
2639 
2641  _ARM0 (m);
2642  _DEFM ();
2643  _RETM (inverse (*m));
2644 }
2645 
2647  _ARMV0 (mv);
2648  _DEFMV ();
2649  _RETMV (inverse (*mv));
2650 }
2651 
2653  _ARM0 (m);
2654  _DEFM ();
2655  _RETM (transpose (*m));
2656 }
2657 
2659  _ARMV0 (mv);
2660  _DEFMV ();
2661  _RETMV (transpose (*mv));
2662 }
2663 
2665  _ARM0 (m);
2666  _DEFC ();
2667  _RETC (det (*m));
2668 }
2669 
2671  _ARMV0 (mv);
2672  _DEFV ();
2673  _RETV (det (*mv));
2674 }
2675 
2677  _ARI0 (i);
2678  _DEFM ();
2679  _RETM (eye (i));
2680 }
2681 
2683  _ARM0 (m);
2684  _DEFM ();
2685  _RETM (adjoint (*m));
2686 }
2687 
2689  _ARMV0 (mv);
2690  _DEFMV ();
2691  _RETMV (adjoint (*mv));
2692 }
2693 
2694 // ***************** s-parameter stability factors *****************
2696  _ARM0 (m);
2697  _DEFD ();
2698  _RETD (rollet (*m));
2699 }
2700 
2702  _ARMV0 (mv);
2703  _DEFV ();
2704  _RETV (rollet (*mv));
2705 }
2706 
2708  _ARM0 (m);
2709  _DEFD ();
2710  nr_double_t k;
2711  k = (1 - norm (m->get (0, 0))) /
2712  (abs (m->get (1, 1) - conj (m->get (0, 0)) * det (*m)) +
2713  abs (m->get (0, 1) * m->get (1, 0)));
2714  _RETD (k);
2715 }
2716 
2718  _ARMV0 (mv);
2719  _DEFV ();
2720  qucs::vector k;
2721  k = (1 - norm (mv->get (0, 0))) /
2722  (abs (mv->get (1, 1) - conj (mv->get (0, 0)) * det (*mv)) +
2723  abs (mv->get (0, 1) * mv->get (1, 0)));
2724  _RETV (k);
2725 }
2726 
2728  _ARM0 (m);
2729  _DEFD ();
2730  nr_double_t k;
2731  k = (1 - norm (m->get (1, 1))) /
2732  (abs (m->get (0, 0) - conj (m->get (1, 1)) * det (*m)) +
2733  abs (m->get (0, 1) * m->get (1, 0)));
2734  _RETD (k);
2735 }
2736 
2738  _ARMV0 (mv);
2739  _DEFV ();
2740  qucs::vector k;
2741  k = (1 - norm (mv->get (1, 1))) /
2742  (abs (mv->get (0, 0) - conj (mv->get (1, 1)) * det (*mv)) +
2743  abs (mv->get (0, 1) * mv->get (1, 0)));
2744  _RETV (k);
2745 }
2746 
2748  _ARM0 (m);
2749  _DEFD ();
2750  _RETD (b1 (*m));
2751 }
2752 
2754  _ARMV0 (mv);
2755  _DEFV ();
2756  _RETV (b1 (*mv));
2757 }
2758 
2759 // ***************** vector creation *****************
2761  _ARD0 (start);
2762  _ARD1 (stop);
2763  _ARI2 (points);
2764  _DEFV ();
2765  if (points < 2) {
2766  THROW_MATH_EXCEPTION ("linspace: number of points must be greater than 1");
2767  res->v = new qucs::vector ();
2768  return res;
2769  }
2771 }
2772 
2774  _ARD0 (start);
2775  _ARD1 (stop);
2776  _ARI2 (points);
2777  _DEFV ();
2778  if (points < 2) {
2779  THROW_MATH_EXCEPTION ("logspace: number of points must be greater than 1");
2780  res->v = new qucs::vector ();
2781  return res;
2782  }
2783  if (start * stop <= 0) {
2784  THROW_MATH_EXCEPTION ("logspace: invalid start/stop values");
2785  res->v = new qucs::vector (points);
2786  return res;
2787  }
2789 }
2790 
2791 // Circle helper macro with a number of points given.
2792 #define CIRCLE_HELPER_D(argi) \
2793  int n = INT (args->getResult (argi)); \
2794  if (n < 2) { \
2795  THROW_MATH_EXCEPTION ("Circle: number of points must be greater than 1"); \
2796  _DEFV (); \
2797  res->v = new qucs::vector (); \
2798  return res; \
2799  } \
2800  constant * arg = new constant (TAG_VECTOR); \
2801  arg->v = new qucs::vector (qucs::linspace (0, 360, n)); \
2802  arg->solvee = args->getResult(0)->solvee; \
2803  arg->evaluate (); \
2804  delete args->get(argi); \
2805  args->get((argi)-1)->setNext (NULL); \
2806  args->append (arg);
2807 
2808 // Circle helper macro with no additional argument given.
2809 #define CIRCLE_HELPER_A() \
2810  constant * arg = new constant (TAG_VECTOR); \
2811  arg->v = new qucs::vector (qucs::linspace (0, 360, 64)); \
2812  arg->solvee = args->getResult(0)->solvee; \
2813  arg->evaluate (); \
2814  args->append (arg);
2815 
2816 // ***************** s-parameter noise circles *****************
2818  qucs::vector * Sopt = V (_ARES(0));
2819  qucs::vector * Fmin = V (_ARES(1));
2820  qucs::vector * Rn = V (_ARES(2));
2821  nr_double_t F = D (_ARES(3));
2822  qucs::vector * arc = V (_ARES(4));
2823 
2824  _DEFV ();
2825  qucs::vector N = circuit::z0 / 4 / *Rn * (F - *Fmin) * norm (1 + *Sopt);
2826  qucs::vector R = sqrt (N * N + N * (1 - norm (*Sopt))) / (1 + N);
2827  qucs::vector C = *Sopt / (1 + N);
2828  qucs::vector * circle = new qucs::vector (C.getSize () * arc->getSize ());
2829  int i, a, j; nr_complex_t v;
2830  for (i = 0, j = 0; i < C.getSize (); i++) {
2831  for (a = 0; a < arc->getSize (); a++, j++) {
2832  v = C.get (i) + R.get (i) * exp (nr_complex_t (0, 1) * rad (arc->get (a)));
2833  circle->set (v, j);
2834  }
2835  }
2836 
2837  node * gen = SOLVEE(4)->addGeneratedEquation (arc, "Arcs");
2838  res->addPrepDependencies (A(gen)->result);
2839  res->v = circle;
2840  return res;
2841 }
2842 
2844  CIRCLE_HELPER_D (4);
2845  return noise_circle_d_v (args);
2846 }
2847 
2849  CIRCLE_HELPER_A ();
2850  return noise_circle_d_v (args);
2851 }
2852 
2854  qucs::vector * Sopt = V (_ARES(0));
2855  qucs::vector * Fmin = V (_ARES(1));
2856  qucs::vector * Rn = V (_ARES(2));
2857  qucs::vector * F = V (_ARES(3));
2858  :: vector * arc = V (_ARES(4));
2859 
2860  _DEFV ();
2861  qucs::vector * circle =
2862  new qucs::vector (Sopt->getSize () * arc->getSize () * F->getSize ());
2863  int i, a, j, f; nr_complex_t v; qucs::vector N, R, C;
2864  for (f = 0; f < F->getSize (); f++) {
2865  N = circuit::z0 / 4 / *Rn * (F->get (f) - *Fmin) * norm (1 + *Sopt);
2866  R = sqrt (N * N + N * (1 - norm (*Sopt))) / (1 + N);
2867  C = *Sopt / (1 + N);
2868  for (i = 0; i < C.getSize (); i++) {
2869  for (a = 0; a < arc->getSize (); a++) {
2870  v = C.get (i) + R.get (i) * exp (nr_complex_t (0, 1) * rad (arc->get (a)));
2871  j = i * F->getSize () * arc->getSize () + f * arc->getSize () + a;
2872  circle->set (v, j);
2873  }
2874  }
2875  }
2876 
2877  node * gen;
2878  gen = SOLVEE(3)->addGeneratedEquation (F, "NF");
2879  res->addPrepDependencies (A(gen)->result);
2880  gen = SOLVEE(4)->addGeneratedEquation (arc, "Arcs");
2881  res->addPrepDependencies (A(gen)->result);
2882 
2883  res->v = circle;
2884  return res;
2885 }
2886 
2888  CIRCLE_HELPER_D (4);
2889  return noise_circle_v_v (args);
2890 }
2891 
2893  CIRCLE_HELPER_A ();
2894  return noise_circle_v_v (args);
2895 }
2896 
2897 // ***************** s-parameter stability circles *****************
2899  _ARMV0 (S);
2900  _ARV1 (arc);
2901  _DEFV ();
2902  qucs::vector D = norm (S->get (1, 1)) - norm (det (*S));
2903  qucs::vector C = (conj (S->get (1, 1)) - S->get (0, 0) * conj (det (*S))) / D;
2904  qucs::vector R = abs (S->get (0, 1)) * abs (S->get (1, 0)) / D;
2905  qucs::vector * circle = new qucs::vector (S->getSize () * arc->getSize ());
2906  int a, d, i; nr_complex_t v;
2907  for (i = 0, d = 0; i < S->getSize (); i++) {
2908  for (a = 0; a < arc->getSize (); a++, d++) {
2909  v = C.get (i) + R.get (i) * exp (nr_complex_t (0, 1) * rad (arc->get (a)));
2910  circle->set (v, d);
2911  }
2912  }
2913  node * gen = SOLVEE(1)->addGeneratedEquation (arc, "Arcs");
2914  res->addPrepDependencies (A(gen)->result);
2915  res->v = circle;
2916  return res;
2917 }
2918 
2920  CIRCLE_HELPER_D (1);
2921  return stab_circle_l_v (args);
2922 }
2923 
2925  CIRCLE_HELPER_A ();
2926  return stab_circle_l_v (args);
2927 }
2928 
2930  _ARMV0 (S);
2931  _ARV1 (arc);
2932  _DEFV ();
2933  qucs::vector D = norm (S->get (0, 0)) - norm (det (*S));
2934  qucs::vector C = (conj (S->get (0, 0)) - S->get (1, 1) * conj (det (*S))) / D;
2935  qucs::vector R = abs (S->get (0, 1)) * abs (S->get (1, 0)) / D;
2936  qucs::vector * circle = new qucs::vector (S->getSize () * arc->getSize ());
2937  int a, d, i; nr_complex_t v;
2938  for (i = 0, d = 0; i < S->getSize (); i++) {
2939  for (a = 0; a < arc->getSize (); a++, d++) {
2940  v = C.get (i) + R.get (i) * exp (nr_complex_t (0, 1) * rad (arc->get (a)));
2941  circle->set (v, d);
2942  }
2943  }
2944  node * gen = SOLVEE(1)->addGeneratedEquation (arc, "Arcs");
2945  res->addPrepDependencies (A(gen)->result);
2946  res->v = circle;
2947  return res;
2948 }
2949 
2951  CIRCLE_HELPER_D (1);
2952  return stab_circle_s_v (args);
2953 }
2954 
2956  CIRCLE_HELPER_A ();
2957  return stab_circle_s_v (args);
2958 }
2959 
2960 // ***************** s-parameter gain circles *****************
2962  _ARMV0 (S);
2963  _ARD1 (G);
2964  _ARV2 (arc);
2965  _DEFV ();
2966  qucs::vector g, D, c, s, k, C, R, d;
2967  D = det (*S);
2968  c = S->get (0, 0) - conj (S->get (1, 1)) * D;
2969  k = rollet (*S);
2970  s = S->get (0, 1) * S->get (1, 0);
2971  g = G / norm (S->get (1, 0));
2972  d = 1 + g * (norm (S->get (0, 0)) - norm (D));
2973  C = g * conj (c) / d;
2974  R = sqrt (1 - 2 * k * g * abs (s) + g * g * norm (s)) / abs (d);
2975 
2976  qucs::vector * circle = new qucs::vector (S->getSize () * arc->getSize ());
2977  int i, a, j; nr_complex_t v;
2978  for (i = 0, j = 0; i < C.getSize (); i++) {
2979  for (a = 0; a < arc->getSize (); a++, j++) {
2980  v = C.get (i) + R.get (i) * exp (nr_complex_t (0, 1) * rad (arc->get (a)));
2981  circle->set (v, j);
2982  }
2983  }
2984 
2985  node * gen = SOLVEE(2)->addGeneratedEquation (arc, "Arcs");
2986  res->addPrepDependencies (A(gen)->result);
2987  res->v = circle;
2988  return res;
2989 }
2990 
2992  CIRCLE_HELPER_D (2);
2993  return ga_circle_d_v (args);
2994 }
2995 
2997  CIRCLE_HELPER_A ();
2998  return ga_circle_d_v (args);
2999 }
3000 
3002  _ARMV0 (S);
3003  _ARV1 (G);
3004  _ARV2 (arc);
3005  _DEFV ();
3006  qucs::vector * circle =
3007  new qucs::vector (S->getSize () * arc->getSize () * G->getSize ());
3008  int i, a, j, f; nr_complex_t v; qucs::vector g, D, c, s, k, R, C, d;
3009  D = det (*S);
3010  c = S->get (0, 0) - conj (S->get (1, 1)) * D;
3011  k = rollet (*S);
3012  s = S->get (0, 1) * S->get (1, 0);
3013  for (f = 0; f < G->getSize (); f++) {
3014  g = G->get (f) / norm (S->get (1, 0));
3015  d = 1 + g * (norm (S->get (0, 0)) - norm (D));
3016  C = g * conj (c) / d;
3017  R = sqrt (1 - 2 * k * g * abs (s) + g * g * norm (s)) / abs (d);
3018  for (i = 0; i < C.getSize (); i++) {
3019  for (a = 0; a < arc->getSize (); a++) {
3020  v = C.get (i) + R.get (i) * exp (nr_complex_t (0, 1) * rad (arc->get (a)));
3021  j = i * G->getSize () * arc->getSize () + f * arc->getSize () + a;
3022  circle->set (v, j);
3023  }
3024  }
3025  }
3026 
3027  node * gen;
3028  gen = SOLVEE(1)->addGeneratedEquation (G, "Ga");
3029  res->addPrepDependencies (A(gen)->result);
3030  gen = SOLVEE(2)->addGeneratedEquation (arc, "Arcs");
3031  res->addPrepDependencies (A(gen)->result);
3032  res->v = circle;
3033  return res;
3034 }
3035 
3037  CIRCLE_HELPER_D (2);
3038  return ga_circle_v_v (args);
3039 }
3040 
3042  CIRCLE_HELPER_A ();
3043  return ga_circle_v_v (args);
3044 }
3045 
3047  _ARMV0 (S);
3048  _ARD1 (G);
3049  _ARV2 (arc);
3050  _DEFV ();
3051  qucs::vector g, D, c, s, k, C, R, d;
3052  D = det (*S);
3053  c = S->get (1, 1) - conj (S->get (0, 0)) * D;
3054  k = rollet (*S);
3055  s = S->get (0, 1) * S->get (1, 0);
3056  g = G / norm (S->get (1, 0));
3057  d = 1 + g * (norm (S->get (1, 1)) - norm (D));
3058  C = g * conj (c) / d;
3059  R = sqrt (1 - 2 * k * g * abs (s) + g * g * norm (s)) / abs (d);
3060 
3061  qucs::vector * circle = new qucs::vector (S->getSize () * arc->getSize ());
3062  int i, a, j; nr_complex_t v;
3063  for (i = 0, j = 0; i < C.getSize (); i++) {
3064  for (a = 0; a < arc->getSize (); a++, j++) {
3065  v = C.get (i) + R.get (i) * exp (nr_complex_t (0, 1) * rad (arc->get (a)));
3066  circle->set (v, j);
3067  }
3068  }
3069 
3070  node * gen = SOLVEE(2)->addGeneratedEquation (arc, "Arcs");
3071  res->addPrepDependencies (A(gen)->result);
3072  res->v = circle;
3073  return res;
3074 }
3075 
3077  CIRCLE_HELPER_D (2);
3078  return gp_circle_d_v (args);
3079 }
3080 
3082  CIRCLE_HELPER_A ();
3083  return gp_circle_d_v (args);
3084 }
3085 
3087  _ARMV0 (S);
3088  _ARV1 (G);
3089  _ARV2 (arc);
3090  _DEFV ();
3091  qucs::vector * circle =
3092  new qucs::vector (S->getSize () * arc->getSize () * G->getSize ());
3093  int i, a, j, f; nr_complex_t v; qucs::vector g, D, c, s, k, R, C, d;
3094  D = det (*S);
3095  c = S->get (1, 1) - conj (S->get (0, 0)) * D;
3096  k = rollet (*S);
3097  s = S->get (0, 1) * S->get (1, 0);
3098  for (f = 0; f < G->getSize (); f++) {
3099  g = G->get (f) / norm (S->get (1, 0));
3100  d = 1 + g * (norm (S->get (1, 1)) - norm (D));
3101  C = g * conj (c) / d;
3102  R = sqrt (1 - 2 * k * g * abs (s) + g * g * norm (s)) / abs (d);
3103  for (i = 0; i < C.getSize (); i++) {
3104  for (a = 0; a < arc->getSize (); a++) {
3105  v = C.get (i) + R.get (i) * exp (nr_complex_t (0, 1) * rad (arc->get (a)));
3106  j = i * G->getSize () * arc->getSize () + f * arc->getSize () + a;
3107  circle->set (v, j);
3108  }
3109  }
3110  }
3111 
3112  node * gen;
3113  gen = SOLVEE(1)->addGeneratedEquation (G, "Gp");
3114  res->addPrepDependencies (A(gen)->result);
3115  gen = SOLVEE(2)->addGeneratedEquation (arc, "Arcs");
3116  res->addPrepDependencies (A(gen)->result);
3117  res->v = circle;
3118  return res;
3119 }
3120 
3122  CIRCLE_HELPER_D (2);
3123  return gp_circle_v_v (args);
3124 }
3125 
3127  CIRCLE_HELPER_A ();
3128  return gp_circle_v_v (args);
3129 }
3130 
3131 // ***************** versus vectors *****************
3133  _ARV0 (v);
3134  _DEFV ();
3135  int i = 1;
3136  for (node * arg = args->getNext (); arg != NULL; arg = arg->getNext ()) {
3137  node * gen = arg->solvee->addGeneratedEquation (V (_ARES (i)), "Versus");
3138  res->addPrepDependencies (A(gen)->result);
3139  i++;
3140  }
3141  res->dropdeps = 1;
3142  _RETV (*v);
3143 }
3144 
3146  _ARMV0 (mv);
3147  _DEFMV ();
3148  int i = 1;
3149  for (node * arg = args->getNext (); arg != NULL; arg = arg->getNext ()) {
3150  node * gen = arg->solvee->addGeneratedEquation (V (_ARES (i)), "Versus");
3151  res->addPrepDependencies (A(gen)->result);
3152  i++;
3153  }
3154  res->dropdeps = 1;
3155  _RETMV (*mv);
3156 }
3157 
3158 // ***************** find x-value for given y-value *****************
3160  _ARV0 (v);
3161  _ARD1 (d);
3162  _DEFC ();
3163  strlist * deps = _ARG(0)->collectDataDependencies ();
3164  if (!deps || deps->length () != 1) {
3165  THROW_MATH_EXCEPTION ("not an appropriate dependent data vector");
3166  _RETC (0.0);
3167  }
3168  qucs::vector * indep = SOLVEE(0)->getDataVector (deps->get (0));
3169  int idx, i;
3170  nr_double_t t, diff = NR_MAX;
3171  for (idx = i = 0; i < v->getSize (); i++) {
3172  t = abs (v->get (i) - d);
3173  if (t < diff) {
3174  idx = i;
3175  diff = t;
3176  }
3177  }
3178  _RETC (indep->get (idx));
3179 }
3180 
3182  _ARV0 (v);
3183  _ARC1 (c);
3184  _DEFC ();
3185  strlist * deps = _ARG(0)->collectDataDependencies ();
3186  if (!deps || deps->length () != 1) {
3187  THROW_MATH_EXCEPTION ("not an appropriate dependent data vector");
3188  _RETC (0.0);
3189  }
3190  qucs::vector * indep = SOLVEE(0)->getDataVector (deps->get (0));
3191  int idx, i;
3192  nr_double_t t, diff = NR_MAX;
3193  for (idx = i = 0; i < v->getSize (); i++) {
3194  t = abs (v->get (i) - *c);
3195  if (t < diff) {
3196  idx = i;
3197  diff = t;
3198  }
3199  }
3200  _RETC (indep->get (idx));
3201 }
3202 
3203 // ***************** find y-value for given x-value *****************
3205  _ARV0 (v);
3206  _ARD1 (d);
3207  _DEFC ();
3208  strlist * deps = _ARG(0)->collectDataDependencies ();
3209  if (!deps || deps->length () != 1) {
3210  THROW_MATH_EXCEPTION ("not an appropriate dependent data vector");
3211  _RETC (0.0);
3212  }
3213  qucs::vector * indep = SOLVEE(0)->getDataVector (deps->get (0));
3214  int idx, i;
3215  nr_double_t t, diff = NR_MAX;
3216  for (idx = i = 0; i < indep->getSize (); i++) {
3217  t = abs (indep->get (i) - d);
3218  if (t < diff) {
3219  idx = i;
3220  diff = t;
3221  }
3222  }
3223  _RETC (v->get (idx));
3224 }
3225 
3227  _ARV0 (v);
3228  _ARC1 (c);
3229  _DEFC ();
3230  strlist * deps = _ARG(0)->collectDataDependencies ();
3231  if (!deps || deps->length () != 1) {
3232  THROW_MATH_EXCEPTION ("not an appropriate dependent data vector");
3233  _RETC (0.0);
3234  }
3235  qucs::vector * indep = SOLVEE(0)->getDataVector (deps->get (0));
3236  int idx, i;
3237  nr_double_t t, diff = NR_MAX;
3238  for (idx = i = 0; i < indep->getSize (); i++) {
3239  t = abs (indep->get (i) - *c);
3240  if (t < diff) {
3241  idx = i;
3242  diff = t;
3243  }
3244  }
3245  _RETC (v->get (idx));
3246 }
3247 
3248 // ***************** min, max, avg using range specification *****************
3250  _ARV0 (v);
3251  _ARR1 (r);
3252  _DEFD ();
3253  strlist * deps = _ARG(0)->collectDataDependencies ();
3254  if (!deps || deps->length () != 1) {
3255  THROW_MATH_EXCEPTION ("not an appropriate dependent data vector");
3256  _RETD (0.0);
3257  }
3258  qucs::vector * indep = SOLVEE(0)->getDataVector (deps->get (0));
3259  nr_complex_t c;
3260  nr_double_t d, M = -NR_MAX;
3261  for (int i = 0; i < indep->getSize (); i++) {
3262  if (r->inside (real (indep->get (i)))) {
3263  c = v->get (i);
3264  d = fabs (arg (c)) < M_PI_2 ? abs (c) : -abs (c);
3265  if (d > M) M = d;
3266  }
3267  }
3268  _RETD (M);
3269 }
3270 
3272  _ARV0 (v);
3273  _ARR1 (r);
3274  _DEFD ();
3275  strlist * deps = _ARG(0)->collectDataDependencies ();
3276  if (!deps || deps->length () != 1) {
3277  THROW_MATH_EXCEPTION ("not an appropriate dependent data vector");
3278  _RETD (0.0);
3279  }
3280  qucs::vector * indep = SOLVEE(0)->getDataVector (deps->get (0));
3281  nr_complex_t c;
3282  nr_double_t d, M = +NR_MAX;
3283  for (int i = 0; i < indep->getSize (); i++) {
3284  if (r->inside (real (indep->get (i)))) {
3285  c = v->get (i);
3286  d = fabs (arg (c)) < M_PI_2 ? abs (c) : -abs (c);
3287  if (d < M) M = d;
3288  }
3289  }
3290  _RETD (M);
3291 }
3292 
3294  _ARV0 (v);
3295  _ARR1 (r);
3296  _DEFC ();
3297  strlist * deps = _ARG(0)->collectDataDependencies ();
3298  if (!deps || deps->length () != 1) {
3299  THROW_MATH_EXCEPTION ("not an appropriate dependent data vector");
3300  _RETC (0.0);
3301  }
3302  qucs::vector * indep = SOLVEE(0)->getDataVector (deps->get (0));
3303  nr_complex_t c = 0.0;
3304  int i, k;
3305  for (k = i = 0; i < indep->getSize (); i++) {
3306  if (r->inside (real (indep->get (i)))) {
3307  c += v->get (i);
3308  k++;
3309  }
3310  }
3311  _RETC (c / (nr_double_t) k);
3312 }
3313 
3314 // *************** range functionality *****************
3316  _ARD0 (d1);
3317  _ARD1 (d2);
3318  _DEFR ();
3319  _RETR (new range ('[', d1, d2, ']'));
3320 }
3321 
3323  _ARD1 (d2);
3324  _DEFR ();
3325  _RETR (new range ('.', d2 - 1, d2, ']'));
3326 }
3327 
3329  _ARD0 (d1);
3330  _DEFR ();
3331  _RETR (new range ('[', d1, d1 + 1, '.'));
3332 }
3333 
3335  _DEFR ();
3336  _RETR (new range ('.', 0, 0, '.'));
3337 }
3338 
3339 MAKE_FUNC_DEFINITION_0_STD (ceil); // ceil double->integer conversion
3340 MAKE_FUNC_DEFINITION_0_STD (floor); // floor double->integer conversion
3341 MAKE_FUNC_DEFINITION_0_QUCS (fix); // fix double->integer conversion
3342 MAKE_FUNC_DEFINITION_0_QUCS (step); // step function
3343 MAKE_FUNC_DEFINITION_0_QUCS (round); // round function
3344 //#ifndef HAVE_ERF
3345 MAKE_FUNC_DEFINITION_0_SPECIAL (erf); // error function
3346 //#else
3347 //MAKE_FUNC_DEFINITION_0_STD (erf); // error function
3348 //#endif
3349 //#ifndef HAVE_ERFC
3350 MAKE_FUNC_DEFINITION_0_SPECIAL (erfc); // complementary error function
3351 //#else
3352 //MAKE_FUNC_DEFINITION_0_STD (erfc); // complementary error function
3353 //#endif
3354 MAKE_FUNC_DEFINITION_0_SPECIAL (erfinv); // inverse of error function
3355 MAKE_FUNC_DEFINITION_0_SPECIAL (erfcinv); // inverse of complementary error function
3356 MAKE_FUNC_DEFINITION_0_SPECIAL (i0); // modified bessel zero order
3357 
3358 // ******************* cumulative sum *********************
3360  _ARD0 (d1);
3361  _DEFD ();
3362  _RETD (d1);
3363 }
3364 
3366  _ARC0 (c1);
3367  _DEFC ();
3368  _RETC (*c1);
3369 }
3370 
3372  _ARV0 (v1);
3373  _DEFV ();
3374  _RETV (cumsum (*v1));
3375 }
3376 
3377 // **************** cumulative average ******************
3379  _ARD0 (d1);
3380  _DEFD ();
3381  _RETD (d1);
3382 }
3383 
3385  _ARC0 (c1);
3386  _DEFC ();
3387  _RETC (*c1);
3388 }
3389 
3391  _ARV0 (v1);
3392  _DEFV ();
3393  _RETV (cumavg (*v1));
3394 }
3395 
3396 // ******************* cumulative product *********************
3398  _ARD0 (d1);
3399  _DEFD ();
3400  _RETD (d1);
3401 }
3402 
3404  _ARC0 (c1);
3405  _DEFC ();
3406  _RETC (*c1);
3407 }
3408 
3410  _ARV0 (v1);
3411  _DEFV ();
3412  _RETV (cumprod (*v1));
3413 }
3414 
3415 // ******************* rms *********************
3417  _ARD0 (d1);
3418  _DEFD ();
3419  _RETD (fabs (d1));
3420 }
3421 
3423  _ARC0 (c1);
3424  _DEFD ();
3425  _RETD (abs (*c1));
3426 }
3427 
3429  _ARV0 (v1);
3430  _DEFD ();
3431  _RETD (v1->rms ());
3432 }
3433 
3434 // ******************* variance *********************
3436  _DEFD ();
3437  _RETD (0);
3438 }
3439 
3441  _DEFD ();
3442  _RETD (0);
3443 }
3444 
3446  _ARV0 (v1);
3447  _DEFD ();
3448  _RETD (v1->variance ());
3449 }
3450 
3451 // ******************* stddev *********************
3453  _DEFD ();
3454  _RETD (0);
3455 }
3456 
3458  _DEFD ();
3459  _RETD (0);
3460 }
3461 
3463  _ARV0 (v1);
3464  _DEFD ();
3465  _RETD (v1->stddev ());
3466 }
3467 
3468 // ********* jn (bessel function of 1st kind, nth order) ***********
3470  _ARI0 (n);
3471  _ARD1 (x);
3472  _DEFD ();
3473  _RETD (::jn (n, x));
3474 }
3475 
3477  _ARI0 (n);
3478  _ARC1 (x);
3479  _DEFC ();
3480  _RETC (jn (n, *x));
3481 }
3482 
3484  _ARI0 (n);
3485  _ARV1 (x);
3486  _DEFV ();
3487  _RETV (jn (n, *x));
3488 }
3489 
3490 // ********* yn (bessel function of 2nd kind, nth order) ***********
3492  _ARI0 (n);
3493  _ARD1 (x);
3494  _DEFD ();
3495  _RETD (::yn (n, x));
3496 }
3497 
3499  _ARI0 (n);
3500  _ARC1 (x);
3501  _DEFC ();
3502  _RETC (yn (n, *x));
3503 }
3504 
3506  _ARI0 (n);
3507  _ARV1 (x);
3508  _DEFV ();
3509  _RETV (yn (n, *x));
3510 }
3511 
3512 // ***************** sqr *****************
3514  _ARM0 (m1);
3515  _DEFM ();
3516  _RETM (qucs::sqr (*m1));
3517 }
3518 
3520  _ARMV0 (m1);
3521  _DEFMV ();
3522  _RETMV (qucs::sqr (*m1));
3523 }
3524 
3525 // ******************* polar *********************
3527  _ARD0 (a);
3528  _ARD1 (p);
3529  _DEFC ();
3530  _RETC (std::polar (a, rad (p)));
3531 }
3532 
3534  _ARC0 (a);
3535  _ARD1 (p);
3536  _DEFC ();
3537  _RETC (qucs::polar (*a, nr_complex_t (rad (p), 0)));
3538 }
3539 
3541  _ARD0 (a);
3542  _ARC1 (p);
3543  _DEFC ();
3544  _RETC (qucs::polar (nr_complex_t (a, 0), rad (*p)));
3545 }
3546 
3548  _ARC0 (a);
3549  _ARC1 (p);
3550  _DEFC ();
3551  _RETC (qucs::polar (*a, rad (*p)));
3552 }
3553 
3555  _ARD0 (a);
3556  _ARV1 (v);
3557  _DEFV ();
3558  _RETV (polar (nr_complex_t (a, 0), rad (*v)));
3559 }
3560 
3562  _ARC0 (a);
3563  _ARV1 (v);
3564  _DEFV ();
3565  _RETV (polar (*a, rad (*v)));
3566 }
3567 
3569  _ARV0 (v);
3570  _ARD1 (p);
3571  _DEFV ();
3572  _RETV (polar (*v, nr_complex_t (rad (p), 0)));
3573 }
3574 
3576  _ARV0 (v);
3577  _ARC1 (p);
3578  _DEFV ();
3579  _RETV (polar (*v, rad (*p)));
3580 }
3581 
3583  _ARV0 (a);
3584  _ARV1 (p);
3585  _DEFV ();
3586  _RETV (polar (*a, rad (*p)));
3587 }
3588 
3589 // ******************* arctan2 *********************
3591  _ARD0 (y);
3592  _ARD1 (x);
3593  _DEFD ();
3594  if ((x == 0) && (y == 0)) {
3595  THROW_MATH_EXCEPTION ("arctan2: not defined for (0,0)");
3596  _RETD (-M_PI / 2);
3597  }
3598  _RETD (std::atan2 (y, x));
3599 }
3600 
3602  _ARD0 (y);
3603  _ARV1 (x);
3604  _DEFV ();
3605  _RETV (atan2 (y, *x));
3606 }
3607 
3609  _ARV0 (y);
3610  _ARD1 (x);
3611  _DEFV ();
3612  _RETV (atan2 (*y, x));
3613 }
3614 
3616  _ARV0 (y);
3617  _ARV1 (x);
3618  _DEFV ();
3619  _RETV (atan2 (*y, *x));
3620 }
3621 
3622 // ******************* dbm2w *********************
3624  _ARD0 (d1);
3625  _DEFD ();
3626  _RETD (0.001 * std::pow (10.0, d1 / 10.0));
3627 }
3628 
3630  _ARC0 (c1);
3631  _DEFC ();
3632  _RETC (0.001 * pow (10.0, *c1 / 10.0));
3633 }
3634 
3636  _ARV0 (v1);
3637  _DEFV ();
3638  _RETV (dbm2w (*v1));
3639 }
3640 
3641 // ******************* w2dbm *********************
3643  _ARD0 (d1);
3644  _DEFD ();
3645  _RETD (10.0 * std::log10 (d1 / 0.001));
3646 }
3647 
3649  _ARC0 (c1);
3650  _DEFC ();
3651  _RETC (10.0 * log10 (*c1 / 0.001));
3652 }
3653 
3655  _ARV0 (v1);
3656  _DEFV ();
3657  _RETV (w2dbm (*v1));
3658 }
3659 
3660 // ********** integrate *****************
3662  _ARD0 (data);
3663  _ARD1 (incr);
3664  _DEFD ();
3665  _RETD (data * incr);
3666 }
3667 
3669  _ARC0 (data);
3670  _ARC1 (incr);
3671  _DEFC ();
3672  _RETC (*data * *incr);
3673 }
3674 
3676  _ARV0 (data);
3677  _ARD1 (incr);
3678  _DEFD ();
3679  _RETD (integrate (*data, incr));
3680 }
3681 
3683  _ARV0 (data);
3684  _ARC1 (incr);
3685  _DEFC ();
3686  _RETC (integrate (*data, *incr));
3687 }
3688 
3689 // ******************* dbm *********************
3691  _ARD0 (d1);
3692  _DEFD ();
3693  _RETD (10.0 * std::log10 (norm (d1) / circuit::z0 / 0.001));
3694 }
3695 
3697  _ARD0 (d1);
3698  _ARD1 (z);
3699  _DEFD ();
3700  _RETD (10.0 * std::log10 (norm (d1) / z / 0.001));
3701 }
3702 
3704  _ARC0 (c1);
3705  _DEFC ();
3706  _RETC (10.0 * log10 (norm (*c1) / circuit::z0 / 0.001));
3707 }
3708 
3710  _ARC0 (c1);
3711  _ARD1 (z);
3712  _DEFC ();
3713  _RETC (10.0 * log10 (norm (*c1) / z / 0.001));
3714 }
3715 
3717  _ARV0 (v1);
3718  _DEFV ();
3719  _RETV (dbm (*v1));
3720 }
3721 
3723  _ARV0 (v1);
3724  _ARD1 (z);
3725  _DEFV ();
3726  _RETV (dbm (*v1, z));
3727 }
3728 
3730  _ARD0 (d1);
3731  _ARC1 (z);
3732  _DEFC ();
3733  _RETC (10.0 * log10 (norm (d1) / conj (*z) / 0.001));
3734 }
3735 
3737  _ARC0 (c1);
3738  _ARC1 (z);
3739  _DEFC ();
3740  _RETC (10.0 * log10 (norm (*c1) / conj (*z) / 0.001));
3741 }
3742 
3744  _ARV0 (v1);
3745  _ARC1 (z);
3746  _DEFV ();
3747  _RETV (dbm (*v1, *z));
3748 }
3749 
3750 // ************** running average ****************
3752  _ARD0 (x);
3753  _ARI1 (n);
3754  _DEFV ();
3755  if (n < 1) {
3756  THROW_MATH_EXCEPTION ("runavg: number n to be averaged over must be "
3757  "larger or equal 1");
3758  __RETV ();
3759  }
3760  _RETV (runavg (nr_complex_t (x, 0), n));
3761 }
3762 
3764  _ARC0 (x);
3765  _ARI1 (n);
3766  _DEFV ();
3767  if (n < 1) {
3768  THROW_MATH_EXCEPTION ("runavg: number n to be averaged over must be "
3769  "larger or equal 1");
3770  __RETV ();
3771  }
3772  _RETV (runavg (*x, n));
3773 }
3774 
3776  _ARV0 (x);
3777  _ARI1 (n);
3778  _DEFV ();
3779  if (n < 1 || n > x->getSize ()) {
3780  THROW_MATH_EXCEPTION ("runavg: number n to be averaged over must be "
3781  "larger or equal 1 and less or equal than the "
3782  "number of vector elements");
3783  __RETV ();
3784  }
3785  _RETV (runavg (*x, n));
3786 }
3787 
3788 // ********************* thermal voltage **********************
3790  _ARD0 (d1);
3791  _DEFD ();
3792  _RETD (d1 * kBoverQ);
3793 }
3794 
3796  _ARC0 (c1);
3797  _DEFC ();
3798  _RETC (*c1 * kBoverQ);
3799 }
3800 
3802  _ARV0 (v1);
3803  _DEFV ();
3804  qucs::vector * v = new qucs::vector ();
3805  for (int i = 0; i < v1->getSize (); i++) v->add (v1->get (i) * kBoverQ);
3806  res->v = v;
3807  return res;
3808 }
3809 
3810 // ************** Kaiser-Bessel derived window ****************
3812  _ARD0 (alpha);
3813  _ARI1 (size);
3814  _DEFV ();
3815  int i;
3816  nr_double_t sval = 0.0;
3817  if (size <= 0) {
3818  THROW_MATH_EXCEPTION ("kbd: vector length must be greater than zero");
3819  __RETV ();
3820  }
3821  qucs::vector v (size);
3822  for (i = 0; i < size / 2; i++) {
3823  sval += fspecial::i0 (M_PI * alpha * std::sqrt (1.0 - sqr (4.0 * i / size - 1.0)));
3824  v (i) = sval;
3825  }
3826  // need to add one more value to the normalization factor at size/2
3827  sval += fspecial::i0 (M_PI * alpha * std::sqrt (1.0 - sqr (4.0 * (size / 2) / size - 1.0)));
3828  // normalize the window and fill in the righthand side of the window
3829  for (i = 0; i < size / 2; i++) {
3830  v (i) = std::sqrt (v (i) / sval);
3831  v (size - 1 - i) = v (i);
3832  }
3833  _RETV (v);
3834 }
3835 
3837  constant * arg = new constant (TAG_DOUBLE);
3838  arg->d = 64;
3839  arg->solvee = args->getResult(0)->solvee;
3840  arg->evaluate ();
3841  args->append (arg);
3842  return kbd_d_d (args);
3843 }
3844 
3845 // ***************** if-then-else operation ****************
3847  _ARB0 (cond);
3848  _ARD1 (d1);
3849  _ARD2 (d2);
3850  _DEFD ();
3851  _RETD (cond ? d1 : d2);
3852 }
3853 
3855  _ARB0 (cond);
3856  _ARB1 (b1);
3857  _ARB2 (b2);
3858  _DEFB ();
3859  _RETB (cond ? b1 : b2);
3860 }
3861 
3863  _ARB0 (cond);
3864  _ARD1 (d1);
3865  _ARB2 (b2);
3866  _DEFD ();
3867  _RETD (cond ? d1 : (b2 ? 1.0 : 0.0));
3868 }
3869 
3871  _ARB0 (cond);
3872  _ARB1 (b1);
3873  _ARD2 (d2);
3874  _DEFD ();
3875  _RETD (cond ? (b1 ? 1.0 : 0.0) : d2);
3876 }
3877 
3879  _ARB0 (cond);
3880  int t1 = _ARG(1)->getType ();
3881  int t2 = _ARG(2)->getType ();
3882  nr_complex_t c1, c2;
3883  if (t1 == TAG_DOUBLE)
3884  c1 = D(_ARES(1));
3885  else if (t1 == TAG_COMPLEX)
3886  c1 = *C(_ARES(1));
3887  else
3888  c1 = B(_ARES(1)) ? 1.0 : 0.0;
3889  if (t2 == TAG_DOUBLE)
3890  c2 = D(_ARES(2));
3891  else if (t2 == TAG_COMPLEX)
3892  c2 = *C(_ARES(2));
3893  else
3894  c2 = B(_ARES(2)) ? 1.0 : 0.0;
3895  _DEFC ();
3896  _RETC (cond ? c1 : c2);
3897 }
3898 
3900  _ARB0 (cond);
3901  int t1 = _ARG(1)->getType ();
3902  int t2 = _ARG(2)->getType ();
3903  matrix m1, m2;
3904  switch (t1) {
3905  case TAG_DOUBLE:
3906  m1 = matrix (1); m1 (1,1) = D(_ARES(1)); break;
3907  case TAG_COMPLEX:
3908  m1 = matrix (1); m1 (1,1) = *C(_ARES(1)); break;
3909  case TAG_BOOLEAN:
3910  m1 = matrix (1); m1 (1,1) = B(_ARES(1)) ? 1.0 : 0.0; break;
3911  case TAG_MATRIX:
3912  m1 = *M(_ARES(1)); break;
3913  }
3914  switch (t2) {
3915  case TAG_DOUBLE:
3916  m2 = matrix (1); m2 (0,0) = D(_ARES(2)); break;
3917  case TAG_COMPLEX:
3918  m2 = matrix (1); m2 (0,0) = *C(_ARES(2)); break;
3919  case TAG_BOOLEAN:
3920  m2 = matrix (1); m2 (0,0) = B(_ARES(2)) ? 1.0 : 0.0; break;
3921  case TAG_MATRIX:
3922  m2 = *M(_ARES(2)); break;
3923  }
3924  _DEFM ();
3925  _RETM (cond ? m1 : m2);
3926 }
3927 
3929  _ARB0 (cond);
3930  int t1 = _ARG(1)->getType ();
3931  int t2 = _ARG(2)->getType ();
3932  qucs::vector v1, v2;
3933  switch (t1) {
3934  case TAG_DOUBLE:
3935  v1 = qucs::vector (1); v1 (0) = D(_ARES(1)); break;
3936  case TAG_COMPLEX:
3937  v1 = qucs::vector (1); v1 (0) = *C(_ARES(1)); break;
3938  case TAG_BOOLEAN:
3939  v1 = qucs::vector (1); v1 (0) = B(_ARES(1)) ? 1.0 : 0.0; break;
3940  case TAG_VECTOR:
3941  v1 = *V(_ARES(1)); break;
3942  }
3943  switch (t2) {
3944  case TAG_DOUBLE:
3945  v2 = qucs::vector (1); v2 (0) = D(_ARES(2)); break;
3946  case TAG_COMPLEX:
3947  v2 = qucs::vector (1); v2 (0) = *C(_ARES(2)); break;
3948  case TAG_BOOLEAN:
3949  v2 = qucs::vector (1); v2 (0) = B(_ARES(2)) ? 1.0 : 0.0; break;
3950  case TAG_VECTOR:
3951  v2 = *V(_ARES(2)); break;
3952  }
3953  _DEFV ();
3954  _RETV (cond ? v1 : v2);
3955 }
3956 
3958  _ARV0 (cond);
3959  int t1 = _ARG(1)->getType ();
3960  int t2 = _ARG(2)->getType ();
3961  qucs::vector v1, v2;
3962  switch (t1) {
3963  case TAG_DOUBLE:
3964  v1 = qucs::vector (1); v1 (0) = D(_ARES(1)); break;
3965  case TAG_COMPLEX:
3966  v1 = qucs::vector (1); v1 (0) = *C(_ARES(1)); break;
3967  case TAG_BOOLEAN:
3968  v1 = qucs::vector (1); v1 (0) = B(_ARES(1)) ? 1.0 : 0.0; break;
3969  case TAG_VECTOR:
3970  v1 = *V(_ARES(1)); break;
3971  }
3972  switch (t2) {
3973  case TAG_DOUBLE:
3974  v2 = qucs::vector (1); v2 (0) = D(_ARES(2)); break;
3975  case TAG_COMPLEX:
3976  v2 = qucs::vector (1); v2 (0) = *C(_ARES(2)); break;
3977  case TAG_BOOLEAN:
3978  v2 = qucs::vector (1); v2 (0) = B(_ARES(2)) ? 1.0 : 0.0; break;
3979  case TAG_VECTOR:
3980  v2 = *V(_ARES(2)); break;
3981  }
3982  _DEFV ();
3983  int i, a, b;
3984  qucs::vector * v = new qucs::vector ();
3985  for (a = b = i = 0; i < cond->getSize (); i++) {
3986  v->add (cond->get (i) != 0.0 ? v1 (a) : v2 (b));
3987  a++;
3988  b++;
3989  if (a >= v1.getSize ()) a = 0;
3990  if (b >= v2.getSize ()) b = 0;
3991  }
3992  res->v = v;
3993  return res;
3994 }
3995 
3996 // ************************** less *************************
3998  _ARD0 (d0);
3999  _ARD1 (d1);
4000  _DEFB ();
4001  _RETB (d0 < d1);
4002 }
4003 
4005  _ARD0 (d0);
4006  _ARC1 (c1);
4007  _DEFB ();
4008  _RETB (d0 < *c1);
4009 }
4010 
4012  _ARD0 (d0);
4013  _ARV1 (v1);
4014  _DEFV ();
4015  qucs::vector * v = new qucs::vector ();
4016  for (int i = 0; i < v1->getSize (); i++) {
4017  v->add (d0 < v1->get (i) ? 1.0 : 0.0);
4018  }
4019  res->v = v;
4020  return res;
4021 }
4022 
4024  _ARC0 (c0);
4025  _ARD1 (d1);
4026  _DEFB ();
4027  _RETB (*c0 < d1);
4028 }
4029 
4031  _ARC0 (c0);
4032  _ARC1 (c1);
4033  _DEFB ();
4034  _RETB (*c0 < *c1);
4035 }
4036 
4038  _ARC0 (c0);
4039  _ARV1 (v1);
4040  _DEFV ();
4041  qucs::vector * v = new qucs::vector ();
4042  for (int i = 0; i < v1->getSize (); i++) {
4043  v->add (*c0 < v1->get (i) ? 1.0 : 0.0);
4044  }
4045  res->v = v;
4046  return res;
4047 }
4048 
4050  _ARV0 (v0);
4051  _ARD1 (d1);
4052  _DEFV ();
4053  qucs::vector * v = new qucs::vector ();
4054  for (int i = 0; i < v0->getSize (); i++) {
4055  v->add (real (v0->get (i)) < d1 ? 1.0 : 0.0);
4056  }
4057  res->v = v;
4058  return res;
4059 }
4060 
4062  _ARV0 (v0);
4063  _ARC1 (c1);
4064  _DEFV ();
4065  qucs::vector * v = new qucs::vector ();
4066  for (int i = 0; i < v0->getSize (); i++) {
4067  v->add (v0->get (i) < *c1 ? 1.0 : 0.0);
4068  }
4069  res->v = v;
4070  return res;
4071 }
4072 
4074  _ARV0 (v0);
4075  _ARV1 (v1);
4076  _DEFV ();
4077  qucs::vector * v = new qucs::vector ();
4078  for (int i = 0; i < v0->getSize (); i++) {
4079  v->add (v0->get (i) < v1->get (i) ? 1.0 : 0.0);
4080  }
4081  res->v = v;
4082  return res;
4083 }
4084 
4085 // ************************* greater ***********************
4087  _ARD0 (d0);
4088  _ARD1 (d1);
4089  _DEFB ();
4090  _RETB (d0 > d1);
4091 }
4092 
4094  _ARD0 (d0);
4095  _ARC1 (c1);
4096  _DEFB ();
4097  _RETB (d0 > *c1);
4098 }
4099 
4101  _ARD0 (d0);
4102  _ARV1 (v1);
4103  _DEFV ();
4104  qucs::vector * v = new qucs::vector ();
4105  for (int i = 0; i < v1->getSize (); i++) {
4106  v->add (d0 > real (v1->get (i)) ? 1.0 : 0.0);
4107  }
4108  res->v = v;
4109  return res;
4110 }
4111 
4113  _ARC0 (c0);
4114  _ARD1 (d1);
4115  _DEFB ();
4116  _RETB (*c0 > d1);
4117 }
4118 
4120  _ARC0 (c0);
4121  _ARC1 (c1);
4122  _DEFB ();
4123  _RETB (*c0 > *c1);
4124 }
4125 
4127  _ARC0 (c0);
4128  _ARV1 (v1);
4129  _DEFV ();
4130  qucs::vector * v = new qucs::vector ();
4131  for (int i = 0; i < v1->getSize (); i++) {
4132  v->add (*c0 > v1->get (i) ? 1.0 : 0.0);
4133  }
4134  res->v = v;
4135  return res;
4136 }
4137 
4139  _ARV0 (v0);
4140  _ARD1 (d1);
4141  _DEFV ();
4142  qucs::vector * v = new qucs::vector ();
4143  for (int i = 0; i < v0->getSize (); i++) {
4144  v->add (real (v0->get (i)) > d1 ? 1.0 : 0.0);
4145  }
4146  res->v = v;
4147  return res;
4148 }
4149 
4151  _ARV0 (v0);
4152  _ARC1 (c1);
4153  _DEFV ();
4154  qucs::vector * v = new qucs::vector ();
4155  for (int i = 0; i < v0->getSize (); i++) {
4156  v->add (v0->get (i) > *c1 ? 1.0 : 0.0);
4157  }
4158  res->v = v;
4159  return res;
4160 }
4161 
4163  _ARV0 (v0);
4164  _ARV1 (v1);
4165  _DEFV ();
4166  qucs::vector * v = new qucs::vector ();
4167  for (int i = 0; i < v0->getSize (); i++) {
4168  v->add (v0->get (i) > v1->get (i) ? 1.0 : 0.0);
4169  }
4170  res->v = v;
4171  return res;
4172 }
4173 
4174 // ********************** less or equal ********************
4176  _ARD0 (d0);
4177  _ARD1 (d1);
4178  _DEFB ();
4179  _RETB (d0 <= d1);
4180 }
4181 
4183  _ARD0 (d0);
4184  _ARC1 (c1);
4185  _DEFB ();
4186  _RETB (d0 <= *c1);
4187 }
4188 
4190  _ARD0 (d0);
4191  _ARV1 (v1);
4192  _DEFV ();
4193  qucs::vector * v = new qucs::vector ();
4194  for (int i = 0; i < v1->getSize (); i++) {
4195  v->add (d0 <= real (v1->get (i)) ? 1.0 : 0.0);
4196  }
4197  res->v = v;
4198  return res;
4199 }
4200 
4202  _ARC0 (c0);
4203  _ARD1 (d1);
4204  _DEFB ();
4205  _RETB (*c0 <= d1);
4206 }
4207 
4209  _ARC0 (c0);
4210  _ARC1 (c1);
4211  _DEFB ();
4212  _RETB (*c0 <= *c1);
4213 }
4214 
4216  _ARC0 (c0);
4217  _ARV1 (v1);
4218  _DEFV ();
4219  qucs::vector * v = new qucs::vector ();
4220  for (int i = 0; i < v1->getSize (); i++) {
4221  v->add (*c0 <= v1->get (i) ? 1.0 : 0.0);
4222  }
4223  res->v = v;
4224  return res;
4225 }
4226 
4228  _ARV0 (v0);
4229  _ARD1 (d1);
4230  _DEFV ();
4231  qucs::vector * v = new qucs::vector ();
4232  for (int i = 0; i < v0->getSize (); i++) {
4233  v->add (real (v0->get (i)) <= d1 ? 1.0 : 0.0);
4234  }
4235  res->v = v;
4236  return res;
4237 }
4238 
4240  _ARV0 (v0);
4241  _ARC1 (c1);
4242  _DEFV ();
4243  qucs::vector * v = new qucs::vector ();
4244  for (int i = 0; i < v0->getSize (); i++) {
4245  v->add (v0->get (i) <= *c1 ? 1.0 : 0.0);
4246  }
4247  res->v = v;
4248  return res;
4249 }
4250 
4252  _ARV0 (v0);
4253  _ARV1 (v1);
4254  _DEFV ();
4255  qucs::vector * v = new qucs::vector ();
4256  for (int i = 0; i < v0->getSize (); i++) {
4257  v->add (v0->get (i) <= v1->get (i) ? 1.0 : 0.0);
4258  }
4259  res->v = v;
4260  return res;
4261 }
4262 
4263 // ********************* greater or equal ******************
4265  _ARD0 (d0);
4266  _ARD1 (d1);
4267  _DEFB ();
4268  _RETB (d0 >= d1);
4269 }
4270 
4272  _ARD0 (d0);
4273  _ARC1 (c1);
4274  _DEFB ();
4275  _RETB (d0 >= *c1);
4276 }
4277 
4279  _ARD0 (d0);
4280  _ARV1 (v1);
4281  _DEFV ();
4282  qucs::vector * v = new qucs::vector ();
4283  for (int i = 0; i < v1->getSize (); i++) {
4284  v->add (d0 >= real (v1->get (i)) ? 1.0 : 0.0);
4285  }
4286  res->v = v;
4287  return res;
4288 }
4289 
4291  _ARC0 (c0);
4292  _ARD1 (d1);
4293  _DEFB ();
4294  _RETB (*c0 >= d1);
4295 }
4296 
4298  _ARC0 (c0);
4299  _ARC1 (c1);
4300  _DEFB ();
4301  _RETB (*c0 >= *c1);
4302 }
4303 
4305  _ARC0 (c0);
4306  _ARV1 (v1);
4307  _DEFV ();
4308  qucs::vector * v = new qucs::vector ();
4309  for (int i = 0; i < v1->getSize (); i++) {
4310  v->add (*c0 >= v1->get (i) ? 1.0 : 0.0);
4311  }
4312  res->v = v;
4313  return res;
4314 }
4315 
4317  _ARV0 (v0);
4318  _ARD1 (d1);
4319  _DEFV ();
4320  qucs::vector * v = new qucs::vector ();
4321  for (int i = 0; i < v0->getSize (); i++) {
4322  v->add (real (v0->get (i)) >= d1 ? 1.0 : 0.0);
4323  }
4324  res->v = v;
4325  return res;
4326 }
4327 
4329  _ARV0 (v0);
4330  _ARC1 (c1);
4331  _DEFV ();
4332  qucs::vector * v = new qucs::vector ();
4333  for (int i = 0; i < v0->getSize (); i++) {
4334  v->add (v0->get (i) >= *c1 ? 1.0 : 0.0);
4335  }
4336  res->v = v;
4337  return res;
4338 }
4339 
4341  _ARV0 (v0);
4342  _ARV1 (v1);
4343  _DEFV ();
4344  qucs::vector * v = new qucs::vector ();
4345  for (int i = 0; i < v0->getSize (); i++) {
4346  v->add (v0->get (i) >= v1->get (i) ? 1.0 : 0.0);
4347  }
4348  res->v = v;
4349  return res;
4350 }
4351 
4352 // ************************** equal ************************
4354  _ARD0 (d0);
4355  _ARD1 (d1);
4356  _DEFB ();
4357  _RETB (d0 == d1);
4358 }
4359 
4361  _ARD0 (d0);
4362  _ARC1 (c1);
4363  _DEFB ();
4364  _RETB (d0 == *c1);
4365 }
4366 
4368  _ARD0 (d0);
4369  _ARV1 (v1);
4370  _DEFV ();
4371  qucs::vector * v = new qucs::vector ();
4372  for (int i = 0; i < v1->getSize (); i++) {
4373  v->add (d0 == real (v1->get (i)) ? 1.0 : 0.0);
4374  }
4375  res->v = v;
4376  return res;
4377 }
4378 
4380  _ARC0 (c0);
4381  _ARD1 (d1);
4382  _DEFB ();
4383  _RETB (*c0 == d1);
4384 }
4385 
4387  _ARC0 (c0);
4388  _ARC1 (c1);
4389  _DEFB ();
4390  _RETB (*c0 == *c1);
4391 }
4392 
4394  _ARC0 (c0);
4395  _ARV1 (v1);
4396  _DEFV ();
4397  qucs::vector * v = new qucs::vector ();
4398  for (int i = 0; i < v1->getSize (); i++) {
4399  v->add (*c0 == v1->get (i) ? 1.0 : 0.0);
4400  }
4401  res->v = v;
4402  return res;
4403 }
4404 
4406  _ARV0 (v0);
4407  _ARD1 (d1);
4408  _DEFV ();
4409  qucs::vector * v = new qucs::vector ();
4410  for (int i = 0; i < v0->getSize (); i++) {
4411  v->add (real (v0->get (i)) == d1 ? 1.0 : 0.0);
4412  }
4413  res->v = v;
4414  return res;
4415 }
4416 
4418  _ARV0 (v0);
4419  _ARC1 (c1);
4420  _DEFV ();
4421  qucs::vector * v = new qucs::vector ();
4422  for (int i = 0; i < v0->getSize (); i++) {
4423  v->add (v0->get (i) == *c1 ? 1.0 : 0.0);
4424  }
4425  res->v = v;
4426  return res;
4427 }
4428 
4430  _ARV0 (v0);
4431  _ARV1 (v1);
4432  _DEFV ();
4433  qucs::vector * v = new qucs::vector ();
4434  for (int i = 0; i < v0->getSize (); i++) {
4435  v->add (v0->get (i) == v1->get (i) ? 1.0 : 0.0);
4436  }
4437  res->v = v;
4438  return res;
4439 }
4440 
4442  _ARB0 (b0);
4443  _ARB1 (b1);
4444  _DEFB ();
4445  _RETB (b0 == b1);
4446 }
4447 
4448 // ************************ not equal **********************
4450  _ARD0 (d0);
4451  _ARD1 (d1);
4452  _DEFB ();
4453  _RETB (d0 != d1);
4454 }
4455 
4457  _ARD0 (d0);
4458  _ARC1 (c1);
4459  _DEFB ();
4460  _RETB (d0 != *c1);
4461 }
4462 
4464  _ARD0 (d0);
4465  _ARV1 (v1);
4466  _DEFV ();
4467  qucs::vector * v = new qucs::vector ();
4468  for (int i = 0; i < v1->getSize (); i++) {
4469  v->add (d0 != real (v1->get (i)) ? 1.0 : 0.0);
4470  }
4471  res->v = v;
4472  return res;
4473 }
4474 
4476  _ARC0 (c0);
4477  _ARD1 (d1);
4478  _DEFB ();
4479  _RETB (*c0 != d1);
4480 }
4481 
4483  _ARC0 (c0);
4484  _ARC1 (c1);
4485  _DEFB ();
4486  _RETB (*c0 != *c1);
4487 }
4488 
4490  _ARC0 (c0);
4491  _ARV1 (v1);
4492  _DEFV ();
4493  qucs::vector * v = new qucs::vector ();
4494  for (int i = 0; i < v1->getSize (); i++) {
4495  v->add (*c0 != v1->get (i) ? 1.0 : 0.0);
4496  }
4497  res->v = v;
4498  return res;
4499 }
4500 
4502  _ARV0 (v0);
4503  _ARD1 (d1);
4504  _DEFV ();
4505  qucs::vector * v = new qucs::vector ();
4506  for (int i = 0; i < v0->getSize (); i++) {
4507  v->add (real (v0->get (i)) != d1 ? 1.0 : 0.0);
4508  }
4509  res->v = v;
4510  return res;
4511 }
4512 
4514  _ARV0 (v0);
4515  _ARC1 (c1);
4516  _DEFV ();
4517  qucs::vector * v = new qucs::vector ();
4518  for (int i = 0; i < v0->getSize (); i++) {
4519  v->add (v0->get (i) != *c1 ? 1.0 : 0.0);
4520  }
4521  res->v = v;
4522  return res;
4523 }
4524 
4526  _ARV0 (v0);
4527  _ARV1 (v1);
4528  _DEFV ();
4529  qucs::vector * v = new qucs::vector ();
4530  for (int i = 0; i < v0->getSize (); i++) {
4531  v->add (v0->get (i) != v1->get (i) ? 1.0 : 0.0);
4532  }
4533  res->v = v;
4534  return res;
4535 }
4536 
4538  _ARB0 (b0);
4539  _ARB1 (b1);
4540  _DEFB ();
4541  _RETB (b0 != b1);
4542 }
4543 
4544 // *************************** not *************************
4546  _ARB0 (b0);
4547  _DEFB ();
4548  _RETB (!b0);
4549 }
4550 
4551 // *************************** or **************************
4553  _ARB0 (b0);
4554  _ARB1 (b1);
4555  _DEFB ();
4556  _RETB (b0 || b1);
4557 }
4558 
4559 // ************************** and **************************
4561  _ARB0 (b0);
4562  _ARB1 (b1);
4563  _DEFB ();
4564  _RETB (b0 && b1);
4565 }
4566 
4567 // ******************* random numbers **********************
4569  _DEFD ();
4570  _RETD (((nr_double_t) ::rand ()) / (nr_double_t) RAND_MAX);
4571 }
4572 
4574  static int done = 0;
4575  _ARD0 (d0);
4576  _DEFD ();
4577  if (!done) {
4578  unsigned int i0 = (unsigned int) d0;
4579  ::srand (i0);
4580  done = 1;
4581  _RETD (1.0);
4582  } else {
4583  _RETD (0.0);
4584  }
4585 }
4586 
4587 
4588 // ******************* assert test *************************
4590 {
4591  _ARB0(b0);
4592  if(!b0)
4593  abort();
4594  _DEFB ();
4595  _RETB(true);
4596 }
4597 
4598 
4600 {
4601  _ARD0(d0);
4602  if(d0 == 0.0)
4603  abort();
4604  _DEFB ();
4605  _RETB(true);
4606 }
4607 
4608 
4610  _ARV0 (v0);
4611  for (int i = 0; i < v0->getSize (); i++) {
4612  if( v0->get(i) == 0.0 )
4613  abort();
4614  }
4615  _DEFB ();
4616  _RETB(true);
4617 }
4618 
4619 
4621 {
4622  _ARB0(b0);
4623  if(b0)
4624  abort();
4625  _DEFB ();
4626  _RETB(true);
4627 }
4628 
4629 
4631 {
4632  _ARD0(d0);
4633  if(d0 != 0.0)
4634  abort();
4635  _DEFB ();
4636  _RETB(true);
4637 }
4638 
4639 
4641  _ARV0 (v0);
4642  for (int i = 0; i < v0->getSize (); i++) {
4643  if( v0->get(i) != 0.0 )
4644  abort();
4645  }
4646  _DEFB ();
4647  _RETB(true);
4648 }
4649 
4650 
4651 // ******************* immediate vectors *******************
4653  _DEFV ();
4654  qucs::vector * v = new qucs::vector ();
4655  for (node * arg = args; arg != NULL; arg = arg->getNext ()) {
4656  constant * c = arg->getResult ();
4657  switch (arg->getType ()) {
4658  case TAG_COMPLEX:
4659  v->add (*(c->c)); break;
4660  case TAG_DOUBLE:
4661  v->add (c->d); break;
4662  case TAG_BOOLEAN:
4663  v->add (c->b ? 1.0 : 0.0); break;
4664  case TAG_VECTOR:
4665  v->add (c->v); break;
4666  default:
4667  v->add (0.0); break;
4668  }
4669  }
4670  res->v = v;
4671  return res;
4672 }
4673 
4674 // ******************* immediate matrices ******************
4676  _DEFM ();
4677  /* create temporary list of vectors */
4678  qucs::vector * va = NULL;
4679  qucs::vector * v = new qucs::vector ();
4680  va = v;
4681  for (node * arg = args; arg != NULL; arg = arg->getNext ()) {
4682  constant * c = arg->getResult ();
4683  switch (arg->getType ()) {
4684  case TAG_COMPLEX:
4685  v->add (*(c->c)); break;
4686  case TAG_DOUBLE:
4687  v->add (c->d); break;
4688  case TAG_BOOLEAN:
4689  v->add (c->b ? 1.0 : 0.0); break;
4690  case TAG_VECTOR:
4691  v->add (c->v); break;
4692  case TAG_CHAR:
4693  if (c->chr == ';') {
4694  /* append new vector, i.e. a new matrix row */
4695  qucs::vector * vn = new qucs::vector ();
4696  v->setNext (vn);
4697  v = vn;
4698  }
4699  else v->add (0.0);
4700  break;
4701  default:
4702  v->add (0.0); break;
4703  }
4704  }
4705  /* determine matrix dimensions and create it */
4706  int r, c;
4707  for (r = 0, c = 0, v = va; v != NULL; v = (::vector *) v->getNext (), r++) {
4708  if (c < v->getSize ()) c = v->getSize ();
4709  }
4710  matrix * m = new matrix (r, c);
4711  /* fill in matrix entries and delete temporary vector list */
4712  qucs::vector * vn = NULL;
4713  for (r = 0, v = va; v != NULL; v = vn, r++) {
4714  for (c = 0; c < v->getSize (); c++) {
4715  m->set (r, c, v->get (c));
4716  }
4717  vn = (::vector *) v->getNext ();
4718  delete v;
4719  }
4720  /* return result matrix */
4721  res->m = m;
4722  return res;
4723 }
4724 
4725 // ********************** EMI receiver *********************
4727  _ARV0 (da);
4728  _ARV1 (dt);
4729  _DEFV ();
4730 
4731  // run receiver functionality
4732  qucs::vector * ed;
4733  if (_ARG(2)) {
4734  _ARI2 (len);
4735  ed = emi::receiver (da, dt, len);
4736  }
4737  else {
4738  ed = emi::receiver (da, dt);
4739  }
4740 
4741  // create two vectors for spectrum and frequency
4742  int rlen = ed->getSize ();
4743  qucs::vector * rvec = new qucs::vector (rlen);
4744  qucs::vector * rfeq = new qucs::vector (rlen);
4745  for (int i = 0; i < rlen; i++) {
4746  (*rvec)(i) = real (ed->get (i));
4747  (*rfeq)(i) = imag (ed->get (i));
4748  }
4749  delete ed;
4750 
4751  // put results back into equation solver
4752  node * gen = SOLVEE(0)->addGeneratedEquation (rfeq, "Frequency");
4753  res->addPrepDependencies (A(gen)->result);
4754  res->dropdeps = 1;
4755  res->v = rvec;
4756  return res;
4757 }
4758 
4759 // Include the application array.
4760 #include "applications.h"
4761 
#define _RETM(var)
Definition: evaluate.cpp:130
static constant * log2_v(constant *)
Definition: evaluate.cpp:1490
static constant * power_d_c(constant *)
Definition: evaluate.cpp:1055
static constant * ifthenelse_c_c(constant *)
Definition: evaluate.cpp:3878
static constant * minus_v_d(constant *)
Definition: evaluate.cpp:544
static constant * noise_circle_d(constant *)
Definition: evaluate.cpp:2848
static constant * over_mv_d(constant *)
Definition: evaluate.cpp:955
static constant * plus_mv_m(constant *)
Definition: evaluate.cpp:380
static constant * cumavg_v(constant *)
Definition: evaluate.cpp:3390
matrix inverse(matrix a)
Compute inverse matrix.
Definition: matrix.cpp:847
static constant * power_v_v(constant *)
Definition: evaluate.cpp:1090
static constant * sum_d(constant *)
Definition: evaluate.cpp:2000
static constant * plus_s_c(constant *)
Definition: evaluate.cpp:484
start
Definition: parse_zvr.y:126
std::complex< nr_double_t > nr_complex_t
Definition: complex.h:31
#define FOURIER_HELPER_1(efunc, cfunc, isign, dep)
Definition: evaluate.cpp:2291
static constant * ytoz_mv(constant *)
Definition: evaluate.cpp:2404
static constant * lessorequal_d_c(constant *)
Definition: evaluate.cpp:4182
static constant * unwrap_v_1(constant *)
Definition: evaluate.cpp:1309
#define INT(con)
Definition: evaluate.cpp:68
static constant * rms_d(constant *)
Definition: evaluate.cpp:3416
static void extract_vector(constant *, int, int &, int &, constant *)
Definition: evaluate.cpp:2126
static constant * arcosech_d(constant *)
Definition: evaluate.cpp:1687
static constant * over_c_d(constant *)
Definition: evaluate.cpp:881
static constant * dB_mv(constant *)
Definition: evaluate.cpp:1398
static constant * minus_d_v(constant *)
Definition: evaluate.cpp:551
static constant * rtoswr_v(constant *)
Definition: evaluate.cpp:1854
static constant * dB_c(constant *)
Definition: evaluate.cpp:1380
static constant * index_v_2(constant *)
Definition: evaluate.cpp:2202
static constant * integrate_d_d(constant *)
Definition: evaluate.cpp:3661
matrix adjoint(matrix a)
adjoint matrix
Definition: matrix.cpp:522
static constant * max_d(constant *)
Definition: evaluate.cpp:1880
matrix ytos(matrix y, qucs::vector z0)
Admittance matrix to scattering parameters.
Definition: matrix.cpp:1133
vector w2dbm(vector)
Definition: vector.cpp:1186
static constant * rms_v(constant *)
Definition: evaluate.cpp:3428
static constant * noise_circle_v_v(constant *)
Definition: evaluate.cpp:2853
vector cumavg(vector)
Definition: vector.cpp:1002
matrix real(matrix a)
Real part matrix.
Definition: matrix.cpp:568
matrix abs(matrix a)
Computes magnitude of each matrix element.
Definition: matrix.cpp:531
static constant * phase_d(constant *)
Definition: evaluate.cpp:1247
static constant * minus_v(constant *)
Definition: evaluate.cpp:503
static constant * polar_d_c(constant *)
Definition: evaluate.cpp:3540
nr_complex_t erf(const nr_complex_t z)
Error function.
Definition: complex.cpp:766
#define MAKE_FUNC_DEFINITION_1(cfunc)
Definition: evaluate.cpp:234
static constant * times_c_d(constant *)
Definition: evaluate.cpp:692
static constant * artanh_c(constant *)
Definition: evaluate.cpp:1751
#define N(n)
Definition: equation.cpp:58
static constant * ln_v(constant *)
Definition: evaluate.cpp:1444
#define M_LOG2E
Binary logartihm of Euler's constant ( )
Definition: consts.h:79
static constant * xhypot_c_c(constant *)
Definition: evaluate.cpp:1140
static constant * ifthenelse_b_d(constant *)
Definition: evaluate.cpp:3870
static constant * greaterorequal_v_d(constant *)
Definition: evaluate.cpp:4316
size
Definition: parse_vcd.y:203
static constant * det_mv(constant *)
Definition: evaluate.cpp:2670
#define MAKE_FUNC_DEFINITION_3(cfunc)
Definition: evaluate.cpp:2344
static constant * index_s_1(constant *)
Definition: evaluate.cpp:2236
#define _DEFM()
Definition: evaluate.cpp:118
matrix ytoz(matrix y)
Convert admittance matrix to impedance matrix.
Definition: matrix.cpp:1380
static constant * transpose_mv(constant *)
Definition: evaluate.cpp:2658
#define _ARMV0(var)
Definition: evaluate.cpp:109
int getSize(void) const
Definition: vector.cpp:192
static constant * length_c(constant *)
Definition: evaluate.cpp:2062
nr_complex_t ceil(const nr_complex_t z)
Complex ceil Ceil is the smallest integral value not less than argument Apply ceil to real and imagin...
Definition: complex.cpp:634
qucs::vector * v
Definition: equation.h:171
static constant * minus_m(constant *)
Definition: evaluate.cpp:507
solver * solvee
Definition: equation.h:123
static constant * arcsin_v(constant *)
Definition: evaluate.cpp:1509
static constant * max_v(constant *)
Definition: evaluate.cpp:1896
static constant * minus_m_d(constant *)
Definition: evaluate.cpp:607
static constant * stddev_c(constant *)
Definition: evaluate.cpp:3457
static constant * sqrt_d(constant *)
Definition: evaluate.cpp:1405
static constant * twoport_mv(constant *)
Definition: evaluate.cpp:2627
static constant * phase_mv(constant *)
Definition: evaluate.cpp:1271
constant * getResult(int)
Definition: equation.cpp:1126
#define _CHKM(m)
Definition: evaluate.cpp:2423
nr_complex_t coth(const nr_complex_t z)
Compute complex hyperbolic cotangent.
Definition: complex.cpp:320
qucs::vector runavg(qucs::vector, const int)
static constant * modulo_d_v(constant *)
Definition: evaluate.cpp:1005
vector cumsum(vector)
Definition: vector.cpp:992
static constant * polar_v_d(constant *)
Definition: evaluate.cpp:3568
static constant * range_c_c(constant *)
Definition: evaluate.cpp:3334
static constant * greaterorequal_d_v(constant *)
Definition: evaluate.cpp:4278
static constant * arctan2_v_v(constant *)
Definition: evaluate.cpp:3615
static constant * plus_d(constant *)
Definition: evaluate.cpp:282
#define _ARG(idx)
Definition: evaluate.cpp:77
static constant * bugon_v(constant *)
Definition: evaluate.cpp:4640
static constant * lessorequal_c_v(constant *)
Definition: evaluate.cpp:4215
nr_complex_t pow(const nr_complex_t z, const nr_double_t d)
Compute power function with real exponent.
Definition: complex.cpp:238
static constant * cumsum_v(constant *)
Definition: evaluate.cpp:3371
matrix stos(matrix s, qucs::vector zref, qucs::vector z0)
S params to S params.
Definition: matrix.cpp:890
static constant * yn_d_d(constant *)
Definition: evaluate.cpp:3491
static constant * sec_v(constant *)
Definition: evaluate.cpp:1604
#define _ARES(idx)
Definition: evaluate.cpp:76
#define _ARV0(var)
Definition: evaluate.cpp:106
node * getNext(void)
Definition: equation.h:69
static constant * avg_d(constant *)
Definition: evaluate.cpp:2038
static constant * kbd_d(constant *)
Definition: evaluate.cpp:3836
static constant * stab_circle_s_d(constant *)
Definition: evaluate.cpp:2950
nr_complex_t cos(const nr_complex_t z)
Compute complex cosine.
Definition: complex.cpp:57
static constant * dbm_v(constant *)
Definition: evaluate.cpp:3716
static constant * min_c_c(constant *)
Definition: evaluate.cpp:1979
static constant * greaterorequal_d_d(constant *)
Definition: evaluate.cpp:4264
static constant * greaterorequal_c_d(constant *)
Definition: evaluate.cpp:4290
static constant * times_mv_d(constant *)
Definition: evaluate.cpp:810
static constant * times_d_v(constant *)
Definition: evaluate.cpp:714
static constant * bugon_b(constant *)
Definition: evaluate.cpp:4620
static constant * phase_m(constant *)
Definition: evaluate.cpp:1265
nr_complex_t sum(vector)
Definition: vector.cpp:251
static constant * stab_circle_s_v(constant *)
Definition: evaluate.cpp:2929
static constant * variance_d(constant *)
Definition: evaluate.cpp:3435
static constant * notequal_d_d(constant *)
Definition: evaluate.cpp:4449
static constant * plus_m(constant *)
Definition: evaluate.cpp:294
static constant * min_d(constant *)
Definition: evaluate.cpp:1940
static constant * plus_d_v(constant *)
Definition: evaluate.cpp:338
nr_complex_t step(const nr_complex_t z)
Heaviside step function for complex number.
Definition: complex.cpp:691
#define FOURIER_HELPER_2(cfunc)
Definition: evaluate.cpp:2318
static constant * plus_d_c(constant *)
Definition: evaluate.cpp:324
static constant * plus_m_mv(constant *)
Definition: evaluate.cpp:387
t
Definition: parse_vcd.y:290
static constant * w2dbm_v(constant *)
Definition: evaluate.cpp:3654
nr_complex_t avg(vector)
Definition: vector.cpp:263
static constant * plus_d_mv(constant *)
Definition: evaluate.cpp:429
static constant * range_c_d(constant *)
Definition: evaluate.cpp:3322
#define _ARI2(var)
Definition: evaluate.cpp:93
static constant * integrate_v_d(constant *)
Definition: evaluate.cpp:3675
nr_complex_t signum(const nr_complex_t z)
complex signum function
Definition: complex.cpp:416
static constant * dbm_c_c(constant *)
Definition: evaluate.cpp:3736
static constant * greater_c_v(constant *)
Definition: evaluate.cpp:4126
static constant * det_m(constant *)
Definition: evaluate.cpp:2664
static constant * max_d_d(constant *)
Definition: evaluate.cpp:1902
static constant * norm_d(constant *)
Definition: evaluate.cpp:1228
static constant * stos_mv_v(constant *)
Definition: evaluate.cpp:2572
#define _DEFMV()
Definition: evaluate.cpp:119
qucs::vector logspace(nr_double_t, nr_double_t, int)
Definition: vector.cpp:965
static constant * plus_c_v(constant *)
Definition: evaluate.cpp:352
static constant * times_m_d(constant *)
Definition: evaluate.cpp:769
static constant * arccosec_d(constant *)
Definition: evaluate.cpp:1649
nr_complex_t atan(const nr_complex_t z)
Compute complex arc tangent.
Definition: complex.cpp:117
static constant * notequal_c_v(constant *)
Definition: evaluate.cpp:4489
static constant * assert_d(constant *)
Definition: evaluate.cpp:4599
static constant * notequal_v_c(constant *)
Definition: evaluate.cpp:4513
static constant * times_c_c(constant *)
Definition: evaluate.cpp:685
nr_complex_t cot(const nr_complex_t z)
Compute complex cotangent.
Definition: complex.cpp:298
Global physical constants header file.
static constant * range_d_d(constant *)
Definition: evaluate.cpp:3315
static constant * ifthenelse_v_v_v(constant *)
Definition: evaluate.cpp:3957
nr_complex_t asech(const nr_complex_t z)
Compute complex argument hyperbolic secant.
Definition: complex.cpp:354
static constant * stos_mv_d_d(constant *)
Definition: evaluate.cpp:2544
static constant * max_d_c(constant *)
Definition: evaluate.cpp:1909
static constant * cumprod_c(constant *)
Definition: evaluate.cpp:3403
static constant * notequal_b_b(constant *)
Definition: evaluate.cpp:4537
static constant * cumprod_v(constant *)
Definition: evaluate.cpp:3409
static constant * sec_c(constant *)
Definition: evaluate.cpp:1598
static constant * stos_mv_c(constant *)
Definition: evaluate.cpp:2537
static constant * times_c_v(constant *)
Definition: evaluate.cpp:728
void setNext(object *o)
Definition: object.h:60
matrix twoport(matrix m, char in, char out)
Generic conversion matrix.
Definition: matrix.cpp:1594
static constant * times_d_m(constant *)
Definition: evaluate.cpp:776
static constant * ln_c(constant *)
Definition: evaluate.cpp:1438
static constant * runavg_d_d(constant *)
Definition: evaluate.cpp:3751
static constant * plus_c_s(constant *)
Definition: evaluate.cpp:474
static constant * rtoswr_d(constant *)
Definition: evaluate.cpp:1842
static constant * prod_c(constant *)
Definition: evaluate.cpp:2025
static constant * ga_circle_v(constant *)
Definition: evaluate.cpp:3041
nr_double_t rollet(matrix)
static constant * lessorequal_c_c(constant *)
Definition: evaluate.cpp:4208
#define _RETD(var)
Definition: evaluate.cpp:123
static constant * stab_circle_l(constant *)
Definition: evaluate.cpp:2924
static constant * gp_circle_v(constant *)
Definition: evaluate.cpp:3126
#define MAKE_FUNC_DEFINITION_0_QUCS(cfunc)
Definition: evaluate.cpp:198
static constant * times_c_m(constant *)
Definition: evaluate.cpp:762
#define A(a)
Definition: evaluate.cpp:72
static constant * less_d_c(constant *)
Definition: evaluate.cpp:4004
static constant * cumavg_d(constant *)
Definition: evaluate.cpp:3378
static constant * plus_mv_c(constant *)
Definition: evaluate.cpp:436
#define _CHKMVA(mv, cond)
Definition: evaluate.cpp:2438
static constant * plus_v_mv(constant *)
Definition: evaluate.cpp:457
static constant * minus_mv_m(constant *)
Definition: evaluate.cpp:593
static constant * rollet_m(constant *)
Definition: evaluate.cpp:2695
static constant * xvalue_c(constant *)
Definition: evaluate.cpp:3181
static constant * log10_c(constant *)
Definition: evaluate.cpp:1461
static constant * stos_mv_d_c(constant *)
Definition: evaluate.cpp:2551
static constant * xhypot_v_c(constant *)
Definition: evaluate.cpp:1175
static constant * gp_circle_d(constant *)
Definition: evaluate.cpp:3081
static constant * notequal_d_c(constant *)
Definition: evaluate.cpp:4456
static constant * arcoth_c(constant *)
Definition: evaluate.cpp:1770
#define _ARI0(var)
Definition: evaluate.cpp:91
static constant * over_d_v(constant *)
Definition: evaluate.cpp:905
nr_complex_t acot(const nr_complex_t z)
Compute complex arc cotangent.
Definition: complex.cpp:310
static constant * plus_mv_d(constant *)
Definition: evaluate.cpp:422
static constant * ga_circle_d_v(constant *)
Definition: evaluate.cpp:2961
static constant * yn_d_c(constant *)
Definition: evaluate.cpp:3498
static constant * max_r(constant *)
Definition: evaluate.cpp:3249
static constant * modulo_v_v(constant *)
Definition: evaluate.cpp:1026
static constant * gp_circle_d_v(constant *)
Definition: evaluate.cpp:3046
static constant * minus_mv_mv(constant *)
Definition: evaluate.cpp:586
#define _DEFR()
Definition: evaluate.cpp:120
static constant * lessorequal_v_d(constant *)
Definition: evaluate.cpp:4227
static constant * ga_circle_d_d(constant *)
Definition: evaluate.cpp:2991
#define _ARC2(var)
Definition: evaluate.cpp:102
static constant * stos_m_c_d(constant *)
Definition: evaluate.cpp:2473
n
Definition: parse_citi.y:147
#define S(con)
Definition: property.cpp:158
static constant * length_mv(constant *)
Definition: evaluate.cpp:2078
static constant * plus_s_s(constant *)
Definition: evaluate.cpp:464
static const nr_double_t z0
Definition: circuit.h:320
#define _ARR1(var)
Definition: evaluate.cpp:89
static constant * over_d_c(constant *)
Definition: evaluate.cpp:889
static constant * vt_c(constant *)
Definition: evaluate.cpp:3795
r
Definition: parse_mdl.y:515
static constant * max_c(constant *)
Definition: evaluate.cpp:1886
nr_complex_t acosh(const nr_complex_t z)
Compute complex arc hyperbolic cosine.
Definition: complex.cpp:162
static constant * dB_m(constant *)
Definition: evaluate.cpp:1392
static constant * phase_c(constant *)
Definition: evaluate.cpp:1253
static constant * cumavg_c(constant *)
Definition: evaluate.cpp:3384
nr_double_t b1(matrix)
nr_complex_t rtoz(const nr_complex_t r, nr_complex_t zref)
Converts reflexion coefficient to impedance.
Definition: complex.cpp:590
void evaluate(void)
Definition: equation.cpp:1882
static constant * power_m_d(constant *)
Definition: evaluate.cpp:1097
object * getNext(void)
Definition: object.h:59
static constant * lessorequal_d_d(constant *)
Definition: evaluate.cpp:4175
static constant * arcsin_c(constant *)
Definition: evaluate.cpp:1503
static constant * arsech_v(constant *)
Definition: evaluate.cpp:1738
static constant * minus_d_m(constant *)
Definition: evaluate.cpp:614
static constant * stos_m_d(constant *)
Definition: evaluate.cpp:2445
static constant * minus_c(constant *)
Definition: evaluate.cpp:499
static constant * sum_c(constant *)
Definition: evaluate.cpp:2006
static constant * arctan2_d_v(constant *)
Definition: evaluate.cpp:3601
static constant * conj_mv(constant *)
Definition: evaluate.cpp:1221
#define _ARI1(var)
Definition: evaluate.cpp:92
static constant * cumprod_d(constant *)
Definition: evaluate.cpp:3397
static constant * arctan2_d_d(constant *)
Definition: evaluate.cpp:3590
static constant * rtoswr_c(constant *)
Definition: evaluate.cpp:1848
#define EQUATION_HAS_DEPS(v, n)
Definition: evaluate.cpp:2118
static constant * over_v_d(constant *)
Definition: evaluate.cpp:897
static constant * xhypot_d_v(constant *)
Definition: evaluate.cpp:1168
static constant * times_v_mv(constant *)
Definition: evaluate.cpp:857
nr_complex_t sign(const nr_complex_t z)
complex sign function
Definition: complex.cpp:435
static constant * arcsec_v(constant *)
Definition: evaluate.cpp:1623
static constant * polar_d_d(constant *)
Definition: evaluate.cpp:3526
static constant * arsech_c(constant *)
Definition: evaluate.cpp:1732
#define CIRCLE_HELPER_A()
Definition: evaluate.cpp:2809
nr_complex_t asinh(const nr_complex_t z)
Compute complex arc hyperbolic sine.
Definition: complex.cpp:175
nr_complex_t cosh(const nr_complex_t z)
Compute complex hyperbolic cosine.
Definition: complex.cpp:135
static constant * kbd_d_d(constant *)
Definition: evaluate.cpp:3811
static constant * arcosech_v(constant *)
Definition: evaluate.cpp:1700
args
static constant * times_v_c(constant *)
Definition: evaluate.cpp:721
static constant * dbm_d_d(constant *)
Definition: evaluate.cpp:3696
i
Definition: parse_mdl.y:516
vector cumprod(vector)
Definition: vector.cpp:1012
static constant * arccosec_v(constant *)
Definition: evaluate.cpp:1661
static constant * dbm_d(constant *)
Definition: evaluate.cpp:3690
static constant * norm_c(constant *)
Definition: evaluate.cpp:1234
static constant * rollet_mv(constant *)
Definition: evaluate.cpp:2701
static constant * and_b_b(constant *)
Definition: evaluate.cpp:4560
static constant * integrate_c_c(constant *)
Definition: evaluate.cpp:3668
nr_complex_t sqr(const nr_complex_t z)
Square of complex number.
Definition: complex.cpp:673
static constant * dbm_c(constant *)
Definition: evaluate.cpp:3703
#define R(r)
Definition: evaluate.cpp:73
static constant * over_mv_c(constant *)
Definition: evaluate.cpp:948
#define M_PI_2
Half of Archimedes' constant ( )
Definition: consts.h:51
static constant * stos_m_c_c(constant *)
Definition: evaluate.cpp:2480
matrix imag(matrix a)
Imaginary part matrix.
Definition: matrix.cpp:581
static constant * matrix_x(constant *)
Definition: evaluate.cpp:4675
#define D(con)
Definition: evaluate.cpp:61
#define _ARD1(var)
Definition: evaluate.cpp:95
static constant * modulo_d_d(constant *)
Definition: evaluate.cpp:970
static constant * arsinh_c(constant *)
Definition: evaluate.cpp:1674
static constant * dbm_c_d(constant *)
Definition: evaluate.cpp:3709
#define _ARB0(var)
Definition: evaluate.cpp:97
static constant * rad2deg_v(constant *)
Definition: evaluate.cpp:1364
nr_complex_t fix(const nr_complex_t z)
Complex fix.
Definition: complex.cpp:645
static constant * stos_m_d_c(constant *)
Definition: evaluate.cpp:2466
nr_complex_t sqrt(const nr_complex_t z)
Compute principal value of square root.
Definition: complex.cpp:271
static constant * stos_mv_c_v(constant *)
Definition: evaluate.cpp:2600
static constant * minus_m_c(constant *)
Definition: evaluate.cpp:621
static constant * power_mv_d(constant *)
Definition: evaluate.cpp:1111
static constant * artanh_d(constant *)
Definition: evaluate.cpp:1745
static constant * index_mv_2(constant *)
Definition: evaluate.cpp:2085
#define _DEFV()
Definition: evaluate.cpp:117
static constant * stos_m_v_d(constant *)
Definition: evaluate.cpp:2494
static constant * minus_d(constant *)
Definition: evaluate.cpp:495
nr_double_t xhypot(const nr_complex_t a, const nr_complex_t b)
Euclidean distance function for complex argument.
Definition: complex.cpp:465
static constant * dbm2w_v(constant *)
Definition: evaluate.cpp:3635
static constant * times_v_v(constant *)
Definition: evaluate.cpp:735
static constant * xhypot_v_v(constant *)
Definition: evaluate.cpp:1189
static constant * equal_v_c(constant *)
Definition: evaluate.cpp:4417
static constant * plus_c_d(constant *)
Definition: evaluate.cpp:317
matrix stoy(matrix s, qucs::vector z0)
Scattering parameters to admittance matrix.
Definition: matrix.cpp:1082
static constant * ifthenelse_b_b(constant *)
Definition: evaluate.cpp:3854
nr_complex_t acos(const nr_complex_t z)
Compute complex arc cosine.
Definition: complex.cpp:84
static constant * assert_v(constant *)
Definition: evaluate.cpp:4609
stop
Definition: parse_zvr.y:127
static constant * times_d_d(constant *)
Definition: evaluate.cpp:678
nr_complex_t log2(const nr_complex_t z)
Compute principal value of binary logarithm of z.
Definition: complex.cpp:393
static constant * less_c_d(constant *)
Definition: evaluate.cpp:4023
static constant * plus_m_d(constant *)
Definition: evaluate.cpp:394
points
Definition: parse_zvr.y:129
static constant * plus_v_c(constant *)
Definition: evaluate.cpp:345
nr_complex_t fmod(const nr_complex_t x, const nr_complex_t y)
Complex fmod Apply fmod to the complex z.
Definition: complex.cpp:662
static constant * minus_c_d(constant *)
Definition: evaluate.cpp:530
static constant * minus_d_c(constant *)
Definition: evaluate.cpp:537
static constant * noise_circle_v_d(constant *)
Definition: evaluate.cpp:2887
static constant * less_v_d(constant *)
Definition: evaluate.cpp:4049
static constant * minus_v_v(constant *)
Definition: evaluate.cpp:572
#define SOLVEE(idx)
Definition: evaluate.cpp:140
#define _ARD2(var)
Definition: evaluate.cpp:96
static constant * equal_v_d(constant *)
Definition: evaluate.cpp:4405
static constant * stab_circle_l_d(constant *)
Definition: evaluate.cpp:2919
nr_complex_t cosech(const nr_complex_t z)
Compute complex argument hyperbolic cosec.
Definition: complex.cpp:364
static constant * plot_vs_v(constant *)
Definition: evaluate.cpp:3132
static constant * notequal_d_v(constant *)
Definition: evaluate.cpp:4463
static constant * plus_d_d(constant *)
Definition: evaluate.cpp:303
nr_complex_t yn(const int n, const nr_complex_t z)
Bessel function of second kind.
Definition: complex.cpp:742
nr_complex_t tanh(const nr_complex_t z)
Compute complex hyperbolic tangent.
Definition: complex.cpp:153
nr_complex_t sin(const nr_complex_t z)
Compute complex sine.
Definition: complex.cpp:66
static constant * conj_d(constant *)
Definition: evaluate.cpp:1197
static constant * mu2_mv(constant *)
Definition: evaluate.cpp:2737
static constant * bugon_d(constant *)
Definition: evaluate.cpp:4630
static constant * xhypot_c_v(constant *)
Definition: evaluate.cpp:1182
nr_complex_t ztor(const nr_complex_t z, nr_complex_t zref)
Converts impedance to reflexion coefficient.
Definition: complex.cpp:581
void append(node *)
Definition: equation.cpp:1093
static constant * lessorequal_v_c(constant *)
Definition: evaluate.cpp:4239
static constant * ifthenelse_d_b(constant *)
Definition: evaluate.cpp:3862
static constant * less_d_d(constant *)
Definition: evaluate.cpp:3997
static constant * greaterorequal_d_c(constant *)
Definition: evaluate.cpp:4271
static constant * polar_c_c(constant *)
Definition: evaluate.cpp:3547
#define kBoverQ
Boltzmann constant over Elementary charge ( )
Definition: constants.h:68
nr_double_t dB(const nr_complex_t z)
Magnitude in dB Compute .
Definition: complex.cpp:528
static constant * variance_c(constant *)
Definition: evaluate.cpp:3440
qucs::vector * receiver(nr_double_t *, nr_double_t, int)
Definition: receiver.cpp:88
static constant * diff_v_2(constant *)
Definition: evaluate.cpp:1864
matrix ztos(matrix z, qucs::vector z0)
Convert impedance matrix scattering parameters.
Definition: matrix.cpp:1018
static constant * arcosh_d(constant *)
Definition: evaluate.cpp:1707
static constant * not_b(constant *)
Definition: evaluate.cpp:4545
static constant * greater_c_d(constant *)
Definition: evaluate.cpp:4112
static constant * notequal_c_d(constant *)
Definition: evaluate.cpp:4475
static constant * equal_c_c(constant *)
Definition: evaluate.cpp:4386
static constant * ztoy_mv(constant *)
Definition: evaluate.cpp:2416
static constant * arg_v(constant *)
Definition: evaluate.cpp:1290
static constant * equal_c_v(constant *)
Definition: evaluate.cpp:4393
nr_complex_t asin(const nr_complex_t z)
Compute complex arc sine.
Definition: complex.cpp:102
static constant * less_c_v(constant *)
Definition: evaluate.cpp:4037
void add(nr_complex_t)
Definition: vector.cpp:151
static constant * cosec_c(constant *)
Definition: evaluate.cpp:1636
static constant * minus_m_m(constant *)
Definition: evaluate.cpp:579
static constant * yvalue_d(constant *)
Definition: evaluate.cpp:3204
static constant * times_mv_mv(constant *)
Definition: evaluate.cpp:783
static constant * length_v(constant *)
Definition: evaluate.cpp:2067
static constant * stddev_d(constant *)
Definition: evaluate.cpp:3452
nr_double_t d
Definition: equation.h:169
#define RNG(con)
Definition: evaluate.cpp:69
static constant * minus_c_c(constant *)
Definition: evaluate.cpp:523
#define EQUATION_DEPS(v)
Definition: evaluate.cpp:2121
static constant * yn_d_v(constant *)
Definition: evaluate.cpp:3505
static constant * cumsum_c(constant *)
Definition: evaluate.cpp:3365
static constant * log10_d(constant *)
Definition: evaluate.cpp:1451
nr_complex_t acoth(const nr_complex_t z)
Compute complex argument hyperbolic cotangent.
Definition: complex.cpp:332
#define V(con)
Definition: evaluate.cpp:63
static constant * less_v_v(constant *)
Definition: evaluate.cpp:4073
#define _ARD0(var)
Definition: evaluate.cpp:94
static constant * diff_v_3(constant *)
Definition: evaluate.cpp:1871
static constant * stos_mv_d_v(constant *)
Definition: evaluate.cpp:2593
qucs::vector linspace(nr_double_t, nr_double_t, int)
Definition: vector.cpp:950
eqn::constant * c1
static constant * min_c_d(constant *)
Definition: evaluate.cpp:1989
static constant * avg_v(constant *)
Definition: evaluate.cpp:2050
static constant * polar_d_v(constant *)
Definition: evaluate.cpp:3554
static constant * twoport_m(constant *)
Definition: evaluate.cpp:2614
static constant * dbm_d_c(constant *)
Definition: evaluate.cpp:3729
static constant * assert_b(constant *)
Definition: evaluate.cpp:4589
static constant * interpolate_v_v_d(constant *)
Definition: evaluate.cpp:2258
void set(nr_double_t, int)
Definition: vector.cpp:183
eqn::constant * c2
static constant * xhypot_d_d(constant *)
Definition: evaluate.cpp:1133
static constant * greaterorequal_c_c(constant *)
Definition: evaluate.cpp:4297
static constant * lessorequal_d_v(constant *)
Definition: evaluate.cpp:4189
static constant * sqrt_v(constant *)
Definition: evaluate.cpp:1421
static constant * cosec_d(constant *)
Definition: evaluate.cpp:1630
static constant * min_v(constant *)
Definition: evaluate.cpp:1956
static constant * dbm2w_c(constant *)
Definition: evaluate.cpp:3629
static constant * arg_d(constant *)
Definition: evaluate.cpp:1278
static constant * times_d_c(constant *)
Definition: evaluate.cpp:699
x
Definition: parse_mdl.y:498
static constant * inverse_mv(constant *)
Definition: evaluate.cpp:2646
static constant * polar_c_v(constant *)
Definition: evaluate.cpp:3561
static constant * stab_circle_l_v(constant *)
Definition: evaluate.cpp:2898
static constant * inverse_m(constant *)
Definition: evaluate.cpp:2640
nr_complex_t log10(const nr_complex_t z)
Compute principal value of decimal logarithm of z.
Definition: complex.cpp:225
static constant * stos_mv_v_v(constant *)
Definition: evaluate.cpp:2607
#define _RETV(var)
Definition: evaluate.cpp:129
nr_complex_t * c
Definition: equation.h:170
nr_complex_t floor(const nr_complex_t z)
Complex floor.
Definition: complex.cpp:623
nr_complex_t det(matrix a)
Compute determinant of the given matrix.
Definition: matrix.cpp:762
static constant * log10_v(constant *)
Definition: evaluate.cpp:1467
nr_complex_t sech(const nr_complex_t z)
Compute complex hyperbolic secant.
Definition: complex.cpp:343
#define _ARM1(var)
Definition: evaluate.cpp:104
static constant * index_mv_1(constant *)
Definition: evaluate.cpp:2102
static constant * arcosh_v(constant *)
Definition: evaluate.cpp:1719
nr_complex_t integrate(vector v, const nr_complex_t)
Definition: vector.cpp:1207
static constant * greater_d_v(constant *)
Definition: evaluate.cpp:4100
#define STR(con)
Definition: evaluate.cpp:66
nr_complex_t erfc(const nr_complex_t z)
Complementart error function.
Definition: complex.cpp:784
#define M_PI
Archimedes' constant ( )
Definition: consts.h:47
static constant * arcoth_d(constant *)
Definition: evaluate.cpp:1764
static constant * over_d_d(constant *)
Definition: evaluate.cpp:865
static constant * w2dbm_c(constant *)
Definition: evaluate.cpp:3648
static constant * jn_d_c(constant *)
Definition: evaluate.cpp:3476
matrix transpose(matrix a)
Matrix transposition.
Definition: matrix.cpp:492
static constant * over_mv_v(constant *)
Definition: evaluate.cpp:962
Dense matrix class header file.
static constant * greater_v_v(constant *)
Definition: evaluate.cpp:4162
#define _ARB2(var)
Definition: evaluate.cpp:99
static constant * dbm_v_d(constant *)
Definition: evaluate.cpp:3722
static constant * arcsec_c(constant *)
Definition: evaluate.cpp:1617
static constant * stos_mv_d(constant *)
Definition: evaluate.cpp:2530
nr_complex_t ytor(const nr_complex_t y, nr_complex_t zref)
Converts admittance to reflexion coefficient.
Definition: complex.cpp:599
static constant * runavg_v_d(constant *)
Definition: evaluate.cpp:3775
static constant * arcosech_c(constant *)
Definition: evaluate.cpp:1694
The circuit class header file.
static constant * times_m_m(constant *)
Definition: evaluate.cpp:742
static constant * arccot_d(constant *)
Definition: evaluate.cpp:1573
#define _RETMV(var)
Definition: evaluate.cpp:131
nr_complex_t erfinv(const nr_complex_t z)
Inverse of error function.
Definition: complex.cpp:802
#define _ARV2(var)
Definition: evaluate.cpp:108
static constant * b1_mv(constant *)
Definition: evaluate.cpp:2753
static constant * plus_v(constant *)
Definition: evaluate.cpp:290
#define MAKE_FUNC_DEFINITION_0_SPECIAL(cfunc)
Definition: evaluate.cpp:217
static constant * w2dbm_d(constant *)
Definition: evaluate.cpp:3642
static constant * arccos_v(constant *)
Definition: evaluate.cpp:1528
#define rad(x)
Convert degree to radian.
Definition: constants.h:118
static constant * minus_c_mv(constant *)
Definition: evaluate.cpp:656
static constant * plus_c(constant *)
Definition: evaluate.cpp:286
type
Definition: parse_vcd.y:164
static constant * arcsec_d(constant *)
Definition: evaluate.cpp:1611
vector diff(vector, vector, int n=1)
Definition: vector.cpp:591
static constant * arccosec_c(constant *)
Definition: evaluate.cpp:1655
#define __RETV()
Definition: evaluate.cpp:136
static constant * over_m_c(constant *)
Definition: evaluate.cpp:934
#define THROW_MATH_EXCEPTION(txt)
Definition: evaluate.cpp:143
nr_complex_t rtoy(const nr_complex_t r, nr_complex_t zref)
Converts reflexion coefficient to admittance.
Definition: complex.cpp:608
static constant * ln_d(constant *)
Definition: evaluate.cpp:1428
i2
Definition: parse_citi.y:160
nr_complex_t i0(const nr_complex_t z)
Modified Bessel function of first kind.
Definition: complex.cpp:754
static constant * ga_circle_v_d(constant *)
Definition: evaluate.cpp:3036
static constant * plot_vs_mv(constant *)
Definition: evaluate.cpp:3145
nr_complex_t atan2(const nr_complex_t y, const nr_complex_t x)
Compute complex arc tangent fortran like function.
Definition: complex.cpp:377
static constant * plus_m_c(constant *)
Definition: evaluate.cpp:408
static constant * dB_d(constant *)
Definition: evaluate.cpp:1374
static constant * range_d_c(constant *)
Definition: evaluate.cpp:3328
static constant * vt_d(constant *)
Definition: evaluate.cpp:3789
static constant * power_v_d(constant *)
Definition: evaluate.cpp:1062
static constant * minus_mv_v(constant *)
Definition: evaluate.cpp:663
static constant * plus_m_m(constant *)
Definition: evaluate.cpp:366
static constant * conj_v(constant *)
Definition: evaluate.cpp:1209
static constant * minus_d_mv(constant *)
Definition: evaluate.cpp:642
static constant * eye_m(constant *)
Definition: evaluate.cpp:2676
static constant * modulo_v_c(constant *)
Definition: evaluate.cpp:1012
static constant * runavg_c_d(constant *)
Definition: evaluate.cpp:3763
#define MIN(x, y)
Minimum of x and y.
Definition: constants.h:132
static constant * minus_c_v(constant *)
Definition: evaluate.cpp:565
static constant * polar_v_v(constant *)
Definition: evaluate.cpp:3582
static constant * ifthenelse_d_d(constant *)
Definition: evaluate.cpp:3846
static constant * sqr_m(constant *)
Definition: evaluate.cpp:3513
static constant * plus_c_mv(constant *)
Definition: evaluate.cpp:443
static constant * arccot_v(constant *)
Definition: evaluate.cpp:1585
static constant * lessorequal_c_d(constant *)
Definition: evaluate.cpp:4201
static constant * receiver_v_v(constant *)
Definition: evaluate.cpp:4726
static constant * arsinh_d(constant *)
Definition: evaluate.cpp:1668
nr_complex_t sinc(const nr_complex_t z)
Cardinal sine.
Definition: complex.cpp:448
static constant * modulo_c_c(constant *)
Definition: evaluate.cpp:977
static constant * cosec_v(constant *)
Definition: evaluate.cpp:1642
static constant * over_c_c(constant *)
Definition: evaluate.cpp:873
static constant * lessorequal_v_v(constant *)
Definition: evaluate.cpp:4251
v
Definition: parse_zvr.y:141
static constant * minus_mv_c(constant *)
Definition: evaluate.cpp:649
static constant * equal_d_d(constant *)
Definition: evaluate.cpp:4353
static constant * arg_mv(constant *)
Definition: evaluate.cpp:1302
static constant * vector_x(constant *)
Definition: evaluate.cpp:4652
static constant * ga_circle_d(constant *)
Definition: evaluate.cpp:2996
nr_complex_t erfcinv(const nr_complex_t z)
Inverse of complementart error function.
Definition: complex.cpp:813
static constant * noise_circle_v(constant *)
Definition: evaluate.cpp:2892
static constant * rand(constant *)
Definition: evaluate.cpp:4568
static constant * times_mv_v(constant *)
Definition: evaluate.cpp:850
static constant * arctan_v(constant *)
Definition: evaluate.cpp:1547
#define _DEFB()
Definition: evaluate.cpp:115
#define _DEFC()
Definition: evaluate.cpp:116
static constant * minus_mv_d(constant *)
Definition: evaluate.cpp:635
static constant * or_b_b(constant *)
Definition: evaluate.cpp:4552
#define _ARM0(var)
Definition: evaluate.cpp:103
static constant * xhypot_v_d(constant *)
Definition: evaluate.cpp:1161
static constant * arsech_d(constant *)
Definition: evaluate.cpp:1726
static constant * deg2rad_c(constant *)
Definition: evaluate.cpp:1337
nr_complex_t limexp(const nr_complex_t z)
Compute limited complex exponential.
Definition: complex.cpp:539
matrix stoz(matrix s, qucs::vector z0)
Scattering parameters to impedance matrix.
Definition: matrix.cpp:973
static constant * equal_c_d(constant *)
Definition: evaluate.cpp:4379
static constant * sqr_mv(constant *)
Definition: evaluate.cpp:3519
#define B(con)
Definition: evaluate.cpp:70
void addDropDependencies(char *)
Definition: equation.cpp:1294
static constant * minus_mv(constant *)
Definition: evaluate.cpp:511
nr_double_t norm(const nr_complex_t z)
Compute euclidian norm of complex number.
Definition: complex.cpp:283
#define _RETC(var)
Definition: evaluate.cpp:128
static constant * modulo_d_c(constant *)
Definition: evaluate.cpp:991
#define _ARMV1(var)
Definition: evaluate.cpp:110
static constant * greater_v_d(constant *)
Definition: evaluate.cpp:4138
nr_complex_t sinh(const nr_complex_t z)
Compute complex hyperbolic sine.
Definition: complex.cpp:144
static constant * times_d_mv(constant *)
Definition: evaluate.cpp:817
static constant * plus_c_c(constant *)
Definition: evaluate.cpp:310
static constant * max_c_d(constant *)
Definition: evaluate.cpp:1929
static constant * power_v_c(constant *)
Definition: evaluate.cpp:1076
static constant * xvalue_d(constant *)
Definition: evaluate.cpp:3159
static constant * power_c_d(constant *)
Definition: evaluate.cpp:1048
#define MAKE_FUNC_DEFINITION_0(cfunc)
Definition: evaluate.cpp:160
static constant * min_c(constant *)
Definition: evaluate.cpp:1946
static constant * dbm_v_c(constant *)
Definition: evaluate.cpp:3743
static constant * min_d_d(constant *)
Definition: evaluate.cpp:1962
#define _ARV1(var)
Definition: evaluate.cpp:107
static constant * length_d(constant *)
Definition: evaluate.cpp:2057
List int
Definition: parse_citi.y:183
DSContent dsize
Definition: parse_mdl.y:323
static constant * ztoy_m(constant *)
Definition: evaluate.cpp:2410
static constant * minus_v_c(constant *)
Definition: evaluate.cpp:558
static constant * artanh_v(constant *)
Definition: evaluate.cpp:1757
static constant * polar_v_c(constant *)
Definition: evaluate.cpp:3575
static constant * ifthenelse_m_m(constant *)
Definition: evaluate.cpp:3899
static constant * plus_v_v(constant *)
Definition: evaluate.cpp:359
range
Definition: parse_vcd.y:206
y
Definition: parse_mdl.y:499
static constant * rad2deg_d(constant *)
Definition: evaluate.cpp:1352
nr_complex_t jn(const int n, const nr_complex_t z)
Bessel function of first kind.
Definition: complex.cpp:729
result
static constant * vt_v(constant *)
Definition: evaluate.cpp:3801
static constant * less_d_v(constant *)
Definition: evaluate.cpp:4011
static constant * length_m(constant *)
Definition: evaluate.cpp:2073
#define _CHKMA(m, cond)
Definition: evaluate.cpp:2433
static constant * xhypot_c_d(constant *)
Definition: evaluate.cpp:1147
static constant * greater_d_c(constant *)
Definition: evaluate.cpp:4093
static constant * mu1_mv(constant *)
Definition: evaluate.cpp:2717
static constant * over_v_c(constant *)
Definition: evaluate.cpp:912
static constant * conj_m(constant *)
Definition: evaluate.cpp:1215
static constant * stos_m_c_v(constant *)
Definition: evaluate.cpp:2515
vector dbm2w(vector)
Definition: vector.cpp:1193
#define deg(x)
Convert radian to degree.
Definition: constants.h:123
static constant * stos_mv_c_d(constant *)
Definition: evaluate.cpp:2558
static constant * modulo_c_d(constant *)
Definition: evaluate.cpp:984
static constant * plus_mv_v(constant *)
Definition: evaluate.cpp:450
#define _CHKMV(mv)
Definition: evaluate.cpp:2428
static constant * power_mv_c(constant *)
Definition: evaluate.cpp:1118
static constant * power_d_d(constant *)
Definition: evaluate.cpp:1034
static constant * sec_d(constant *)
Definition: evaluate.cpp:1592
nr_complex_t tan(const nr_complex_t z)
Compute complex tangent.
Definition: complex.cpp:75
static constant * stos_m_c(constant *)
Definition: evaluate.cpp:2452
static constant * gp_circle_d_d(constant *)
Definition: evaluate.cpp:3076
static constant * equal_b_b(constant *)
Definition: evaluate.cpp:4441
static constant * sum_v(constant *)
Definition: evaluate.cpp:2012
matrix eye(int rs, int cs)
Create identity matrix with specified number of rows and columns.
Definition: matrix.cpp:603
static constant * plus_mv(constant *)
Definition: evaluate.cpp:298
nr_complex_t exp(const nr_complex_t z)
Compute complex exponential.
Definition: complex.cpp:205
qucs::vector fftshift(qucs::vector)
static constant * power_c_v(constant *)
Definition: evaluate.cpp:1083
static constant * over_c_v(constant *)
Definition: evaluate.cpp:920
static constant * stos_m_d_d(constant *)
Definition: evaluate.cpp:2459
static constant * arctan2_v_d(constant *)
Definition: evaluate.cpp:3608
static constant * phase_v(constant *)
Definition: evaluate.cpp:1259
static constant * b1_m(constant *)
Definition: evaluate.cpp:2747
static constant * stos_mv_c_c(constant *)
Definition: evaluate.cpp:2565
static constant * noise_circle_d_d(constant *)
Definition: evaluate.cpp:2843
static constant * less_v_c(constant *)
Definition: evaluate.cpp:4061
static constant * minus_d_d(constant *)
Definition: evaluate.cpp:516
static constant * arcosh_c(constant *)
Definition: evaluate.cpp:1713
static constant * integrate_v_c(constant *)
Definition: evaluate.cpp:3682
static constant * min_d_c(constant *)
Definition: evaluate.cpp:1969
static constant * notequal_c_c(constant *)
Definition: evaluate.cpp:4482
static constant * times_mv_c(constant *)
Definition: evaluate.cpp:796
static constant * plus_v_d(constant *)
Definition: evaluate.cpp:331
#define M_LOG10E
Decimal logartihm of Euler's constant ( )
Definition: consts.h:75
static constant * unwrap_v_2(constant *)
Definition: evaluate.cpp:1315
nr_complex_t polar(const nr_double_t mag, const nr_double_t ang)
Construct a complex number using polar notation.
Definition: complex.cpp:551
static constant * equal_v_v(constant *)
Definition: evaluate.cpp:4429
matrix conj(matrix a)
Conjugate complex matrix.
Definition: matrix.cpp:505
static constant * arctan_d(constant *)
Definition: evaluate.cpp:1535
static constant * xhypot_d_c(constant *)
Definition: evaluate.cpp:1154
static constant * plus_c_m(constant *)
Definition: evaluate.cpp:415
nr_complex_t prod(vector)
Definition: vector.cpp:257
static constant * modulo_c_v(constant *)
Definition: evaluate.cpp:1019
static constant * avg_c(constant *)
Definition: evaluate.cpp:2044
#define _ARC0(var)
Definition: evaluate.cpp:100
static constant * transpose_m(constant *)
Definition: evaluate.cpp:2652
static constant * ga_circle_v_v(constant *)
Definition: evaluate.cpp:3001
static constant * times_mv_m(constant *)
Definition: evaluate.cpp:824
static constant * conj_c(constant *)
Definition: evaluate.cpp:1203
static constant * jn_d_v(constant *)
Definition: evaluate.cpp:3483
static constant * arsinh_v(constant *)
Definition: evaluate.cpp:1680
static constant * times_c_mv(constant *)
Definition: evaluate.cpp:803
static constant * stos_m_d_v(constant *)
Definition: evaluate.cpp:2508
static constant * stos_mv_v_c(constant *)
Definition: evaluate.cpp:2586
static constant * mu1_m(constant *)
Definition: evaluate.cpp:2707
static constant * norm_v(constant *)
Definition: evaluate.cpp:1240
static constant * power_d_v(constant *)
Definition: evaluate.cpp:1069
static constant * yvalue_c(constant *)
Definition: evaluate.cpp:3226
static constant * arg_c(constant *)
Definition: evaluate.cpp:1284
static constant * minus_m_mv(constant *)
Definition: evaluate.cpp:600
#define MAKE_FUNC_DEFINITION_2(cfunc)
Definition: evaluate.cpp:1783
static constant * dB_v(constant *)
Definition: evaluate.cpp:1386
static constant * deg2rad_d(constant *)
Definition: evaluate.cpp:1331
static constant * srand_d(constant *)
Definition: evaluate.cpp:4573
static constant * over_m_d(constant *)
Definition: evaluate.cpp:941
static constant * min_r(constant *)
Definition: evaluate.cpp:3271
static constant * ytoz_m(constant *)
Definition: evaluate.cpp:2398
static constant * gp_circle_v_d(constant *)
Definition: evaluate.cpp:3121
#define CIRCLE_HELPER_D(argi)
Definition: evaluate.cpp:2792
zref
Definition: parse_zvr.y:130
vector dbm(vector, const nr_complex_t z=50.0)
Definition: vector.cpp:1215
static constant * fftshift_v(constant *)
Definition: evaluate.cpp:2336
#define CHR(con)
Definition: evaluate.cpp:67
static constant * modulo_v_d(constant *)
Definition: evaluate.cpp:998
static constant * arcoth_v(constant *)
Definition: evaluate.cpp:1776
static constant * times_m_mv(constant *)
Definition: evaluate.cpp:837
static constant * cumsum_d(constant *)
Definition: evaluate.cpp:3359
static constant * prod_v(constant *)
Definition: evaluate.cpp:2031
static constant * avg_r(constant *)
Definition: evaluate.cpp:3293
static constant * equal_d_c(constant *)
Definition: evaluate.cpp:4360
#define _RETR(var)
Definition: evaluate.cpp:132
#define M(con)
Definition: evaluate.cpp:64
static constant * less_c_c(constant *)
Definition: evaluate.cpp:4030
nr_complex_t log(const nr_complex_t z)
Compute principal value of natural logarithm of z.
Definition: complex.cpp:215
static constant * stos_m_v(constant *)
Definition: evaluate.cpp:2487
static constant * cot_d(constant *)
Definition: evaluate.cpp:1554
static constant * notequal_v_v(constant *)
Definition: evaluate.cpp:4525
static constant * cot_c(constant *)
Definition: evaluate.cpp:1560
static constant * greaterorequal_c_v(constant *)
Definition: evaluate.cpp:4304
#define _RETB(var)
Definition: evaluate.cpp:127
static constant * variance_v(constant *)
Definition: evaluate.cpp:3445
matrix ztoy(matrix z)
impedance matrix to admittance matrix.
Definition: matrix.cpp:1050
static constant * notequal_v_d(constant *)
Definition: evaluate.cpp:4501
static constant * greaterorequal_v_c(constant *)
Definition: evaluate.cpp:4328
static constant * plus_d_m(constant *)
Definition: evaluate.cpp:401
static constant * times_m_c(constant *)
Definition: evaluate.cpp:755
static constant * jn_d_d(constant *)
Definition: evaluate.cpp:3469
static constant * sqrt_c(constant *)
Definition: evaluate.cpp:1415
static constant * power_m_c(constant *)
Definition: evaluate.cpp:1104
static constant * adjoint_m(constant *)
Definition: evaluate.cpp:2682
static constant * equal_d_v(constant *)
Definition: evaluate.cpp:4367
static constant * arccos_c(constant *)
Definition: evaluate.cpp:1522
static constant * stos_mv_v_d(constant *)
Definition: evaluate.cpp:2579
static constant * minus_v_mv(constant *)
Definition: evaluate.cpp:670
nr_complex_t round(const nr_complex_t z)
Complex round Round is the nearest integral value Apply round to real and imaginary part...
Definition: complex.cpp:496
static constant * interpolate_v_v(constant *)
Definition: evaluate.cpp:2253
static constant * arctan_c(constant *)
Definition: evaluate.cpp:1541
static constant * greater_c_c(constant *)
Definition: evaluate.cpp:4119
nr_complex_t get(int)
Definition: vector.cpp:179
#define _ARC1(var)
Definition: evaluate.cpp:101
static constant * log2_c(constant *)
Definition: evaluate.cpp:1484
static constant * plus_mv_mv(constant *)
Definition: evaluate.cpp:373
#define INTERPOL_HELPER()
Definition: evaluate.cpp:2245
static constant * mu2_m(constant *)
Definition: evaluate.cpp:2727
static constant * deg2rad_v(constant *)
Definition: evaluate.cpp:1343
constant * evaluate(void)
Definition: equation.cpp:262
static constant * minus_c_m(constant *)
Definition: evaluate.cpp:628
static constant * max_c_c(constant *)
Definition: evaluate.cpp:1919
static constant * greater_v_c(constant *)
Definition: evaluate.cpp:4150
static constant * cot_v(constant *)
Definition: evaluate.cpp:1566
static constant * ifthenelse_v_v(constant *)
Definition: evaluate.cpp:3928
static constant * log2_d(constant *)
Definition: evaluate.cpp:1474
static constant * noise_circle_d_v(constant *)
Definition: evaluate.cpp:2817
static constant * unwrap_v_3(constant *)
Definition: evaluate.cpp:1322
nr_double_t i0(nr_double_t)
Definition: fspecial.cpp:501
static constant * stos_m_v_c(constant *)
Definition: evaluate.cpp:2501
static constant * stab_circle_s(constant *)
Definition: evaluate.cpp:2955
static constant * power_c_c(constant *)
Definition: evaluate.cpp:1041
matrix arg(matrix a)
Computes the argument of each matrix element.
Definition: matrix.cpp:555
static constant * linspace(constant *)
Definition: evaluate.cpp:2760
static constant * greaterorequal_v_v(constant *)
Definition: evaluate.cpp:4340
static constant * stddev_v(constant *)
Definition: evaluate.cpp:3462
#define _DEFD()
Definition: evaluate.cpp:114
static constant * stos_m_v_v(constant *)
Definition: evaluate.cpp:2522
static constant * arccos_d(constant *)
Definition: evaluate.cpp:1516
static constant * logspace(constant *)
Definition: evaluate.cpp:2773
static constant * adjoint_mv(constant *)
Definition: evaluate.cpp:2688
static constant * greater_d_d(constant *)
Definition: evaluate.cpp:4086
static constant * arg_m(constant *)
Definition: evaluate.cpp:1296
static constant * rad2deg_c(constant *)
Definition: evaluate.cpp:1358
#define _ARB1(var)
Definition: evaluate.cpp:98
static constant * power_mv_v(constant *)
Definition: evaluate.cpp:1125
static constant * index_v_1(constant *)
Definition: evaluate.cpp:2193
static constant * arccot_c(constant *)
Definition: evaluate.cpp:1579
#define MAKE_FUNC_DEFINITION_0_STD(cfunc)
Definition: evaluate.cpp:179
static constant * arcsin_d(constant *)
Definition: evaluate.cpp:1497
static constant * prod_d(constant *)
Definition: evaluate.cpp:2019
data
Definition: parse_citi.y:117
nr_complex_t atanh(const nr_complex_t z)
Compute complex arc hyperbolic tangent.
Definition: complex.cpp:188
static constant * index_m_2(constant *)
Definition: evaluate.cpp:2219
static constant * dbm2w_d(constant *)
Definition: evaluate.cpp:3623
static constant * times_v_d(constant *)
Definition: evaluate.cpp:706
vector unwrap(vector, nr_double_t tol=M_PI, nr_double_t step=2 *M_PI)
Definition: vector.cpp:235
static constant * polar_c_d(constant *)
Definition: evaluate.cpp:3533
static constant * rms_c(constant *)
Definition: evaluate.cpp:3422
#define MAX(x, y)
Maximum of x and y.
Definition: constants.h:127
#define C(con)
Definition: evaluate.cpp:62
static constant * over_v_v(constant *)
Definition: evaluate.cpp:927
static constant * gp_circle_v_v(constant *)
Definition: evaluate.cpp:3086