part 2
__declspec(dllexport) Complex_Matrix CmxscalR(Complex_Matrix m, unsigned rows, unsigned cols,Real value);
__declspec(dllexport) Real_Matrix Cmxmag(Complex_Matrix m, unsigned rows, unsigned cols);
__declspec(dllexport) Complex_Matrix Cmxsub(Complex_Matrix m1, Complex_Matrix m2, unsigned rows,unsigned cols);
__declspec(dllexport) Complex_Matrix Cmxtrans(Complex_Matrix m, unsigned rows, unsigned cols);
__declspec(dllexport) Complex Cmxtrace(Complex_Matrix m, unsigned n);
__declspec(dllexport) Real_Vector Cvmag(Complex_Vector v, unsigned n);
__declspec(dllexport) Complex_Vector Cvadd(Complex_Vector v1, Complex_Vector v2, unsigned n);
__declspec(dllexport) Complex_Vector Cvalloc(Complex_Ptr address, unsigned n);
__declspec(dllexport) Complex_Matrix Cvectomx(Complex_Vector v1, Complex_Vector v2, unsigned n);
__declspec(dllexport) Complex_Vector Cvconjg(Complex_Vector v, unsigned n);
__declspec(dllexport) void Cvcopy(Complex_Vector dest, Complex_Vector src,unsigned n);
__declspec(dllexport) Complex_Vector Cvdup(Complex_Vector v, unsigned n);
__declspec(dllexport) void Cvfree(Complex_Vector v);
__declspec(dllexport) void Cvinit(Complex_Vector v, unsigned n, Complex value);
__declspec(dllexport) Real Cvmaxval(Complex_Vector v, unsigned n, unsigned *imx);
__declspec(dllexport) Real Cvminval(Complex_Vector v, unsigned n, unsigned *imn);
__declspec(dllexport) Complex_Vector Cvmxmul(Complex_Matrix m, Complex_Vector v, unsigned n1,unsigned n2);
__declspec(dllexport) Complex_Vector Cvmxmul1(Complex_Matrix m, Complex_Vector v, unsigned n1,unsigned n2);
__declspec(dllexport) Complex_Vector CvscalC(Complex_Vector v, unsigned n, Complex value);
__declspec(dllexport) Complex_Vector CvscalR(Complex_Vector v, unsigned n, Real value);
__declspec(dllexport) Complex_Vector Cvsub(Complex_Vector v1, Complex_Vector v2, unsigned n);
__declspec(dllexport) Complex_Vector Cvread(void *fp, unsigned n);
__declspec(dllexport) int Cvwrite(void *fp, Complex_Vector v, unsigned n);
/********************************************/
/* Real Matrix and Real Vector functions */
/********************************************/
__declspec(dllexport) Real_Vector least_sq(int (*funct)(Real, Real_Vector, unsigned), Real_Vector vx,Real_Vector vy, unsigned n, unsigned terms, Real *mse);
__declspec(dllexport) Real_Vector curvreg(Real_Vector vx, Real_Vector vy, unsigned n, unsigned terms,Real *mse);
__declspec(dllexport) Real_Vector lineqn(Real_Matrix m, Real_Vector v, unsigned n);
__declspec(dllexport) Real_Matrix mxalloc(Real_Ptr address, unsigned rows, unsigned cols);
__declspec(dllexport) void mxcopy(Real_Matrix dest, Real_Matrix src,unsigned rows, unsigned cols);
__declspec(dllexport) Real mxdeterm(Real_Matrix m, unsigned n);
__declspec(dllexport) Real_Matrix mxdup(Real_Matrix m, unsigned rows, unsigned cols);
__declspec(dllexport) void mxfree(Real_Matrix m);
__declspec(dllexport) Real_Matrix mxident(unsigned n);
__declspec(dllexport) void mxinit(Real_Matrix m, unsigned rows, unsigned cols, Real value);
__declspec(dllexport) Real_Matrix mxinv(Real_Matrix m, unsigned n);
__declspec(dllexport) Real_Matrix mxinv22(Real_Matrix m);
__declspec(dllexport) Real_Matrix mxinv33(Real_Matrix m);
__declspec(dllexport) Real mxmaxval(Real_Matrix m, unsigned rows, unsigned cols,unsigned *imx, unsigned *jmx);
__declspec(dllexport) Real mxminval(Real_Matrix m, unsigned rows, unsigned cols,unsigned *imn, unsigned *jmn);
__declspec(dllexport) Real_Matrix mxmul(Real_Matrix m1, Real_Matrix m2, unsigned n1, unsigned n2,unsigned n3);
__declspec(dllexport) Real_Matrix mxmul1(Real_Matrix m1, Real_Matrix m2, unsigned n1, unsigned n2,unsigned n3);
__declspec(dllexport) Real_Matrix mxmul2(Real_Matrix m1, Real_Matrix m2, unsigned n1, unsigned n2,unsigned n3);
__declspec(dllexport) Real_Matrix mxadd(Real_Matrix m1, Real_Matrix m2, unsigned rows, unsigned cols);
__declspec(dllexport) Real_Matrix mxscale(Real_Matrix m, unsigned rows, unsigned cols, Real value);
__declspec(dllexport) Real_Matrix mxsub(Real_Matrix m1, Real_Matrix m2, unsigned rows, unsigned cols);
__declspec(dllexport) Real_Matrix mxtransp(Real_Matrix m, unsigned rows, unsigned cols);
__declspec(dllexport) Real mxtrace(Real_Matrix m, unsigned n);
__declspec(dllexport) double pseries(double x, double coef[], unsigned n);
__declspec(dllexport) double chebser(double x, double coef[], unsigned n, int even);
__declspec(dllexport) Real_Vector pseudinv(Real_Matrix m, Real_Vector v, unsigned neqns,unsigned unknwns);
__declspec(dllexport) Real_Vector vadd(Real_Vector v1, Real_Vector v2, unsigned n);
__declspec(dllexport) Real_Vector valloc(Real_Ptr address, unsigned n);
__declspec(dllexport) Real_Matrix vectomat(Real_Vector v1, Real_Vector v2, unsigned n);
__declspec(dllexport) void vcopy(Real_Vector dest, Real_Vector src, unsigned n);
__declspec(dllexport) Real_Vector vcross(Real_Vector v1, Real_Vector v2);
__declspec(dllexport) Real vdot(Real_Vector v1, Real_Vector v2, unsigned n);
__declspec(dllexport) Real_Vector vdup(Real_Vector v, unsigned n);
__declspec(dllexport) void vfree(Real_Vector v);
__declspec(dllexport) void vinit(Real_Vector v, unsigned n, Real value);
__declspec(dllexport) Real vmag(Real_Vector v, unsigned n);
__declspec(dllexport) Real vmaxval(Real_Vector v, unsigned n, unsigned *imx);
__declspec(dllexport) Real vminval(Real_Vector v, unsigned n, unsigned *imn);
__declspec(dllexport) Real_Vector vmxmul(Real_Matrix m, Real_Vector x, unsigned n1, unsigned n2);
__declspec(dllexport) Real_Vector vmxmul1(Real_Matrix m, Real_Vector v, unsigned n1, unsigned n2);
__declspec(dllexport) Real_Vector vscale(Real_Vector in, unsigned n, Real value);
__declspec(dllexport) Real_Vector vsub(Real_Vector v1, Real_Vector v2, unsigned n);
__declspec(dllexport) Real_Vector vread(void *fp, unsigned n);
__declspec(dllexport) int vwrite(void *fp, Real_Vector v, unsigned n);
__declspec(dllexport) int xyinfo(char *filename, int *format, int *curves, unsigned points[],Labels *labels, int *size);
__declspec(dllexport) int xyread(char *filename, int *format, int *curves, unsigned points[],Labels *labels, Real_Vector x[], Real_Vector y[]);
__declspec(dllexport) int xywrite(char *filename, int format, int curves, unsigned points[],Labels *labels, Real_Vector x[], Real_Vector y[]);
__declspec(dllexport) Real_Vector tdwindow(unsigned nw, unsigned wtype);
__declspec(dllexport) double besj0(double x);
__declspec(dllexport) double besj1(double x);
__declspec(dllexport) double besjn(int n, double x);
__declspec(dllexport) double besy0(double x);
__declspec(dllexport) double besy1(double x);
__declspec(dllexport) double besyn(int n, double x);
__declspec(dllexport) double beskn(int n, double x);
__declspec(dllexport) double besin(int n, double x);
__declspec(dllexport) double besk0(double x);
__declspec(dllexport) double besk1(double x);
__declspec(dllexport) double besi0(double x);
__declspec(dllexport) double besi1(double x);
//double acosh(double x);
//double asinh(double x);
//double atanh(double x);
__declspec(dllexport) double logn(int n, double x);
__declspec(dllexport) double combin(int n, int r);
__declspec(dllexport) double permut(int n, int r);
__declspec(dllexport) double fact(unsigned n);
__declspec(dllexport) double normal(double sigma, double u);
__declspec(dllexport) unsigned poisson(int pmean);
__declspec(dllexport) double urand(void);
__declspec(dllexport) void uraninit(long seed);
__declspec(dllexport) void linreg(Real_Vector x, Real_Vector y, int n, Real *m, Real *b, Real *rsq);
__declspec(dllexport) double stats(Real_Vector x, int n, double *pop_var, double *samp_var);
__declspec(dllexport) Real_Vector deriv(Real_Vector fx, Real dx, int n);
__declspec(dllexport) double deriv1(double(*fx)(double), double x, double dx);
__declspec(dllexport) Real_Vector convolve(Real_Vector data, int ndata, Real weights[], int nweights, int ndec, int itype, int isym, int *length);
__declspec(dllexport) void lowpass(Real weights[], int nweights, double fc, double dB, int half);
__declspec(dllexport) void highpass(Real weights[], int nweights, double fc, double dB,int half);
__declspec(dllexport) void bandpass(Real weights[], int nweights, double fh, double fl,double dB, int half);
__declspec(dllexport) Real_Vector smooth(Real_Vector data, int ndata, int factor);
__declspec(dllexport) Real_Vector downsamp(Real_Vector data, int ndata, int ndec);
__declspec(dllexport) Real_Vector integrat(Real_Vector fx, double dx, int n);
__declspec(dllexport) double romberg(double(*fx)(double), double x0, double x1,double accuracy);
__declspec(dllexport) Real_Vector interp(Real_Vector y, int ny, int nout, Real_Vector points);
__declspec(dllexport) Real interp1(Real x0, Real_Vector x, Real_Vector y, unsigned n,unsigned order);
__declspec(dllexport) Real_Vector spline0(Real_Vector x, Real_Vector y, unsigned n);
__declspec(dllexport) Real spline(Real x0, Real_Vector x, Real_Vector y, unsigned n,Real_Vector deriv);
__declspec(dllexport) double newton(double (*fx)(double), double *x, double delta,unsigned limit, double err);
__declspec(dllexport) Real conjgrad(Real (*funct)(unsigned, Real_Vector, Real_Vector),unsigned n, Real_Vector v, Real est, Real eps,unsigned limit);
__declspec(dllexport) double nprob(double x0);
__declspec(dllexport) double invprob(double p0);
__declspec(dllexport) double poissdst(int k0, double lt, Real pb[]);
__declspec(dllexport) double binomdst(int n, int k0, double p, Real pb[]);
__declspec(dllexport) double hyperdst(int n, int k0, int r, int r1, Real pb[]);
__declspec(dllexport) Real_Vector powspec(Real_Vector v, unsigned nv, unsigned npw, Real_Vector w);
__declspec(dllexport) Real_Vector Cpowspec(Complex_Vector v, unsigned nv, unsigned npw,Real_Vector w);
__declspec(dllexport) void fftrad2(Complex_Vector data, unsigned n, int isign);
__declspec(dllexport) void fft42(Complex_Vector data, unsigned n, int isign);
/* add additional function declarations here */
#ifdef __cplusplus
}
#endif
/*--------------------------------------------------------------------
define error constants (0 .. n)
change matherr_.c when new error constants are added
--------------------------------------------------------------------*/
#define E_NOERROR 0 /* No errors detected */
#define E_MALLOC 1 /* Not enough memory */
#define E_MSIZE 2 /* Array too large */
#define E_NULLPTR 3 /* NULL pointer (uninitialized pointer ) */
#define E_MSING 4 /* Singular Matrix (ie. determinant = 0) */
#define E_NEQNS 5 /* More unknowns than equations */
#define E_WINDOW 6 /* Invalid window type specified */
#define E_DOMERR 7 /* argument outside domain of function */
#define E_FACTOR 8 /* Argument 'factor' must be between 2 and 10 */
#define E_DECIMATE 9 /* Argument 'ndec' must be between 2 and 10 */
#define E_NOTENOUGH 10 /* Not enough input data,the input array must be longer*/
#define E_INTERP 11 /* Interpolated length must be >= input length */
#define E_LAGRANGE 12 /* Interpolation not defined at input value t */
#define E_NEGPROB 13 /* Negative probability undefined */
#define E_FFTSIZE 14 /* Data length must be >= FFT length */
#define E_FFTPOWER2 15 /* FFT length must be a power of two */
#define E_LIMITS 16 /* Limits on definite integral must be distinct */
#define E_ROUNDOFF 17 /* Rounding errors prohibit required accuracy */
#define E_STEPSIZE 18 /* Step size must be nonzero to estimate derivative*/
#define E_DISCRETE 19 /* k0 must be less than total number of objects n */
#define E_SAMEX 20 /* The input table has two identical x values */
#define E_ORDER 21 /* The polynomial order must be between 1 and 9 */
#define E_OPEN 22 /* Could not open file */
#define E_WRITE 23 /* Error writing to file */
#define E_READ 24 /* Error reading from file */
#define E_CURVES 25 /* Argument 'curves' must be between 1 and 9 */
#define E_HEADER 26 /* Invalid file header */
#define E_RSIZE 27 /* Sizeof(Real) in file != sizeof(Real) in program */
#define E_NO_MIN 28 /* Minimum probably does not exist */
#define E_DIVERGE 29 /* No convergence in LIMIT iterations */
#define E_GRAD_ERR 30 /* Encountered errors in calculating the gradient */
#define E_USERFUNC 31 /* User function called by least_sq returned error */
/* add additional error constants here */
/*$list*//*$trace <<< mathlib.h >>> */