- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# /home/peifer/diffit/nr.h

Go to the documentation of this file.

    00001
    00002
    00003
    00004 // #####################################
    00005 // #                                   #
    00006 // #       Klasse f. Bandmatizen       #
    00007 // #                                   #
    00008 // #####################################
    00009
    00010
    00011 class Bandmatrix
    00012 {
    00013 private:
    00014   long n;  //Anz. der Datenpunkte
    00015   long bw; //Anz. der Nebendiagonalen
    00016   double **band;
    00017 public:
    00018   Bandmatrix(long ndata,long bandbreite); //Konstruktor
    00019   double r(long i,long j); //Lesen
    00020   void w(double value,long i,long j);  //Schreiben
    00021   ~Bandmatrix();  //Destruktor
    00022 };
    00023
    00024
    00025
    00026 //RECIPES
    00027 //
    00028
    00029 void rkck(double y[], double dydx[], long n, double x, double h,
    00030         double yout[], double yerr[], void (*derivs)(double, double [], double [], double []));
    00031 void rkqs(double y[], double dydx[], double p[], long n, double *x,
    00032           double htry, double eps, double yscal[], double *hdid, double *hnext,long rkqs_ign,
    00033         void (*derivs)(double, double [], double [], double []));
    00034
    00035 void svdcmp(double **a, int m, int n, double w[], double **v);
    00036 double pythag(double a, double b);
    00037 double ran1(long *idum);
    00038 double gasdev(long *idum);
    00039 double spline(double *x,double *g,double *gam,long n,double t);
    00040 void svbksb(double **u, double w[], double **v, int m, int n, double b[], double x[]);
    00041 void splines(double *x,double *y,double *w,long n,double alpha,double *g,double *gam);
    00042 void splines_gcv(double *x,double *y,double *w,long n,double *alpha,double *g,double *gam,double maxa);
    00043 //NRUTIL
    00044
    00045 static double sqrarg;
    00046 #define SQR(a) ((sqrarg=(a)) == 0.0 ? 0.0 : sqrarg*sqrarg)
    00047
    00048 static double dsqrarg;
    00049 #define DSQR(a) ((dsqrarg=(a)) == 0.0 ? 0.0 : dsqrarg*dsqrarg)
    00050
    00051 static double dmaxarg1,dmaxarg2;
    00052 #define DMAX(a,b) (dmaxarg1=(a),dmaxarg2=(b),(dmaxarg1) > (dmaxarg2) ?\
    00053         (dmaxarg1) : (dmaxarg2))
    00054
    00055 static double dminarg1,dminarg2;
    00056 #define DMIN(a,b) (dminarg1=(a),dminarg2=(b),(dminarg1) < (dminarg2) ?\
    00057         (dminarg1) : (dminarg2))
    00058
    00059 static double maxarg1,maxarg2;
    00060 #define FMAX(a,b) (maxarg1=(a),maxarg2=(b),(maxarg1) > (maxarg2) ?\
    00061         (maxarg1) : (maxarg2))
    00062
    00063 static double minarg1,minarg2;
    00064 #define FMIN(a,b) (minarg1=(a),minarg2=(b),(minarg1) < (minarg2) ?\
    00065         (minarg1) : (minarg2))
    00066
    00067 static long lmaxarg1,lmaxarg2;
    00068 #define LMAX(a,b) (lmaxarg1=(a),lmaxarg2=(b),(lmaxarg1) > (lmaxarg2) ?\
    00069         (lmaxarg1) : (lmaxarg2))
    00070
    00071 static long lminarg1,lminarg2;
    00072 #define LMIN(a,b) (lminarg1=(a),lminarg2=(b),(lminarg1) < (lminarg2) ?\
    00073         (lminarg1) : (lminarg2))
    00074
    00075 static int imaxarg1,imaxarg2;
    00076 #define IMAX(a,b) (imaxarg1=(a),imaxarg2=(b),(imaxarg1) > (imaxarg2) ?\
    00077         (imaxarg1) : (imaxarg2))
    00078
    00079 static int iminarg1,iminarg2;
    00080 #define IMIN(a,b) (iminarg1=(a),iminarg2=(b),(iminarg1) < (iminarg2) ?\
    00081         (iminarg1) : (iminarg2))
    00082
    00083 #define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a))
    00084
    00085 void nrerror(char error_text[]);
    00086 double *vector(long nl, long nh);
    00087 int *ivector(long nl, long nh);
    00088 unsigned char *cvector(long nl, long nh);
    00089 unsigned long *lvector(long nl, long nh);
    00090 double *dvector(long nl, long nh);
    00091 double **matrix(long nrl, long nrh, long ncl, long nch);
    00092 double **dmatrix(long nrl, long nrh, long ncl, long nch);
    00093 int **imatrix(long nrl, long nrh, long ncl, long nch);
    00094 char **cmatrix(long nrl, long nrh, long ncl, long nch);
    00095 double **submatrix(double **a, long oldrl, long oldrh, long oldcl, long oldch,
    00096         long newrl, long newcl);
    00097 double **convert_matrix(double *a, long nrl, long nrh, long ncl, long nch);
    00098 double ***d3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh);
    00099 void free_vector(double *v, long nl, long nh);
    00100 void free_ivector(int *v, long nl, long nh);
    00101 void free_cvector(unsigned char *v, long nl, long nh);
    00102 void free_lvector(unsigned long *v, long nl, long nh);
    00103 void free_dvector(double *v, long nl, long nh);
    00104 void free_matrix(double **m, long nrl, long nrh, long ncl, long nch);
    00105 void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch);
    00106 void free_imatrix(int **m, long nrl, long nrh, long ncl, long nch);
    00107 void free_cmatrix(char **m, long nrl, long nrh, long ncl, long nch);
    00108 void free_submatrix(double **b, long nrl, long nrh, long ncl, long nch);
    00109 void free_convert_matrix(double **b, long nrl, long nrh, long ncl, long nch);
    00110 void free_d3tensor(double ***t, long nrl, long nrh, long ncl, long nch,
    00111         long ndl, long ndh);
    00112 #include <stdio.h>
    00113 void Choldc(Bandmatrix *a, int n, double p[]);
    00114 void Cholsl(Bandmatrix *a, int n, double p[], double b[], double x[]);
    00115 void cmat2fvec(double **cmat,long n,long m,double *fvec);