Commit Graph

276 Commits

Author SHA1 Message Date
dwarning 9289f0f773 proper initialization of b magnitude coefficient in a special case 2018-11-18 15:54:08 +01:00
dwarning 76c43ab512 using the native tan and tanh math functions for real vector calculation 2018-10-13 18:18:47 +02:00
Holger Vogt b0e7962169 don't generate error message during transient analysis,
it will not be used
2018-09-02 18:04:42 +02:00
Holger Vogt f2cfb9b359 add fourth parameter to cp_getvar() 2018-07-22 15:15:10 +02:00
Holger Vogt 2786fcb86e New .option seed=[val|random] 2018-07-22 15:11:44 +02:00
Holger Vogt 7ca61b3c98 New command 'setseed' with function com_sseed
to set the random number generator
2018-07-22 15:06:19 +02:00
Holger Vogt 09c876550f prevent string overflow by adding the string length
to the cp_getvar parameters. Used only with CP_STRING
2018-07-22 14:57:49 +02:00
Holger Vogt a98d01e5f8 Use only internal memory functions, replace
free->tfree, malloc->tmalloc, realloc->trealloc
2018-07-21 23:54:43 +02:00
rlar caf3115733 cleanup, emphasise CKTrhs being an array
when accessing slot [0]
2018-01-29 19:51:13 +01:00
rlar c900cc8824 drop ngspice internal implementation of erfc()
which these days is guaranteed to be provided by <math.h>

note,
  our own implementation was incorrect anyway.
  it evaluated to
    erfc_ngspice(x) = erfc(fabs(x))
2017-10-28 12:38:32 +02:00
dwarning b8a9ca9df4 correct the fft scaling for real input and complex output vector 2017-08-16 21:35:41 +02:00
rlar d696aa8781 niconv.c, NIconvTest(), NaN in CKTrhs denotes non-convergence
emit a warning message, but only if ft_ngdebug is set
2017-03-19 20:38:41 +01:00
Francesco Lannutti 43f24d6f22 rewrite cktsens.c in terms of the 'SMP' matrix interface 2017-03-17 18:22:36 +01:00
rlar fb4f462388 SMPnewMatrix(), add 'size' to the function arguments 2017-03-17 18:12:48 +01:00
rlar 3a9ace82bb winmain.c, etc, cleanup, rewrite obfuscated symbols
substitute in the whole source code:

  "__stream"       -->    "stream"
  "__pos"          -->    "pos"
  "__s"            -->    "s"
  "__n"            -->    "n"
  "__c"            -->    "c"
  "__format"       -->    "format"
  "__ptr"          -->    "ptr"
  "__size"         -->    "size"
  "__path"         -->    "path"
  "__mode"         -->    "mode"
  "__offset"       -->    "offset"
  "__whence"       -->    "whence"
  "__arglist"      -->    "arglist"
  "__buf"          -->    "buf"
  "__fp"           -->    "fp"

  "f_c_l_o_s_e"    -->    "win_x_fclose"
  "f_e_o_f"        -->    "win_x_feof"
  "f_e_r_r_o_r"    -->    "win_x_ferror"
  "f_f_l_u_s_h"    -->    "win_x_fflush"
  "fg_e_t_c"       -->    "win_x_fgetc"
  "f_g_e_t_p_o_s"  -->    "win_x_fgetpos"
  "fg_e_t_s"       -->    "win_x_fgets"
  "fp_r_i_n_t_f"   -->    "win_x_fprintf"
  "fp_u_t_c"       -->    "win_x_fputc"
  "fp_u_t_char"    -->    "win_x_fputchar"
  "fp_u_t_s"       -->    "win_x_fputs"
  "f_r_e_a_d"      -->    "win_x_fread"
  "f_r_e_o_p_e_n"  -->    "win_x_freopen"
  "fs_c_a_n_f"     -->    "win_x_fscanf"
  "f_s_e_e_k"      -->    "win_x_fseek"
  "f_s_e_t_p_o_s"  -->    "win_x_fsetpos"
  "f_t_e_l_l"      -->    "win_x_ftell"
  "f_w_r_i_t_e"    -->    "win_x_fwrite"
  "g_e_t_c"        -->    "win_x_getc"
  "g_e_t_char"     -->    "win_x_getchar"
  "g_e_t_s"        -->    "win_x_gets"
  "p_e_r_r_o_r"    -->    "win_x_perror"
  "p_r_i_n_t_f"    -->    "win_x_printf"
  "p_u_t_c"        -->    "win_x_putc"
  "p_u_t_char"     -->    "win_x_putchar"
  "p_u_t_s"        -->    "win_x_puts"
  "r_e_a_d"        -->    "win_x_read"
  "s_c_a_n_f"      -->    "win_x_scanf"
  "ung_e_t_c"      -->    "win_x_ungetc"
  "vfp_r_i_n_t_f"  -->    "win_x_vfprintf"
  "vfs_c_a_n_f"    -->    "win_x_vfscanf"
  "vp_r_i_n_t_f"   -->    "win_x_vprintf"
  "vs_c_a_n_f"     -->    "win_x_vscanf"
2017-02-10 19:50:42 +01:00
rlar ea5ad6b0e7 drop DC_ABS() and FTEcabs() 2016-10-15 15:06:18 +02:00
rlar 15f2c67968 use M_PI 2016-10-15 15:06:17 +02:00
h_vogt ae80067fef cmath2.c, new function stddev to calculate the standard deviation of all elements of a vector 2016-10-15 15:06:17 +02:00
h_vogt 594db31ebc cmath2.c, whitespace cleanup 2016-10-15 15:06:17 +02:00
rlar b8b6677b85 cmath2.c, drop some excess NG_IGNORE() 2016-10-15 15:06:17 +02:00
h_vogt 2ab3b82696 cmath2.c, cleanup 2016-10-15 15:06:17 +02:00
rlar 2e35329678 cmath2.c, cleanup min/max operations 2016-10-15 15:06:16 +02:00
h_vogt 9f62057973 introduce include file "ngspice/randnumb.h" 2016-08-15 11:30:26 +02:00
rlar a5817192e1 ni/niiter.c, #5/5, whitespace 2016-07-30 21:03:55 +02:00
rlar 266e6da24b ni/niiter.c, #4/5, cleanup 2016-07-30 21:03:49 +02:00
rlar dda415a0e3 ni/niiter.c, #3/5, use `copy()' 2016-07-30 21:03:29 +02:00
rlar 86bb88b546 ni/niiter.c, #2/5, reduce scope 2016-07-30 21:03:19 +02:00
rlar 2978621931 ni/niiter.c, #1/5, cleanup 2016-07-30 21:03:00 +02:00
rlar 5b42d09618 unify, use memcpy for CKTstate copy operations 2016-07-30 21:00:29 +02:00
rlar d298d5cc2f use memset() instead of deprecated bzero() 2016-07-30 20:58:33 +02:00
rlar 141ed61ec8 use memcpy() instead of deprecated bcopy() 2016-07-30 20:58:19 +02:00
h_vogt fca8ab3146 cmath4.c, cx_deriv(), remove a memory leak 2016-07-20 18:09:18 +02:00
rlar 994bec7859 declare free() / realloc() arguments `const void *'
to avoid extra casting when freeing `const' strings
2016-07-17 11:19:34 +02:00
h_vogt f66e76fb5f implement option 'xmu' to control trapezoidal integration method
default is 0.5

option xmu=0.49
  can be used to add some damping to reduce trap ringing

set xmu=0.49
  or
.option xmu=0.49
  works as well
2016-07-16 15:21:27 +02:00
rlar 40a0cea0d2 swap some `SWAP' arguments for readability 2016-03-22 15:23:05 +01:00
rlar bd0bc3038b use `SWAP' macro 2016-03-22 13:04:13 +01:00
rlar b36385e333 improve `SWAP' macro 2016-03-22 13:03:59 +01:00
rlar 6342bec8ec everywhere, drop `MALLOC()' and `REALLOC()' 2016-03-21 21:22:15 +01:00
rlar 9d32a0a5a9 simplify complex assignments 2015-12-29 18:15:06 +01:00
rlar 8243696338 dvec abstraction, #8/11, upgrade `dvec_alloc()' 2015-12-28 20:34:42 +01:00
rlar 8a4a37b5bb dvec abstraction, #4/11, emphasise `ZERO(dvec)' initialisation 2015-12-28 20:34:42 +01:00
rlar 908c650f72 dvec abstraction, #3/11, use `dvec_alloc()' 2015-12-28 20:34:42 +01:00
rlar 19e427e3a5 cleanup, use NULL instead of 0 in pointer context 2015-05-02 10:24:49 +02:00
rlar d98c5c90f3 src/maths/cmaths/cmath4.c, bug fix, cx_fft, cx_ifft, cx_derive
incorrect check for VF_COMPLEX in field v_type instead of v_flags
2015-03-10 20:09:20 +01:00
rlar 8e65614d31 spfactor.c, cktnames.c, don't crash when simulating "nothing"
reported by Siddhant Saraf in
> [ngspice:discussion] "out of memory" error : simulating a 2bit AND gate"

This comes in two flavours,
   1) an empty circuit
   2) a xspice circuit with exclusively xspice event nodes
2015-02-08 22:07:14 +01:00
rlar c5e0bcde04 cleanup using `hypot()' 2014-12-06 20:41:11 +01:00
rlar c6a8429258 src/maths/cmaths, implement `nint()' (.control language) 2014-09-20 17:15:10 +02:00
rlar 99eade8ec9 cleanup, rename cx_ln --> cx_log (.control language) 2014-09-12 19:09:52 +02:00
rlar c926f46986 cleanup, rename rename cx_log --> cx_log10 (.control language) 2014-09-12 19:09:42 +02:00
rlar 4049e8ec1f rewrite, using IFerrorf() 2014-04-04 21:58:08 +02:00