56 using namespace qucs::eqn;
57 using namespace qucs::fourier;
58 using namespace fspecial;
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
72 #define A(a) ((assignment *) (a))
73 #define R(r) ((reference *) (r))
76 #define _ARES(idx) args->getResult(idx)
77 #define _ARG(idx) args->get(idx)
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));
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)
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);
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;
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;
140 #define SOLVEE(idx) args->get(idx)->solvee
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)
151 #if defined (__STDC__) || defined (__cplusplus)
152 # define QUCS_CONCAT2(a, b) a##b
153 # define QUCS_CONCAT3(a, b, c) a##b##c
155 # define QUCS_CONCAT2(a, b) ab
156 # define QUCS_CONCAT3(a, b, c) abc
160 #define MAKE_FUNC_DEFINITION_0(cfunc) \
161 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d) (constant * args) { \
166 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c) (constant * args) { \
169 _RETC (cfunc (*c)); \
171 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v) (constant * args) { \
174 _RETV (cfunc (*v)); \
179 #define MAKE_FUNC_DEFINITION_0_STD(cfunc) \
180 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d) (constant * args) { \
183 _RETD_STD (cfunc (d)); \
185 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c) (constant * args) { \
188 _RETC (cfunc (*c)); \
190 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v) (constant * args) { \
193 _RETV (cfunc (*v)); \
198 #define MAKE_FUNC_DEFINITION_0_QUCS(cfunc) \
199 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d) (constant * args) { \
202 _RETD_QUCS (cfunc (d)); \
204 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c) (constant * args) { \
207 _RETC (cfunc (*c)); \
209 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v) (constant * args) { \
212 _RETV (cfunc (*v)); \
217 #define MAKE_FUNC_DEFINITION_0_SPECIAL(cfunc) \
218 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d) (constant * args) { \
221 _RETD_SPECIAL (cfunc (d)); \
223 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c) (constant * args) { \
226 _RETC (cfunc (*c)); \
228 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v) (constant * args) { \
231 _RETV (cfunc (*v)); \
234 #define MAKE_FUNC_DEFINITION_1(cfunc) \
235 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d) (constant * args) { \
240 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c) (constant * args) { \
243 res->d = cfunc (*c); return res; \
245 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v) (constant * args) { \
248 _RETV (cfunc (*v)); \
250 constant * evaluate:: QUCS_CONCAT2 (cfunc,_m) (constant * args) { \
253 _RETM (cfunc (*m)); \
255 constant * evaluate:: QUCS_CONCAT2 (cfunc,_mv) (constant * args) {\
258 _RETMV (cfunc (*mv)); \
468 char * p = (
char *) malloc (strlen (s1) + strlen (s2) + 1);
469 strcpy (p, s1); strcat (p, s2);
478 char * p = (
char *) malloc (strlen (s2) + 2);
479 p[0] =
c1; strcpy (&p[1], s2);
488 char * p = (
char *) malloc (strlen (s1) + 2);
489 strcpy (p, s1); p[strlen (s1)] =
c2; p[strlen (s1) + 1] =
'\0';
746 if (m1->getCols () != m2->getRows ()) {
748 res->m =
new matrix (m1->getRows (), m2->getCols ());
750 res->m =
new matrix (*m1 * *m2);
787 if (v1->getCols () != v2->getRows ()) {
789 res->mv =
new matvec (v1->getSize (), v1->getRows (), v2->getCols ());
791 res->mv =
new matvec (*v1 * *v2);
828 if (v1->getCols () != m2->getRows ()) {
830 res->mv =
new matvec (v1->getSize (), v1->getRows (), m2->getCols ());
832 res->mv =
new matvec (*v1 * *m2);
841 if (m1->getCols () != v2->getRows ()) {
843 res->mv =
new matvec (v2->getSize (), m1->getRows (), v2->getCols ());
845 res->mv =
new matvec (*m1 * *v2);
1250 _RETD (d1 < 0.0 ? 180.0 : 0.0);
1347 for (
int i = 0;
i < v1->getSize ();
i++) v->
add (
rad (
real (v1->get (
i))));
1368 for (
int i = 0;
i < v1->getSize ();
i++) v->
add (
deg (
real (v1->get (
i))));
1748 _RETD (0.5 *
log ((1.0 + d1) / (1.0 - d1)));
1783 #define MAKE_FUNC_DEFINITION_2(cfunc) \
1784 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d) (constant * args) { \
1787 _RETD (real (cfunc (nr_complex_t (d, 0)))); \
1789 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d_d) (constant * args) { \
1793 _RETD (real (cfunc (nr_complex_t (d, 0), z))); \
1795 constant * evaluate:: QUCS_CONCAT2 (cfunc,_d_c) (constant * args) { \
1799 _RETC (cfunc (nr_complex_t (d, 0), *z)); \
1801 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c) (constant * args) { \
1804 _RETC (cfunc (*c)); \
1806 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c_d) (constant * args) { \
1810 _RETC (cfunc (*c, z)); \
1812 constant * evaluate:: QUCS_CONCAT2 (cfunc,_c_c) (constant * args) { \
1816 _RETC (cfunc (*c, *z)); \
1818 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v) (constant * args) { \
1821 _RETV (cfunc (*v)); \
1823 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v_d) (constant * args) { \
1827 _RETV (cfunc (*v, z)); \
1829 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v_c) (constant * args) { \
1833 _RETV (cfunc (*v, *z)); \
1845 _RETD ((1 + fabs (d1)) / (1 - fabs (d1)));
1858 for (
int i = 0;
i < v1->getSize ();
i++)
1859 res->v->
set ((1 +
abs (v1->get (
i))) / (1 -
abs (v1->get (
i))),
i);
1892 res->d = -
abs (*
c1);
1899 _RETD (v1->maximum ());
1952 res->d = -
abs (*
c1);
1959 _RETD (v1->minimum ());
2070 _RETD (v1->getSize ());
2081 _RETD (mv->getSize ());
2090 if (r < 1 || r > mv->getRows () || c < 1 || c > mv->getCols ()) {
2092 sprintf (txt,
"matvec indices [%d,%d] out of bounds [1-%d,1-%d]",
2093 r,
c, mv->getRows (), mv->getCols ());
2106 if (i < 1 || i > mv->getSize ()) {
2108 sprintf (txt,
"matvec index [%d] out of bounds [1-%d]",
i, mv->getSize ());
2110 res->m =
new matrix (mv->getRows (), mv->getCols ());
2112 res->m =
new matrix (mv->get (
i - 1));
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)
2132 strlist * deps =
_ARES(0)->getDataDependencies ();
2133 int didx = (deps ? deps->length () : 0) - idx;
2134 int dsize =
SOLVEE(0)->getDependencySize (deps, idx);
2141 skip *= deps ?
SOLVEE(0)->getDataSize (deps->get (didx - 1)) : 1;
2142 size *= deps ?
SOLVEE(0)->getDataSize (deps->get (didx)) : 1;
2150 if (i < 0 || i >= len) {
2152 sprintf (txt,
"vector index %d out of bounds [%d,%d]", i, 0, len - 1);
2156 if (i < 0 || i >= len) {
2158 sprintf (txt,
"vector index %d out of bounds [%d,%d]", i, 0, len - 1);
2162 for (n = 0; n < len; n++)
if (r->inside (n)) size++;
2164 for (k = 0, n = 0; n < len; n++) {
2166 vres->
set (res->
v->
get (n), k++);
2173 int len = deps ?
SOLVEE(0)->getDataSize (deps->get (didx)) :
v->getSize ();
2174 if (i < 0 || i >= len) {
2176 sprintf (txt,
"vector index %d (%d) out of bounds [%d,%d]",
2177 idx, i, 0, len - 1);
2181 for (n = k = 0; k < dsize *
size; n += skip, k++) {
2182 vres->
set (res->
v->
get (dsize * i + n), k);
2185 if (deps && didx >= 0) {
2189 if (res->
v != NULL)
delete res->
v;
2196 int skip = 1,
size = 1;
2198 extract_vector (args, 1, skip,
size, res);
2205 int skip = 1,
size = 1;
2209 sprintf (txt,
"invalid number of vector indices (%d > %d)", 2,
2214 extract_vector (args, 1, skip,
size, res);
2215 extract_vector (args, 2, skip,
size, res);
2224 if (r < 1 || r > m->getRows () || c < 1 || c > m->getCols ()) {
2226 sprintf (txt,
"matrix indices [%d,%d] out of bounds [1-%d,1-%d]",
2227 r,
c, m->getRows (), m->getCols ());
2240 res->
chr = (
i >= 0 &&
i < (
int) strlen (s)) ? s[
i] :
' ';
2245 #define INTERPOL_HELPER() \
2246 constant * arg = new constant (TAG_DOUBLE); \
2248 arg->solvee = args->getResult(0)->solvee; \
2255 return interpolate_v_v_d (args);
2263 if (v1->getSize () < 3) {
2269 nr_double_t last =
real (v2->get (v2->getSize () - 1));
2270 nr_double_t first =
real (v2->get (0));
2277 spl.vectors (*v1, *v2);
2279 for (
int k = 0; k < arg->v->getSize (); k++) {
2280 val->
set (spl.evaluate (
real (arg->v->get (k))).f0, k);
2283 node * gen =
SOLVEE(0)->addGeneratedEquation (arg->v,
"Interpolate");
2284 res->addPrepDependencies (
A(gen)->
result);
2291 #define FOURIER_HELPER_1(efunc,cfunc,isign,dep) \
2292 constant * evaluate:: QUCS_CONCAT2 (efunc,_v_v) (constant * args) { \
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; \
2300 int n = t->getSize (); \
2302 THROW_MATH_EXCEPTION ("nonconformant vector lengths"); \
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; \
2311 node * gen = SOLVEE(0)->addGeneratedEquation (arg->v, dep); \
2312 res->addPrepDependencies (A(gen)->result); \
2313 res->dropdeps = 1; \
2314 args->append (arg); \
2318 #define FOURIER_HELPER_2(cfunc) \
2319 constant * evaluate:: QUCS_CONCAT2 (cfunc,_v) (constant * args) { \
2322 qucs::vector * val = new qucs::vector (QUCS_CONCAT2 (cfunc,_1d) (*v)); \
2324 res->dropdeps = 1; \
2344 #define MAKE_FUNC_DEFINITION_3(cfunc) \
2345 constant * evaluate:: QUCS_CONCAT2 (cfunc,_m) (constant * args) { \
2348 _RETM (cfunc (*m)); \
2350 constant * evaluate:: QUCS_CONCAT2 (cfunc,_m_d) (constant * args) { \
2354 _RETM (cfunc (*m, nr_complex_t (z, 0))); \
2356 constant * evaluate:: QUCS_CONCAT2 (cfunc,_m_c) (constant * args) { \
2360 _RETM (cfunc (*m, *z)); \
2362 constant * evaluate:: QUCS_CONCAT2 (cfunc,_m_v) (constant * args) { \
2366 _RETM (cfunc (*m, *z)); \
2368 constant * evaluate:: QUCS_CONCAT2 (cfunc,_mv) (constant * args) { \
2371 _RETMV (cfunc (*m)); \
2373 constant * evaluate:: QUCS_CONCAT2 (cfunc,_mv_d) (constant * args) { \
2377 _RETMV (cfunc (*m, nr_complex_t (z, 0))); \
2379 constant * evaluate:: QUCS_CONCAT2 (cfunc,_mv_c) (constant * args) { \
2383 _RETMV (cfunc (*m, *z)); \
2385 constant * evaluate:: QUCS_CONCAT2 (cfunc,_mv_v) (constant * args) { \
2389 _RETMV (cfunc (*m, *z)); \
2424 if (m->getCols () != m->getRows ()) { \
2425 THROW_MATH_EXCEPTION ("stos: not a square matrix"); \
2426 res->m = new matrix (m->getRows (), m->getCols ()); \
2428 #define _CHKMV(mv) \
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 ()); \
2433 #define _CHKMA(m,cond) \
2435 THROW_MATH_EXCEPTION ("stos: nonconformant arguments"); \
2436 res->m = new matrix (m->getRows (), m->getCols ()); \
2438 #define _CHKMVA(mv,cond) \
2440 THROW_MATH_EXCEPTION ("stos: nonconformant arguments"); \
2441 res->mv = new matvec (mv->getSize (), mv->getRows (), mv->getCols ()); \
2510 _CHKM (m);
_CHKMA (m, m->getRows () == z0->getSize ());
2517 _CHKM (m);
_CHKMA (m, m->getRows () == z0->getSize ());
2524 _CHKM (m);
_CHKMA (m, m->getRows () == z0->getSize () &&
2525 m->getRows () ==
zref->getSize ());
2595 _CHKMV (mv);
_CHKMVA (mv, mv->getRows () == z0->getSize ());
2602 _CHKMV (mv);
_CHKMVA (mv, mv->getRows () == z0->getSize ());
2609 _CHKMV (mv);
_CHKMVA (mv, mv->getRows () == z0->getSize () &&
2610 mv->getRows () ==
zref->getSize ());
2619 if (m->getRows () < 2 || m->getCols () < 2) {
2632 if (mv->getRows () < 2 || mv->getCols () < 2) {
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)));
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)));
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)));
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)));
2792 #define CIRCLE_HELPER_D(argi) \
2793 int n = INT (args->getResult (argi)); \
2795 THROW_MATH_EXCEPTION ("Circle: number of points must be greater than 1"); \
2797 res->v = new qucs::vector (); \
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; \
2804 delete args->get(argi); \
2805 args->get((argi)-1)->setNext (NULL); \
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; \
2821 nr_double_t F =
D (
_ARES(3));
2830 for (i = 0, j = 0; i < C.
getSize (); i++) {
2831 for (a = 0; a < arc->
getSize (); a++, j++) {
2837 node * gen =
SOLVEE(4)->addGeneratedEquation (arc,
"Arcs");
2838 res->addPrepDependencies (
A(gen)->
result);
2845 return noise_circle_d_v (args);
2850 return noise_circle_d_v (args);
2858 :: vector * arc =
V (
_ARES(4));
2864 for (f = 0; f < F->
getSize (); f++) {
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++) {
2871 j = i * F->
getSize () * arc->getSize () + f * arc->getSize () + a;
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);
2889 return noise_circle_v_v (args);
2894 return noise_circle_v_v (args);
2907 for (i = 0, d = 0; i <
S->getSize (); i++) {
2908 for (a = 0; a < arc->getSize (); a++, d++) {
2913 node * gen =
SOLVEE(1)->addGeneratedEquation (arc,
"Arcs");
2914 res->addPrepDependencies (
A(gen)->
result);
2921 return stab_circle_l_v (args);
2926 return stab_circle_l_v (args);
2938 for (i = 0, d = 0; i <
S->getSize (); i++) {
2939 for (a = 0; a < arc->getSize (); a++, d++) {
2944 node * gen =
SOLVEE(1)->addGeneratedEquation (arc,
"Arcs");
2945 res->addPrepDependencies (
A(gen)->
result);
2952 return stab_circle_s_v (args);
2957 return stab_circle_s_v (args);
2968 c =
S->get (0, 0) -
conj (
S->get (1, 1)) * D;
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;
2978 for (i = 0, j = 0; i < C.getSize (); i++) {
2979 for (a = 0; a < arc->getSize (); a++, j++) {
2985 node * gen =
SOLVEE(2)->addGeneratedEquation (arc,
"Arcs");
2986 res->addPrepDependencies (
A(gen)->
result);
2993 return ga_circle_d_v (args);
2998 return ga_circle_d_v (args);
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;
3010 c =
S->get (0, 0) -
conj (
S->get (1, 1)) * D;
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;
3018 for (i = 0; i < C.getSize (); i++) {
3019 for (a = 0; a < arc->getSize (); a++) {
3021 j = i * G->getSize () * arc->getSize () + f * arc->getSize () + a;
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);
3038 return ga_circle_v_v (args);
3043 return ga_circle_v_v (args);
3053 c =
S->get (1, 1) -
conj (
S->get (0, 0)) * D;
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;
3063 for (i = 0, j = 0; i < C.getSize (); i++) {
3064 for (a = 0; a < arc->getSize (); a++, j++) {
3070 node * gen =
SOLVEE(2)->addGeneratedEquation (arc,
"Arcs");
3071 res->addPrepDependencies (
A(gen)->
result);
3078 return gp_circle_d_v (args);
3083 return gp_circle_d_v (args);
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;
3095 c =
S->get (1, 1) -
conj (
S->get (0, 0)) * D;
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;
3103 for (i = 0; i < C.getSize (); i++) {
3104 for (a = 0; a < arc->getSize (); a++) {
3106 j = i * G->getSize () * arc->getSize () + f * arc->getSize () + a;
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);
3123 return gp_circle_v_v (args);
3128 return gp_circle_v_v (args);
3137 node * gen =
arg->solvee->addGeneratedEquation (
V (
_ARES (i)),
"Versus");
3138 res->addPrepDependencies (
A(gen)->
result);
3150 node * gen =
arg->solvee->addGeneratedEquation (
V (
_ARES (i)),
"Versus");
3151 res->addPrepDependencies (
A(gen)->
result);
3163 strlist * deps =
_ARG(0)->collectDataDependencies ();
3164 if (!deps || deps->length () != 1) {
3170 nr_double_t
t,
diff = NR_MAX;
3171 for (idx = i = 0; i <
v->getSize (); i++) {
3172 t =
abs (
v->get (i) -
d);
3185 strlist * deps =
_ARG(0)->collectDataDependencies ();
3186 if (!deps || deps->length () != 1) {
3192 nr_double_t
t,
diff = NR_MAX;
3193 for (idx = i = 0; i <
v->getSize (); i++) {
3194 t =
abs (
v->get (i) - *
c);
3208 strlist * deps =
_ARG(0)->collectDataDependencies ();
3209 if (!deps || deps->length () != 1) {
3215 nr_double_t
t,
diff = NR_MAX;
3216 for (idx = i = 0; i < indep->
getSize (); i++) {
3230 strlist * deps =
_ARG(0)->collectDataDependencies ();
3231 if (!deps || deps->length () != 1) {
3237 nr_double_t
t,
diff = NR_MAX;
3238 for (idx = i = 0; i < indep->
getSize (); i++) {
3239 t =
abs (indep->
get (i) - *
c);
3253 strlist * deps =
_ARG(0)->collectDataDependencies ();
3254 if (!deps || deps->length () != 1) {
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)))) {
3275 strlist * deps =
_ARG(0)->collectDataDependencies ();
3276 if (!deps || deps->length () != 1) {
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)))) {
3297 strlist * deps =
_ARG(0)->collectDataDependencies ();
3298 if (!deps || deps->length () != 1) {
3305 for (k = i = 0; i < indep->
getSize (); i++) {
3306 if (
r->inside (
real (indep->
get (i)))) {
3311 _RETC (c / (nr_double_t) k);
3448 _RETD (v1->variance ());
3465 _RETD (v1->stddev ());
3594 if ((
x == 0) && (
y == 0)) {
3757 "larger or equal 1");
3769 "larger or equal 1");
3779 if (n < 1 || n >
x->getSize ()) {
3781 "larger or equal 1 and less or equal than the "
3782 "number of vector elements");
3805 for (
int i = 0;
i < v1->getSize ();
i++) v->
add (v1->get (
i) *
kBoverQ);
3816 nr_double_t sval = 0.0;
3822 for (i = 0; i <
size / 2; i++) {
3829 for (i = 0; i <
size / 2; i++) {
3831 v (
size - 1 - i) =
v (i);
3842 return kbd_d_d (args);
3851 _RETD (cond ? d1 : d2);
3867 _RETD (cond ? d1 : (b2 ? 1.0 : 0.0));
3875 _RETD (cond ? (
b1 ? 1.0 : 0.0) : d2);
3880 int t1 =
_ARG(1)->getType ();
3881 int t2 =
_ARG(2)->getType ();
3888 c1 =
B(
_ARES(1)) ? 1.0 : 0.0;
3894 c2 =
B(
_ARES(2)) ? 1.0 : 0.0;
3896 _RETC (cond ? c1 : c2);
3901 int t1 =
_ARG(1)->getType ();
3902 int t2 =
_ARG(2)->getType ();
3906 m1 = matrix (1); m1 (1,1) =
D(
_ARES(1));
break;
3908 m1 = matrix (1); m1 (1,1) = *
C(
_ARES(1));
break;
3910 m1 = matrix (1); m1 (1,1) =
B(
_ARES(1)) ? 1.0 : 0.0;
break;
3912 m1 = *
M(
_ARES(1));
break;
3916 m2 = matrix (1); m2 (0,0) =
D(
_ARES(2));
break;
3918 m2 = matrix (1); m2 (0,0) = *
C(
_ARES(2));
break;
3920 m2 = matrix (1); m2 (0,0) =
B(
_ARES(2)) ? 1.0 : 0.0;
break;
3922 m2 = *
M(
_ARES(2));
break;
3925 _RETM (cond ? m1 : m2);
3930 int t1 =
_ARG(1)->getType ();
3931 int t2 =
_ARG(2)->getType ();
3941 v1 = *
V(
_ARES(1));
break;
3951 v2 = *
V(
_ARES(2));
break;
3954 _RETV (cond ? v1 : v2);
3959 int t1 =
_ARG(1)->getType ();
3960 int t2 =
_ARG(2)->getType ();
3970 v1 = *
V(
_ARES(1));
break;
3980 v2 = *
V(
_ARES(2));
break;
3985 for (a = b = i = 0; i < cond->getSize (); i++) {
3986 v->
add (cond->get (i) != 0.0 ? v1 (a) : v2 (b));
3989 if (a >= v1.
getSize ()) a = 0;
3990 if (b >= v2.
getSize ()) b = 0;
4016 for (
int i = 0;
i < v1->getSize ();
i++) {
4017 v->
add (d0 < v1->
get (
i) ? 1.0 : 0.0);
4042 for (
int i = 0;
i < v1->getSize ();
i++) {
4043 v->
add (*c0 < v1->
get (
i) ? 1.0 : 0.0);
4054 for (
int i = 0;
i < v0->getSize ();
i++) {
4055 v->
add (
real (v0->get (
i)) < d1 ? 1.0 : 0.0);
4066 for (
int i = 0;
i < v0->getSize ();
i++) {
4067 v->
add (v0->get (
i) < *
c1 ? 1.0 : 0.0);
4078 for (
int i = 0;
i < v0->getSize ();
i++) {
4079 v->
add (v0->get (
i) < v1->get (
i) ? 1.0 : 0.0);
4105 for (
int i = 0;
i < v1->getSize ();
i++) {
4106 v->
add (d0 >
real (v1->get (
i)) ? 1.0 : 0.0);
4131 for (
int i = 0;
i < v1->getSize ();
i++) {
4132 v->
add (*c0 > v1->get (
i) ? 1.0 : 0.0);
4143 for (
int i = 0;
i < v0->getSize ();
i++) {
4144 v->
add (
real (v0->get (
i)) > d1 ? 1.0 : 0.0);
4155 for (
int i = 0;
i < v0->getSize ();
i++) {
4156 v->
add (v0->get (
i) > *
c1 ? 1.0 : 0.0);
4167 for (
int i = 0;
i < v0->getSize ();
i++) {
4168 v->
add (v0->get (
i) > v1->get (
i) ? 1.0 : 0.0);
4194 for (
int i = 0;
i < v1->getSize ();
i++) {
4195 v->
add (d0 <=
real (v1->get (
i)) ? 1.0 : 0.0);
4220 for (
int i = 0;
i < v1->getSize ();
i++) {
4221 v->
add (*c0 <= v1->
get (
i) ? 1.0 : 0.0);
4232 for (
int i = 0;
i < v0->getSize ();
i++) {
4233 v->
add (
real (v0->get (
i)) <= d1 ? 1.0 : 0.0);
4244 for (
int i = 0;
i < v0->getSize ();
i++) {
4245 v->
add (v0->get (
i) <= *
c1 ? 1.0 : 0.0);
4256 for (
int i = 0;
i < v0->getSize ();
i++) {
4257 v->
add (v0->get (
i) <= v1->get (
i) ? 1.0 : 0.0);
4283 for (
int i = 0;
i < v1->getSize ();
i++) {
4284 v->
add (d0 >=
real (v1->get (
i)) ? 1.0 : 0.0);
4309 for (
int i = 0;
i < v1->getSize ();
i++) {
4310 v->
add (*c0 >= v1->get (
i) ? 1.0 : 0.0);
4321 for (
int i = 0;
i < v0->getSize ();
i++) {
4322 v->
add (
real (v0->get (
i)) >= d1 ? 1.0 : 0.0);
4333 for (
int i = 0;
i < v0->getSize ();
i++) {
4334 v->
add (v0->get (
i) >= *
c1 ? 1.0 : 0.0);
4345 for (
int i = 0;
i < v0->getSize ();
i++) {
4346 v->
add (v0->get (
i) >= v1->get (
i) ? 1.0 : 0.0);
4372 for (
int i = 0;
i < v1->getSize ();
i++) {
4373 v->
add (d0 ==
real (v1->get (
i)) ? 1.0 : 0.0);
4398 for (
int i = 0;
i < v1->getSize ();
i++) {
4399 v->
add (*c0 == v1->get (
i) ? 1.0 : 0.0);
4410 for (
int i = 0;
i < v0->getSize ();
i++) {
4411 v->
add (
real (v0->get (
i)) == d1 ? 1.0 : 0.0);
4422 for (
int i = 0;
i < v0->getSize ();
i++) {
4423 v->
add (v0->get (
i) == *
c1 ? 1.0 : 0.0);
4434 for (
int i = 0;
i < v0->getSize ();
i++) {
4435 v->
add (v0->get (
i) == v1->get (
i) ? 1.0 : 0.0);
4468 for (
int i = 0;
i < v1->getSize ();
i++) {
4469 v->
add (d0 !=
real (v1->get (
i)) ? 1.0 : 0.0);
4494 for (
int i = 0;
i < v1->getSize ();
i++) {
4495 v->
add (*c0 != v1->get (
i) ? 1.0 : 0.0);
4506 for (
int i = 0;
i < v0->getSize ();
i++) {
4507 v->
add (
real (v0->get (
i)) != d1 ? 1.0 : 0.0);
4518 for (
int i = 0;
i < v0->getSize ();
i++) {
4519 v->
add (v0->get (
i) != *
c1 ? 1.0 : 0.0);
4530 for (
int i = 0;
i < v0->getSize ();
i++) {
4531 v->
add (v0->get (
i) != v1->get (
i) ? 1.0 : 0.0);
4570 _RETD (((nr_double_t) ::rand ()) / (nr_double_t) RAND_MAX);
4574 static int done = 0;
4578 unsigned int i0 = (
unsigned int) d0;
4611 for (
int i = 0;
i < v0->getSize ();
i++) {
4612 if( v0->get(
i) == 0.0 )
4642 for (
int i = 0;
i < v0->getSize ();
i++) {
4643 if( v0->get(
i) != 0.0 )
4657 switch (
arg->getType ()) {
4659 v->
add (*(c->
c));
break;
4661 v->
add (c->
d);
break;
4663 v->
add (c->
b ? 1.0 : 0.0);
break;
4665 v->
add (c->
v);
break;
4667 v->
add (0.0);
break;
4683 switch (
arg->getType ()) {
4685 v->
add (*(c->
c));
break;
4687 v->
add (c->
d);
break;
4689 v->
add (c->
b ? 1.0 : 0.0);
break;
4691 v->
add (c->
v);
break;
4693 if (c->
chr ==
';') {
4702 v->
add (0.0);
break;
4707 for (r = 0, c = 0, v = va; v != NULL; v = (::vector *) v->
getNext (), r++) {
4708 if (c < v->getSize ()) c = v->
getSize ();
4710 matrix * m =
new matrix (r, c);
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));
4717 vn = (::vector *) v->
getNext ();
4745 for (
int i = 0;
i < rlen;
i++) {
4752 node * gen =
SOLVEE(0)->addGeneratedEquation (rfeq,
"Frequency");
4753 res->addPrepDependencies (
A(gen)->
result);
static constant * log2_v(constant *)
static constant * power_d_c(constant *)
static constant * ifthenelse_c_c(constant *)
static constant * minus_v_d(constant *)
static constant * noise_circle_d(constant *)
static constant * over_mv_d(constant *)
static constant * plus_mv_m(constant *)
static constant * cumavg_v(constant *)
matrix inverse(matrix a)
Compute inverse matrix.
static constant * power_v_v(constant *)
static constant * sum_d(constant *)
static constant * plus_s_c(constant *)
std::complex< nr_double_t > nr_complex_t
#define FOURIER_HELPER_1(efunc, cfunc, isign, dep)
static constant * ytoz_mv(constant *)
static constant * lessorequal_d_c(constant *)
static constant * unwrap_v_1(constant *)
static constant * rms_d(constant *)
static void extract_vector(constant *, int, int &, int &, constant *)
static constant * arcosech_d(constant *)
static constant * over_c_d(constant *)
static constant * dB_mv(constant *)
static constant * minus_d_v(constant *)
static constant * rtoswr_v(constant *)
static constant * dB_c(constant *)
static constant * index_v_2(constant *)
static constant * integrate_d_d(constant *)
matrix adjoint(matrix a)
adjoint matrix
static constant * max_d(constant *)
matrix ytos(matrix y, qucs::vector z0)
Admittance matrix to scattering parameters.
static constant * rms_v(constant *)
static constant * noise_circle_v_v(constant *)
matrix real(matrix a)
Real part matrix.
matrix abs(matrix a)
Computes magnitude of each matrix element.
static constant * phase_d(constant *)
static constant * minus_v(constant *)
static constant * polar_d_c(constant *)
nr_complex_t erf(const nr_complex_t z)
Error function.
#define MAKE_FUNC_DEFINITION_1(cfunc)
static constant * times_c_d(constant *)
static constant * artanh_c(constant *)
static constant * ln_v(constant *)
#define M_LOG2E
Binary logartihm of Euler's constant ( )
static constant * xhypot_c_c(constant *)
static constant * ifthenelse_b_d(constant *)
static constant * greaterorequal_v_d(constant *)
static constant * det_mv(constant *)
#define MAKE_FUNC_DEFINITION_3(cfunc)
static constant * index_s_1(constant *)
matrix ytoz(matrix y)
Convert admittance matrix to impedance matrix.
static constant * transpose_mv(constant *)
static constant * length_c(constant *)
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...
static constant * minus_m(constant *)
static constant * arcsin_v(constant *)
static constant * max_v(constant *)
static constant * minus_m_d(constant *)
static constant * stddev_c(constant *)
static constant * sqrt_d(constant *)
static constant * twoport_mv(constant *)
static constant * phase_mv(constant *)
constant * getResult(int)
nr_complex_t coth(const nr_complex_t z)
Compute complex hyperbolic cotangent.
qucs::vector runavg(qucs::vector, const int)
static constant * modulo_d_v(constant *)
static constant * polar_v_d(constant *)
static constant * range_c_c(constant *)
static constant * greaterorequal_d_v(constant *)
static constant * arctan2_v_v(constant *)
static constant * plus_d(constant *)
static constant * bugon_v(constant *)
static constant * lessorequal_c_v(constant *)
nr_complex_t pow(const nr_complex_t z, const nr_double_t d)
Compute power function with real exponent.
static constant * cumsum_v(constant *)
matrix stos(matrix s, qucs::vector zref, qucs::vector z0)
S params to S params.
static constant * yn_d_d(constant *)
static constant * sec_v(constant *)
static constant * avg_d(constant *)
static constant * kbd_d(constant *)
static constant * stab_circle_s_d(constant *)
nr_complex_t cos(const nr_complex_t z)
Compute complex cosine.
static constant * dbm_v(constant *)
static constant * min_c_c(constant *)
static constant * greaterorequal_d_d(constant *)
static constant * greaterorequal_c_d(constant *)
static constant * times_mv_d(constant *)
static constant * times_d_v(constant *)
static constant * bugon_b(constant *)
static constant * phase_m(constant *)
static constant * stab_circle_s_v(constant *)
static constant * variance_d(constant *)
static constant * notequal_d_d(constant *)
static constant * plus_m(constant *)
static constant * min_d(constant *)
static constant * plus_d_v(constant *)
nr_complex_t step(const nr_complex_t z)
Heaviside step function for complex number.
#define FOURIER_HELPER_2(cfunc)
static constant * plus_d_c(constant *)
static constant * plus_m_mv(constant *)
static constant * w2dbm_v(constant *)
static constant * plus_d_mv(constant *)
static constant * range_c_d(constant *)
static constant * integrate_v_d(constant *)
nr_complex_t signum(const nr_complex_t z)
complex signum function
static constant * dbm_c_c(constant *)
static constant * greater_c_v(constant *)
static constant * det_m(constant *)
static constant * max_d_d(constant *)
static constant * norm_d(constant *)
static constant * stos_mv_v(constant *)
qucs::vector logspace(nr_double_t, nr_double_t, int)
static constant * plus_c_v(constant *)
static constant * times_m_d(constant *)
static constant * arccosec_d(constant *)
nr_complex_t atan(const nr_complex_t z)
Compute complex arc tangent.
static constant * notequal_c_v(constant *)
static constant * assert_d(constant *)
static constant * notequal_v_c(constant *)
static constant * times_c_c(constant *)
nr_complex_t cot(const nr_complex_t z)
Compute complex cotangent.
Global physical constants header file.
static constant * range_d_d(constant *)
static constant * ifthenelse_v_v_v(constant *)
nr_complex_t asech(const nr_complex_t z)
Compute complex argument hyperbolic secant.
static constant * stos_mv_d_d(constant *)
static constant * max_d_c(constant *)
static constant * cumprod_c(constant *)
static constant * notequal_b_b(constant *)
static constant * cumprod_v(constant *)
static constant * sec_c(constant *)
static constant * stos_mv_c(constant *)
static constant * times_c_v(constant *)
matrix twoport(matrix m, char in, char out)
Generic conversion matrix.
static constant * times_d_m(constant *)
static constant * ln_c(constant *)
static constant * runavg_d_d(constant *)
static constant * plus_c_s(constant *)
static constant * rtoswr_d(constant *)
static constant * prod_c(constant *)
static constant * ga_circle_v(constant *)
nr_double_t rollet(matrix)
static constant * lessorequal_c_c(constant *)
static constant * stab_circle_l(constant *)
static constant * gp_circle_v(constant *)
#define MAKE_FUNC_DEFINITION_0_QUCS(cfunc)
static constant * times_c_m(constant *)
static constant * less_d_c(constant *)
static constant * cumavg_d(constant *)
static constant * plus_mv_c(constant *)
#define _CHKMVA(mv, cond)
static constant * plus_v_mv(constant *)
static constant * minus_mv_m(constant *)
static constant * rollet_m(constant *)
static constant * xvalue_c(constant *)
static constant * log10_c(constant *)
static constant * stos_mv_d_c(constant *)
static constant * xhypot_v_c(constant *)
static constant * gp_circle_d(constant *)
static constant * notequal_d_c(constant *)
static constant * arcoth_c(constant *)
static constant * over_d_v(constant *)
nr_complex_t acot(const nr_complex_t z)
Compute complex arc cotangent.
static constant * plus_mv_d(constant *)
static constant * ga_circle_d_v(constant *)
static constant * yn_d_c(constant *)
static constant * max_r(constant *)
static constant * modulo_v_v(constant *)
static constant * gp_circle_d_v(constant *)
static constant * minus_mv_mv(constant *)
static constant * lessorequal_v_d(constant *)
static constant * ga_circle_d_d(constant *)
static constant * stos_m_c_d(constant *)
static constant * length_mv(constant *)
static constant * plus_s_s(constant *)
static const nr_double_t z0
static constant * over_d_c(constant *)
static constant * vt_c(constant *)
static constant * max_c(constant *)
nr_complex_t acosh(const nr_complex_t z)
Compute complex arc hyperbolic cosine.
static constant * dB_m(constant *)
static constant * phase_c(constant *)
static constant * cumavg_c(constant *)
nr_complex_t rtoz(const nr_complex_t r, nr_complex_t zref)
Converts reflexion coefficient to impedance.
static constant * power_m_d(constant *)
static constant * lessorequal_d_d(constant *)
static constant * arcsin_c(constant *)
static constant * arsech_v(constant *)
static constant * minus_d_m(constant *)
static constant * stos_m_d(constant *)
static constant * minus_c(constant *)
static constant * sum_c(constant *)
static constant * arctan2_d_v(constant *)
static constant * conj_mv(constant *)
static constant * cumprod_d(constant *)
static constant * arctan2_d_d(constant *)
static constant * rtoswr_c(constant *)
#define EQUATION_HAS_DEPS(v, n)
static constant * over_v_d(constant *)
static constant * xhypot_d_v(constant *)
static constant * times_v_mv(constant *)
nr_complex_t sign(const nr_complex_t z)
complex sign function
static constant * arcsec_v(constant *)
static constant * polar_d_d(constant *)
static constant * arsech_c(constant *)
#define CIRCLE_HELPER_A()
nr_complex_t asinh(const nr_complex_t z)
Compute complex arc hyperbolic sine.
nr_complex_t cosh(const nr_complex_t z)
Compute complex hyperbolic cosine.
static constant * kbd_d_d(constant *)
static constant * arcosech_v(constant *)
static constant * times_v_c(constant *)
static constant * dbm_d_d(constant *)
static constant * arccosec_v(constant *)
static constant * dbm_d(constant *)
static constant * norm_c(constant *)
static constant * rollet_mv(constant *)
static constant * and_b_b(constant *)
static constant * integrate_c_c(constant *)
nr_complex_t sqr(const nr_complex_t z)
Square of complex number.
static constant * dbm_c(constant *)
static constant * over_mv_c(constant *)
#define M_PI_2
Half of Archimedes' constant ( )
static constant * stos_m_c_c(constant *)
matrix imag(matrix a)
Imaginary part matrix.
static constant * matrix_x(constant *)
static constant * modulo_d_d(constant *)
static constant * arsinh_c(constant *)
static constant * dbm_c_d(constant *)
static constant * rad2deg_v(constant *)
nr_complex_t fix(const nr_complex_t z)
Complex fix.
static constant * stos_m_d_c(constant *)
nr_complex_t sqrt(const nr_complex_t z)
Compute principal value of square root.
static constant * stos_mv_c_v(constant *)
static constant * minus_m_c(constant *)
static constant * power_mv_d(constant *)
static constant * artanh_d(constant *)
static constant * index_mv_2(constant *)
static constant * stos_m_v_d(constant *)
static constant * minus_d(constant *)
nr_double_t xhypot(const nr_complex_t a, const nr_complex_t b)
Euclidean distance function for complex argument.
static constant * dbm2w_v(constant *)
static constant * times_v_v(constant *)
static constant * xhypot_v_v(constant *)
static constant * equal_v_c(constant *)
static constant * plus_c_d(constant *)
matrix stoy(matrix s, qucs::vector z0)
Scattering parameters to admittance matrix.
static constant * ifthenelse_b_b(constant *)
nr_complex_t acos(const nr_complex_t z)
Compute complex arc cosine.
static constant * assert_v(constant *)
static constant * times_d_d(constant *)
nr_complex_t log2(const nr_complex_t z)
Compute principal value of binary logarithm of z.
static constant * less_c_d(constant *)
static constant * plus_m_d(constant *)
static constant * plus_v_c(constant *)
nr_complex_t fmod(const nr_complex_t x, const nr_complex_t y)
Complex fmod Apply fmod to the complex z.
static constant * minus_c_d(constant *)
static constant * minus_d_c(constant *)
static constant * noise_circle_v_d(constant *)
static constant * less_v_d(constant *)
static constant * minus_v_v(constant *)
static constant * equal_v_d(constant *)
static constant * stab_circle_l_d(constant *)
nr_complex_t cosech(const nr_complex_t z)
Compute complex argument hyperbolic cosec.
static constant * plot_vs_v(constant *)
static constant * notequal_d_v(constant *)
static constant * plus_d_d(constant *)
nr_complex_t yn(const int n, const nr_complex_t z)
Bessel function of second kind.
nr_complex_t tanh(const nr_complex_t z)
Compute complex hyperbolic tangent.
nr_complex_t sin(const nr_complex_t z)
Compute complex sine.
static constant * conj_d(constant *)
static constant * mu2_mv(constant *)
static constant * bugon_d(constant *)
static constant * xhypot_c_v(constant *)
nr_complex_t ztor(const nr_complex_t z, nr_complex_t zref)
Converts impedance to reflexion coefficient.
static constant * lessorequal_v_c(constant *)
static constant * ifthenelse_d_b(constant *)
static constant * less_d_d(constant *)
static constant * greaterorequal_d_c(constant *)
static constant * polar_c_c(constant *)
#define kBoverQ
Boltzmann constant over Elementary charge ( )
nr_double_t dB(const nr_complex_t z)
Magnitude in dB Compute .
static constant * variance_c(constant *)
qucs::vector * receiver(nr_double_t *, nr_double_t, int)
static constant * diff_v_2(constant *)
matrix ztos(matrix z, qucs::vector z0)
Convert impedance matrix scattering parameters.
static constant * arcosh_d(constant *)
static constant * not_b(constant *)
static constant * greater_c_d(constant *)
static constant * notequal_c_d(constant *)
static constant * equal_c_c(constant *)
static constant * ztoy_mv(constant *)
static constant * arg_v(constant *)
static constant * equal_c_v(constant *)
nr_complex_t asin(const nr_complex_t z)
Compute complex arc sine.
static constant * less_c_v(constant *)
static constant * cosec_c(constant *)
static constant * minus_m_m(constant *)
static constant * yvalue_d(constant *)
static constant * times_mv_mv(constant *)
static constant * length_v(constant *)
static constant * stddev_d(constant *)
static constant * minus_c_c(constant *)
static constant * yn_d_v(constant *)
static constant * cumsum_c(constant *)
static constant * log10_d(constant *)
nr_complex_t acoth(const nr_complex_t z)
Compute complex argument hyperbolic cotangent.
static constant * less_v_v(constant *)
static constant * diff_v_3(constant *)
static constant * stos_mv_d_v(constant *)
qucs::vector linspace(nr_double_t, nr_double_t, int)
static constant * min_c_d(constant *)
static constant * avg_v(constant *)
static constant * polar_d_v(constant *)
static constant * twoport_m(constant *)
static constant * dbm_d_c(constant *)
static constant * assert_b(constant *)
static constant * interpolate_v_v_d(constant *)
void set(nr_double_t, int)
static constant * xhypot_d_d(constant *)
static constant * greaterorequal_c_c(constant *)
static constant * lessorequal_d_v(constant *)
static constant * sqrt_v(constant *)
static constant * cosec_d(constant *)
static constant * min_v(constant *)
static constant * dbm2w_c(constant *)
static constant * arg_d(constant *)
static constant * times_d_c(constant *)
static constant * inverse_mv(constant *)
static constant * polar_c_v(constant *)
static constant * stab_circle_l_v(constant *)
static constant * inverse_m(constant *)
nr_complex_t log10(const nr_complex_t z)
Compute principal value of decimal logarithm of z.
static constant * stos_mv_v_v(constant *)
nr_complex_t floor(const nr_complex_t z)
Complex floor.
nr_complex_t det(matrix a)
Compute determinant of the given matrix.
static constant * log10_v(constant *)
nr_complex_t sech(const nr_complex_t z)
Compute complex hyperbolic secant.
static constant * index_mv_1(constant *)
static constant * arcosh_v(constant *)
nr_complex_t integrate(vector v, const nr_complex_t)
static constant * greater_d_v(constant *)
nr_complex_t erfc(const nr_complex_t z)
Complementart error function.
#define M_PI
Archimedes' constant ( )
static constant * arcoth_d(constant *)
static constant * over_d_d(constant *)
static constant * w2dbm_c(constant *)
static constant * jn_d_c(constant *)
matrix transpose(matrix a)
Matrix transposition.
static constant * over_mv_v(constant *)
Dense matrix class header file.
static constant * greater_v_v(constant *)
static constant * dbm_v_d(constant *)
static constant * arcsec_c(constant *)
static constant * stos_mv_d(constant *)
nr_complex_t ytor(const nr_complex_t y, nr_complex_t zref)
Converts admittance to reflexion coefficient.
static constant * runavg_v_d(constant *)
static constant * arcosech_c(constant *)
The circuit class header file.
static constant * times_m_m(constant *)
static constant * arccot_d(constant *)
nr_complex_t erfinv(const nr_complex_t z)
Inverse of error function.
static constant * b1_mv(constant *)
static constant * plus_v(constant *)
#define MAKE_FUNC_DEFINITION_0_SPECIAL(cfunc)
static constant * w2dbm_d(constant *)
static constant * arccos_v(constant *)
#define rad(x)
Convert degree to radian.
static constant * minus_c_mv(constant *)
static constant * plus_c(constant *)
static constant * arcsec_d(constant *)
vector diff(vector, vector, int n=1)
static constant * arccosec_c(constant *)
static constant * over_m_c(constant *)
#define THROW_MATH_EXCEPTION(txt)
nr_complex_t rtoy(const nr_complex_t r, nr_complex_t zref)
Converts reflexion coefficient to admittance.
static constant * ln_d(constant *)
nr_complex_t i0(const nr_complex_t z)
Modified Bessel function of first kind.
static constant * ga_circle_v_d(constant *)
static constant * plot_vs_mv(constant *)
nr_complex_t atan2(const nr_complex_t y, const nr_complex_t x)
Compute complex arc tangent fortran like function.
static constant * plus_m_c(constant *)
static constant * dB_d(constant *)
static constant * range_d_c(constant *)
static constant * vt_d(constant *)
static constant * power_v_d(constant *)
static constant * minus_mv_v(constant *)
static constant * plus_m_m(constant *)
static constant * conj_v(constant *)
static constant * minus_d_mv(constant *)
static constant * eye_m(constant *)
static constant * modulo_v_c(constant *)
static constant * runavg_c_d(constant *)
#define MIN(x, y)
Minimum of x and y.
static constant * minus_c_v(constant *)
static constant * polar_v_v(constant *)
static constant * ifthenelse_d_d(constant *)
static constant * sqr_m(constant *)
static constant * plus_c_mv(constant *)
static constant * arccot_v(constant *)
static constant * lessorequal_c_d(constant *)
static constant * receiver_v_v(constant *)
static constant * arsinh_d(constant *)
nr_complex_t sinc(const nr_complex_t z)
Cardinal sine.
static constant * modulo_c_c(constant *)
static constant * cosec_v(constant *)
static constant * over_c_c(constant *)
static constant * lessorequal_v_v(constant *)
static constant * minus_mv_c(constant *)
static constant * equal_d_d(constant *)
static constant * arg_mv(constant *)
static constant * vector_x(constant *)
static constant * ga_circle_d(constant *)
nr_complex_t erfcinv(const nr_complex_t z)
Inverse of complementart error function.
static constant * noise_circle_v(constant *)
static constant * rand(constant *)
static constant * times_mv_v(constant *)
static constant * arctan_v(constant *)
static constant * minus_mv_d(constant *)
static constant * or_b_b(constant *)
static constant * xhypot_v_d(constant *)
static constant * arsech_d(constant *)
static constant * deg2rad_c(constant *)
nr_complex_t limexp(const nr_complex_t z)
Compute limited complex exponential.
matrix stoz(matrix s, qucs::vector z0)
Scattering parameters to impedance matrix.
static constant * equal_c_d(constant *)
static constant * sqr_mv(constant *)
void addDropDependencies(char *)
static constant * minus_mv(constant *)
nr_double_t norm(const nr_complex_t z)
Compute euclidian norm of complex number.
static constant * modulo_d_c(constant *)
static constant * greater_v_d(constant *)
nr_complex_t sinh(const nr_complex_t z)
Compute complex hyperbolic sine.
static constant * times_d_mv(constant *)
static constant * plus_c_c(constant *)
static constant * max_c_d(constant *)
static constant * power_v_c(constant *)
static constant * xvalue_d(constant *)
static constant * power_c_d(constant *)
#define MAKE_FUNC_DEFINITION_0(cfunc)
static constant * min_c(constant *)
static constant * dbm_v_c(constant *)
static constant * min_d_d(constant *)
static constant * length_d(constant *)
static constant * ztoy_m(constant *)
static constant * minus_v_c(constant *)
static constant * artanh_v(constant *)
static constant * polar_v_c(constant *)
static constant * ifthenelse_m_m(constant *)
static constant * plus_v_v(constant *)
static constant * rad2deg_d(constant *)
nr_complex_t jn(const int n, const nr_complex_t z)
Bessel function of first kind.
static constant * vt_v(constant *)
static constant * less_d_v(constant *)
static constant * length_m(constant *)
static constant * xhypot_c_d(constant *)
static constant * greater_d_c(constant *)
static constant * mu1_mv(constant *)
static constant * over_v_c(constant *)
static constant * conj_m(constant *)
static constant * stos_m_c_v(constant *)
#define deg(x)
Convert radian to degree.
static constant * stos_mv_c_d(constant *)
static constant * modulo_c_d(constant *)
static constant * plus_mv_v(constant *)
static constant * power_mv_c(constant *)
static constant * power_d_d(constant *)
static constant * sec_d(constant *)
nr_complex_t tan(const nr_complex_t z)
Compute complex tangent.
static constant * stos_m_c(constant *)
static constant * gp_circle_d_d(constant *)
static constant * equal_b_b(constant *)
static constant * sum_v(constant *)
matrix eye(int rs, int cs)
Create identity matrix with specified number of rows and columns.
static constant * plus_mv(constant *)
nr_complex_t exp(const nr_complex_t z)
Compute complex exponential.
qucs::vector fftshift(qucs::vector)
static constant * power_c_v(constant *)
static constant * over_c_v(constant *)
static constant * stos_m_d_d(constant *)
static constant * arctan2_v_d(constant *)
static constant * phase_v(constant *)
static constant * b1_m(constant *)
static constant * stos_mv_c_c(constant *)
static constant * noise_circle_d_d(constant *)
static constant * less_v_c(constant *)
static constant * minus_d_d(constant *)
static constant * arcosh_c(constant *)
static constant * integrate_v_c(constant *)
static constant * min_d_c(constant *)
static constant * notequal_c_c(constant *)
static constant * times_mv_c(constant *)
static constant * plus_v_d(constant *)
#define M_LOG10E
Decimal logartihm of Euler's constant ( )
static constant * unwrap_v_2(constant *)
nr_complex_t polar(const nr_double_t mag, const nr_double_t ang)
Construct a complex number using polar notation.
static constant * equal_v_v(constant *)
matrix conj(matrix a)
Conjugate complex matrix.
static constant * arctan_d(constant *)
static constant * xhypot_d_c(constant *)
static constant * plus_c_m(constant *)
nr_complex_t prod(vector)
static constant * modulo_c_v(constant *)
static constant * avg_c(constant *)
static constant * transpose_m(constant *)
static constant * ga_circle_v_v(constant *)
static constant * times_mv_m(constant *)
static constant * conj_c(constant *)
static constant * jn_d_v(constant *)
static constant * arsinh_v(constant *)
static constant * times_c_mv(constant *)
static constant * stos_m_d_v(constant *)
static constant * stos_mv_v_c(constant *)
static constant * mu1_m(constant *)
static constant * norm_v(constant *)
static constant * power_d_v(constant *)
static constant * yvalue_c(constant *)
static constant * arg_c(constant *)
static constant * minus_m_mv(constant *)
#define MAKE_FUNC_DEFINITION_2(cfunc)
static constant * dB_v(constant *)
static constant * deg2rad_d(constant *)
static constant * srand_d(constant *)
static constant * over_m_d(constant *)
static constant * min_r(constant *)
static constant * ytoz_m(constant *)
static constant * gp_circle_v_d(constant *)
#define CIRCLE_HELPER_D(argi)
vector dbm(vector, const nr_complex_t z=50.0)
static constant * fftshift_v(constant *)
static constant * modulo_v_d(constant *)
static constant * arcoth_v(constant *)
static constant * times_m_mv(constant *)
static constant * cumsum_d(constant *)
static constant * prod_v(constant *)
static constant * avg_r(constant *)
static constant * equal_d_c(constant *)
static constant * less_c_c(constant *)
nr_complex_t log(const nr_complex_t z)
Compute principal value of natural logarithm of z.
static constant * stos_m_v(constant *)
static constant * cot_d(constant *)
static constant * notequal_v_v(constant *)
static constant * cot_c(constant *)
static constant * greaterorequal_c_v(constant *)
static constant * variance_v(constant *)
matrix ztoy(matrix z)
impedance matrix to admittance matrix.
static constant * notequal_v_d(constant *)
static constant * greaterorequal_v_c(constant *)
static constant * plus_d_m(constant *)
static constant * times_m_c(constant *)
static constant * jn_d_d(constant *)
static constant * sqrt_c(constant *)
static constant * power_m_c(constant *)
static constant * adjoint_m(constant *)
static constant * equal_d_v(constant *)
static constant * arccos_c(constant *)
static constant * stos_mv_v_d(constant *)
static constant * minus_v_mv(constant *)
nr_complex_t round(const nr_complex_t z)
Complex round Round is the nearest integral value Apply round to real and imaginary part...
static constant * interpolate_v_v(constant *)
static constant * arctan_c(constant *)
static constant * greater_c_c(constant *)
static constant * log2_c(constant *)
static constant * plus_mv_mv(constant *)
#define INTERPOL_HELPER()
static constant * mu2_m(constant *)
static constant * deg2rad_v(constant *)
constant * evaluate(void)
static constant * minus_c_m(constant *)
static constant * max_c_c(constant *)
static constant * greater_v_c(constant *)
static constant * cot_v(constant *)
static constant * ifthenelse_v_v(constant *)
static constant * log2_d(constant *)
static constant * noise_circle_d_v(constant *)
static constant * unwrap_v_3(constant *)
nr_double_t i0(nr_double_t)
static constant * stos_m_v_c(constant *)
static constant * stab_circle_s(constant *)
static constant * power_c_c(constant *)
matrix arg(matrix a)
Computes the argument of each matrix element.
static constant * linspace(constant *)
static constant * greaterorequal_v_v(constant *)
static constant * stddev_v(constant *)
static constant * stos_m_v_v(constant *)
static constant * arccos_d(constant *)
static constant * logspace(constant *)
static constant * adjoint_mv(constant *)
static constant * greater_d_d(constant *)
static constant * arg_m(constant *)
static constant * rad2deg_c(constant *)
static constant * power_mv_v(constant *)
static constant * index_v_1(constant *)
static constant * arccot_c(constant *)
#define MAKE_FUNC_DEFINITION_0_STD(cfunc)
static constant * arcsin_d(constant *)
static constant * prod_d(constant *)
nr_complex_t atanh(const nr_complex_t z)
Compute complex arc hyperbolic tangent.
static constant * index_m_2(constant *)
static constant * dbm2w_d(constant *)
static constant * times_v_d(constant *)
vector unwrap(vector, nr_double_t tol=M_PI, nr_double_t step=2 *M_PI)
static constant * polar_c_d(constant *)
static constant * rms_c(constant *)
#define MAX(x, y)
Maximum of x and y.
static constant * over_v_v(constant *)
static constant * gp_circle_v_v(constant *)