proteus  1.8.1
C/C++/Fortran libraries
jf.h
Go to the documentation of this file.
1 // This is C:/JF/Software/Cpp/Include/jf.h
2 #define ANSI
3 #include <math.h>
4 #include <stdio.h>
5 #include <conio.h>
6 #include <stdlib.h>
7 #include <string.h>
8 
9 #define D(x,y) printf(" "#x":%"#y, x)
10 #define Diag(x,y) if(diagon=='y') {fprintf(diag,"\n" #x"\t%"#y"\t", x); fflush(diag);}
11 #define Diag_Maple(x,y) fprintf(diag,"\n\# "#x" = %"#y";", x);
12 #define For(x,y,z) for((x)=(y);(x)<=(z);(x)++)
13 
14 #define Write(x,y,z) fprintf(out,"\n" #x" %"#z" ",y)
15 #define print(y,z) Write( ,y,z)
16 
17 #define nl(x) fprintf((x),"\n")
18 #define Heading(x,y) fprintf((x),"\n\n" #y "\n")
19 
20 #define Asterisks(x) For(i,0,72)fprintf(x,"*")
21 #define c(i) putchar(i)
22 #define w(x) fprintf(results,#x)
23 #define pf(x) printf("%8.5g",x)
24 #define pd(x) printf("%ld",x)
25 
26 #define Readtext(stream,x) fgets(x,400,stream); x[strlen(x)-1] = '\0'
27 #define Readtab(x) fscanf(in,"%[^\t]%*c",x);
28 
29 #define Skip(stream) fgets(dummy,400,stream)
30 #define Read(stream,x,y) {fscanf(stream,"%"#y, &x);Skip(stream);}
31 
32 #define endfile(x) if(feof(x)) break
33 
34 #define pause(x) {printf("\nPaused: " x); fgetchar();}
35 
36 #define IN fscanf(in,
37 #define OUT fprintf(out,
38 #define DIAG fprintf(diag,
39 #define SCREEN fprintf(stdout,
40 #define RESULTS fprintf(results,
41 
42 #define END );
43 
44 #define sign(x,y) (fabs(x) * fabs(y)/y)
45 #define Sign(x) (x > 0. ? 1. : -1.)
46 
47 #define iff(x,y) if(strcmp(x,#y)==0)
48 #define Screenfull(x,y) if((x) % ((y)+1) == (y)) pause
49 
50 #define pi 3.14159265358979324
51 #define twopi 6.2831853071795864769
52 
53 int *ivector(long, long), **imatrix(long,long,long,long);
54 char *cvector(long, long), **cmatrix(long, long, long, long);
55 
56 //complex<double> *complex_vector(long, long);
57 
58 float *vector(long , long);
59 float **matrix(long , long , long , long);
60 unsigned long *lvector(long , long );
61 
62 double *dvector(long, long);
63 char *cvector(long, long);
64 double **dmatrix(long , long , long , long );
65 void free_ivector(int *, long, long);
66 void free_dvector(double *, long, long);
67 void free_lvector(unsigned long *, long, long);
68 void free_dmatrix(double **, long , long , long , long );
69 
70 #define max(a,b) (((a) > (b)) ? (a) : (b))
71 #define min(a,b) (((a) < (b)) ? (a) : (b))
72 
cmatrix
char ** cmatrix(long, long, long, long)
lvector
unsigned long * lvector(long, long)
free_dmatrix
void free_dmatrix(double **, long, long, long, long)
Definition: Util.cpp:44
dvector
double * dvector(long, long)
Definition: Util.cpp:7
cvector
char * cvector(long, long)
matrix
float ** matrix(long, long, long, long)
vector
float * vector(long, long)
ivector
int * ivector(long, long)
free_ivector
void free_ivector(int *, long, long)
imatrix
int ** imatrix(long, long, long, long)
dmatrix
double ** dmatrix(long, long, long, long)
Definition: Util.cpp:16
free_dvector
void free_dvector(double *, long, long)
Definition: Util.cpp:38
free_lvector
void free_lvector(unsigned long *, long, long)