Browse Source

introduce include file "ngspice/randnumb.h"

pre-master-46
h_vogt 10 years ago
committed by rlar
parent
commit
9f62057973
  1. 1
      src/frontend/inp.c
  2. 3
      src/frontend/numparam/xpressn.c
  3. 6
      src/frontend/trannoise/wallace.c
  4. 6
      src/include/ngspice/1-f-code.h
  5. 2
      src/include/ngspice/fteext.h
  6. 17
      src/include/ngspice/randnumb.h
  7. 2
      src/include/ngspice/wallace.h
  8. 3
      src/main.c
  9. 8
      src/maths/cmaths/cmath2.c
  10. 8
      src/maths/misc/randnumb.c
  11. 2
      src/sharedspice.c
  12. 1
      src/tclspice.c
  13. 1
      visualc/sharedspice.vcxproj
  14. 1
      visualc/vngspice-fftw.vcxproj
  15. 1
      visualc/vngspice.vcxproj

1
src/frontend/inp.c

@ -40,6 +40,7 @@ Author: 1985 Wayne A. Christopher
#include "numparam/numpaif.h" #include "numparam/numpaif.h"
#include "ngspice/stringskip.h" #include "ngspice/stringskip.h"
#include "ngspice/randnumb.h"
#define line_free(line, flag) \ #define line_free(line, flag) \

3
src/frontend/numparam/xpressn.c

@ -16,8 +16,7 @@
/* random numbers in /maths/misc/randnumb.c */ /* random numbers in /maths/misc/randnumb.c */
extern double gauss0(void);
extern double drand(void);
#include "ngspice/randnumb.h"
/************ keywords ************/ /************ keywords ************/

6
src/frontend/trannoise/wallace.c

@ -20,6 +20,7 @@
#include <math.h> #include <math.h>
#include "ngspice/wallace.h" #include "ngspice/wallace.h"
#include "ngspice/FastNorm3.h" #include "ngspice/FastNorm3.h"
#include "ngspice/randnumb.h"
#define POOLSIZE 4096 #define POOLSIZE 4096
#define LPOOLSIZE 12 #define LPOOLSIZE 12
@ -42,11 +43,6 @@ static unsigned n = POOLSIZE;
static double chi1, chi2; /* chi^2 correction values */ static double chi1, chi2; /* chi^2 correction values */
static unsigned int newpools; static unsigned int newpools;
extern double drand(void);
extern unsigned int CombLCGTausInt(void);
extern void TausSeed(void);
extern unsigned int CombLCGTausInt2(void);
void void
PolarGauss(double* py1, double* py2) PolarGauss(double* py1, double* py2)

6
src/include/ngspice/1-f-code.h

@ -1,8 +1,4 @@
extern double drand(void);
extern double exprand(double);
extern int poisson(double);
extern double gauss0(void);
#include "ngspice/randnumb.h"
void f_alpha(int n_pts, int n_exp, double X[], double Q_d, void f_alpha(int n_pts, int n_exp, double X[], double Q_d,
double alpha); double alpha);

2
src/include/ngspice/fteext.h

@ -277,8 +277,6 @@ extern struct plot *raw_read(char *name);
extern bool do_measure(char *what, bool chk_only); extern bool do_measure(char *what, bool chk_only);
extern bool check_autostop(char *what); extern bool check_autostop(char *what);
/* randnumb.c */
extern void TausSeed(void);
/* resource.c */ /* resource.c */
extern void ft_ckspace(void); extern void ft_ckspace(void);

17
src/include/ngspice/randnumb.h

@ -0,0 +1,17 @@
#ifndef ngspice_RANDNUMB_H
#define ngspice_RANDNUMB_H
/* initialize random number generators */
extern void initw(void);
extern void checkseed(void); /* seed random or set by 'set rndseed=value'*/
extern double drand(void);
extern double gauss0(void);
extern int poisson(double);
extern double exprand(double);
extern void TausSeed(void);
extern unsigned int CombLCGTausInt(void);
extern unsigned int CombLCGTausInt2(void);
#endif

2
src/include/ngspice/wallace.h

@ -17,6 +17,4 @@ double NewWa(void); /* generate new pool, return outgauss[0] */
#define GaussWa ((--variate_used)?(outgauss[variate_used]*ScaleGauss):NewWa()) #define GaussWa ((--variate_used)?(outgauss[variate_used]*ScaleGauss):NewWa())
void initw(void); /* initialization of Wallace generator */
void PolarGauss(double* py1, double* py2); void PolarGauss(double* py1, double* py2);

3
src/main.c

@ -52,6 +52,7 @@ extern int rl_catch_signals; /* missing from editline/readline.h */
#include "frontend/signal_handler.h" #include "frontend/signal_handler.h"
#include "frontend/misccoms.h" #include "frontend/misccoms.h"
#include "ngspice/compatmode.h" #include "ngspice/compatmode.h"
#include "ngspice/randnumb.h"
/* saj xspice headers */ /* saj xspice headers */
#ifdef XSPICE #ifdef XSPICE
@ -205,8 +206,6 @@ extern void OUTerrorf(int, const char *fmt, ...);
extern int OUTattributes(runDesc *, IFuid, int, IFvalue *); extern int OUTattributes(runDesc *, IFuid, int, IFvalue *);
extern void initw(void);
IFfrontEnd nutmeginfo = { IFfrontEnd nutmeginfo = {
IFnewUid, IFnewUid,
IFdelUid, IFdelUid,

8
src/maths/cmaths/cmath2.c

@ -18,18 +18,12 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "ngspice/cpdefs.h" #include "ngspice/cpdefs.h"
#include "ngspice/dvec.h" #include "ngspice/dvec.h"
#include "ngspice/randnumb.h"
#include "cmath.h" #include "cmath.h"
#include "cmath2.h" #include "cmath2.h"
extern void checkseed(void); /* seed random or set by 'set rndseed=value'*/
extern double drand(void); /* from randnumb.c */
extern double gauss0(void); /* from randnumb.c */
extern int poisson(double); /* from randnumb.c */
extern double exprand(double); /* from randnumb.c */
static double static double
cx_max_local(void *data, short int type, int length) cx_max_local(void *data, short int type, int length)
{ {

8
src/maths/misc/randnumb.c

@ -39,6 +39,7 @@ Copyright 2008 Holger Vogt
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "ngspice/cpdefs.h" #include "ngspice/cpdefs.h"
#include "ngspice/ftedefs.h" #include "ngspice/ftedefs.h"
#include "ngspice/randnumb.h"
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -62,15 +63,8 @@ static unsigned LGCS(unsigned *state, unsigned A1, unsigned A2);
double CombLCGTaus(void); double CombLCGTaus(void);
float CombLCGTaus2(void); float CombLCGTaus2(void);
unsigned int CombLCGTausInt(void);
unsigned int CombLCGTausInt2(void);
double exprand(double);
void checkseed(void);
double drand(void);
double gauss0(void);
void rgauss(double* py1, double* py2); void rgauss(double* py1, double* py2);
int poisson(double);
/* Check if a seed has been set by the command 'set rndseed=value' /* Check if a seed has been set by the command 'set rndseed=value'

2
src/sharedspice.c

@ -60,6 +60,7 @@ myfputc(int inp, FILE* f)
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "misc/misc_time.h" #include "misc/misc_time.h"
#include "ngspice/randnumb.h"
/*Use Windows threads if on W32 without pthreads*/ /*Use Windows threads if on W32 without pthreads*/
#ifndef HAVE_LIBPTHREAD #ifndef HAVE_LIBPTHREAD
@ -170,7 +171,6 @@ extern void DevInit(void);
extern int SIMinit(IFfrontEnd *frontEnd, IFsimulator **simulator); extern int SIMinit(IFfrontEnd *frontEnd, IFsimulator **simulator);
extern wordlist *cp_varwl(struct variable *var); extern wordlist *cp_varwl(struct variable *var);
extern void create_circbyline(char *line); extern void create_circbyline(char *line);
extern void initw(void);
/*The current run (to get variable names, etc)*/ /*The current run (to get variable names, etc)*/

1
src/tclspice.c

@ -26,6 +26,7 @@
/**********************************************************************/ /**********************************************************************/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "ngspice/randnumb.h"
#include "misc/misc_time.h" #include "misc/misc_time.h"
#include <tcl.h> #include <tcl.h>

1
visualc/sharedspice.vcxproj

@ -398,6 +398,7 @@
<ClInclude Include="..\src\include\ngspice\profile.h" /> <ClInclude Include="..\src\include\ngspice\profile.h" />
<ClInclude Include="..\src\include\ngspice\pssdefs.h" /> <ClInclude Include="..\src\include\ngspice\pssdefs.h" />
<ClInclude Include="..\src\include\ngspice\pzdefs.h" /> <ClInclude Include="..\src\include\ngspice\pzdefs.h" />
<ClInclude Include="..\src\include\ngspice\randnumb.h" />
<ClInclude Include="..\src\include\ngspice\sen2defs.h" /> <ClInclude Include="..\src\include\ngspice\sen2defs.h" />
<ClInclude Include="..\src\include\ngspice\sensdefs.h" /> <ClInclude Include="..\src\include\ngspice\sensdefs.h" />
<ClInclude Include="..\src\include\ngspice\sensgen.h" /> <ClInclude Include="..\src\include\ngspice\sensgen.h" />

1
visualc/vngspice-fftw.vcxproj

@ -1015,6 +1015,7 @@ lib /machine:x64 /def:..\..\fftw-3.3.4-dll64\libfftw3-3.def /out:$(IntDir)libfft
<ClInclude Include="..\src\include\ngspice\profile.h" /> <ClInclude Include="..\src\include\ngspice\profile.h" />
<ClInclude Include="..\src\include\ngspice\pssdefs.h" /> <ClInclude Include="..\src\include\ngspice\pssdefs.h" />
<ClInclude Include="..\src\include\ngspice\pzdefs.h" /> <ClInclude Include="..\src\include\ngspice\pzdefs.h" />
<ClInclude Include="..\src\include\ngspice\randnumb.h" />
<ClInclude Include="..\src\include\ngspice\sen2defs.h" /> <ClInclude Include="..\src\include\ngspice\sen2defs.h" />
<ClInclude Include="..\src\include\ngspice\sensdefs.h" /> <ClInclude Include="..\src\include\ngspice\sensdefs.h" />
<ClInclude Include="..\src\include\ngspice\sensgen.h" /> <ClInclude Include="..\src\include\ngspice\sensgen.h" />

1
visualc/vngspice.vcxproj

@ -981,6 +981,7 @@
<ClInclude Include="..\src\include\ngspice\profile.h" /> <ClInclude Include="..\src\include\ngspice\profile.h" />
<ClInclude Include="..\src\include\ngspice\pssdefs.h" /> <ClInclude Include="..\src\include\ngspice\pssdefs.h" />
<ClInclude Include="..\src\include\ngspice\pzdefs.h" /> <ClInclude Include="..\src\include\ngspice\pzdefs.h" />
<ClInclude Include="..\src\include\ngspice\randnumb.h" />
<ClInclude Include="..\src\include\ngspice\sen2defs.h" /> <ClInclude Include="..\src\include\ngspice\sen2defs.h" />
<ClInclude Include="..\src\include\ngspice\sensdefs.h" /> <ClInclude Include="..\src\include\ngspice\sensdefs.h" />
<ClInclude Include="..\src\include\ngspice\sensgen.h" /> <ClInclude Include="..\src\include\ngspice\sensgen.h" />

Loading…
Cancel
Save