Index: trunk/Poubelle/archTOI.old/nrutil.c
===================================================================
--- trunk/Poubelle/archTOI.old/nrutil.c	(revision 556)
+++ trunk/Poubelle/archTOI.old/nrutil.c	(revision 577)
@@ -18,10 +18,10 @@
 }*/
 
-float *vector(long nl, long nh)
-/* allocate a float vector with subscript range v[nl..nh] */
-{
-	float *v;
-
-	v=(float *)malloc((size_t) ((nh-nl+1+NR_END)*sizeof(float)));
+double *vector(long nl, long nh)
+/* allocate a double vector with subscript range v[nl..nh] */
+{
+	double *v;
+
+	v=(double *)malloc((size_t) ((nh-nl+1+NR_END)*sizeof(double)));
 	if (!v) nrerror("allocation failure in vector()");
 	return v-nl+NR_END;
@@ -68,29 +68,5 @@
 }
 
-float **matrix(long nrl, long nrh, long ncl, long nch)
-/* allocate a float matrix with subscript range m[nrl..nrh][ncl..nch] */
-{
-	long i, nrow=nrh-nrl+1,ncol=nch-ncl+1;
-	float **m;
-
-	/* allocate pointers to rows */
-	m=(float **) malloc((size_t)((nrow+NR_END)*sizeof(float*)));
-	if (!m) nrerror("allocation failure 1 in matrix()");
-	m += NR_END;
-	m -= nrl;
-
-	/* allocate rows and set pointers to them */
-	m[nrl]=(float *) malloc((size_t)((nrow*ncol+NR_END)*sizeof(float)));
-	if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
-	m[nrl] += NR_END;
-	m[nrl] -= ncl;
-
-	for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
-
-	/* return pointer to array of pointers to rows */
-	return m;
-}
-
-double **dmatrix(long nrl, long nrh, long ncl, long nch)
+double **matrix(long nrl, long nrh, long ncl, long nch)
 /* allocate a double matrix with subscript range m[nrl..nrh][ncl..nch] */
 {
@@ -116,4 +92,28 @@
 }
 
+double **dmatrix(long nrl, long nrh, long ncl, long nch)
+/* allocate a double matrix with subscript range m[nrl..nrh][ncl..nch] */
+{
+	long i, nrow=nrh-nrl+1,ncol=nch-ncl+1;
+	double **m;
+
+	/* allocate pointers to rows */
+	m=(double **) malloc((size_t)((nrow+NR_END)*sizeof(double*)));
+	if (!m) nrerror("allocation failure 1 in matrix()");
+	m += NR_END;
+	m -= nrl;
+
+	/* allocate rows and set pointers to them */
+	m[nrl]=(double *) malloc((size_t)((nrow*ncol+NR_END)*sizeof(double)));
+	if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
+	m[nrl] += NR_END;
+	m[nrl] -= ncl;
+
+	for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
+
+	/* return pointer to array of pointers to rows */
+	return m;
+}
+
 int **imatrix(long nrl, long nrh, long ncl, long nch)
 /* allocate a int matrix with subscript range m[nrl..nrh][ncl..nch] */
@@ -141,13 +141,13 @@
 }
 
-float **submatrix(float **a, long oldrl, long oldrh, long oldcl, long oldch,
+double **submatrix(double **a, long oldrl, long oldrh, long oldcl, long oldch,
 	long newrl, long newcl)
 /* point a submatrix [newrl..][newcl..] to a[oldrl..oldrh][oldcl..oldch] */
 {
 	long i,j,nrow=oldrh-oldrl+1,ncol=oldcl-newcl;
-	float **m;
+	double **m;
 
 	/* allocate array of pointers to rows */
-	m=(float **) malloc((size_t) ((nrow+NR_END)*sizeof(float*)));
+	m=(double **) malloc((size_t) ((nrow+NR_END)*sizeof(double*)));
 	if (!m) nrerror("allocation failure in submatrix()");
 	m += NR_END;
@@ -161,6 +161,6 @@
 }
 
-float **convert_matrix(float *a, long nrl, long nrh, long ncl, long nch)
-/* allocate a float matrix m[nrl..nrh][ncl..nch] that points to the matrix
+double **convert_matrix(double *a, long nrl, long nrh, long ncl, long nch)
+/* allocate a double matrix m[nrl..nrh][ncl..nch] that points to the matrix
 declared in the standard C manner as a[nrow][ncol], where nrow=nrh-nrl+1
 and ncol=nch-ncl+1. The routine should be called with the address
@@ -168,8 +168,8 @@
 {
 	long i,j,nrow=nrh-nrl+1,ncol=nch-ncl+1;
-	float **m;
-
-	/* allocate pointers to rows */
-	m=(float **) malloc((size_t) ((nrow+NR_END)*sizeof(float*)));
+	double **m;
+
+	/* allocate pointers to rows */
+	m=(double **) malloc((size_t) ((nrow+NR_END)*sizeof(double*)));
 	if (!m) nrerror("allocation failure in convert_matrix()");
 	m += NR_END;
@@ -183,12 +183,12 @@
 }
 
-float ***f3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh)
-/* allocate a float 3tensor with range t[nrl..nrh][ncl..nch][ndl..ndh] */
+double ***f3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh)
+/* allocate a double 3tensor with range t[nrl..nrh][ncl..nch][ndl..ndh] */
 {
 	long i,j,nrow=nrh-nrl+1,ncol=nch-ncl+1,ndep=ndh-ndl+1;
-	float ***t;
+	double ***t;
 
 	/* allocate pointers to pointers to rows */
-	t=(float ***) malloc((size_t)((nrow+NR_END)*sizeof(float**)));
+	t=(double ***) malloc((size_t)((nrow+NR_END)*sizeof(double**)));
 	if (!t) nrerror("allocation failure 1 in f3tensor()");
 	t += NR_END;
@@ -196,5 +196,5 @@
 
 	/* allocate pointers to rows and set pointers to them */
-	t[nrl]=(float **) malloc((size_t)((nrow*ncol+NR_END)*sizeof(float*)));
+	t[nrl]=(double **) malloc((size_t)((nrow*ncol+NR_END)*sizeof(double*)));
 	if (!t[nrl]) nrerror("allocation failure 2 in f3tensor()");
 	t[nrl] += NR_END;
@@ -202,5 +202,5 @@
 
 	/* allocate rows and set pointers to them */
-	t[nrl][ncl]=(float *) malloc((size_t)((nrow*ncol*ndep+NR_END)*sizeof(float)));
+	t[nrl][ncl]=(double *) malloc((size_t)((nrow*ncol*ndep+NR_END)*sizeof(double)));
 	if (!t[nrl][ncl]) nrerror("allocation failure 3 in f3tensor()");
 	t[nrl][ncl] += NR_END;
@@ -218,6 +218,6 @@
 }
 
-void free_vector(float *v, long nl, long nh)
-/* free a float vector allocated with vector() */
+void free_vector(double *v, long nl, long nh)
+/* free a double vector allocated with vector() */
 {
 	free((FREE_ARG) (v+nl-NR_END));
@@ -248,6 +248,6 @@
 }
 
-void free_matrix(float **m, long nrl, long nrh, long ncl, long nch)
-/* free a float matrix allocated by matrix() */
+void free_matrix(double **m, long nrl, long nrh, long ncl, long nch)
+/* free a double matrix allocated by matrix() */
 {
 	free((FREE_ARG) (m[nrl]+ncl-NR_END));
@@ -269,5 +269,5 @@
 }
 
-void free_submatrix(float **b, long nrl, long nrh, long ncl, long nch)
+void free_submatrix(double **b, long nrl, long nrh, long ncl, long nch)
 /* free a submatrix allocated by submatrix() */
 {
@@ -275,5 +275,5 @@
 }
 
-void free_convert_matrix(float **b, long nrl, long nrh, long ncl, long nch)
+void free_convert_matrix(double **b, long nrl, long nrh, long ncl, long nch)
 /* free a matrix allocated by convert_matrix() */
 {
@@ -281,7 +281,7 @@
 }
 
-void free_f3tensor(float ***t, long nrl, long nrh, long ncl, long nch,
+void free_f3tensor(double ***t, long nrl, long nrh, long ncl, long nch,
 	long ndl, long ndh)
-/* free a float f3tensor allocated by f3tensor() */
+/* free a double f3tensor allocated by f3tensor() */
 {
 	free((FREE_ARG) (t[nrl][ncl]+ndl-NR_END));
@@ -309,11 +309,11 @@
 }
 
-float *vector(nl,nh)
-long nh,nl;
-/* allocate a float vector with subscript range v[nl..nh] */
-{
-	float *v;
-
-	v=(float *)malloc((unsigned int) ((nh-nl+1+NR_END)*sizeof(float)));
+double *vector(nl,nh)
+long nh,nl;
+/* allocate a double vector with subscript range v[nl..nh] */
+{
+	double *v;
+
+	v=(double *)malloc((unsigned int) ((nh-nl+1+NR_END)*sizeof(double)));
 	if (!v) nrerror("allocation failure in vector()");
 	return v-nl+NR_END;
@@ -364,30 +364,5 @@
 }
 
-float **matrix(nrl,nrh,ncl,nch)
-long nch,ncl,nrh,nrl;
-/* allocate a float matrix with subscript range m[nrl..nrh][ncl..nch] */
-{
-	long i, nrow=nrh-nrl+1,ncol=nch-ncl+1;
-	float **m;
-
-	/* allocate pointers to rows */
-	m=(float **) malloc((unsigned int)((nrow+NR_END)*sizeof(float*)));
-	if (!m) nrerror("allocation failure 1 in matrix()");
-	m += NR_END;
-	m -= nrl;
-
-	/* allocate rows and set pointers to them */
-	m[nrl]=(float *) malloc((unsigned int)((nrow*ncol+NR_END)*sizeof(float)));
-	if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
-	m[nrl] += NR_END;
-	m[nrl] -= ncl;
-
-	for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
-
-	/* return pointer to array of pointers to rows */
-	return m;
-}
-
-double **dmatrix(nrl,nrh,ncl,nch)
+double **matrix(nrl,nrh,ncl,nch)
 long nch,ncl,nrh,nrl;
 /* allocate a double matrix with subscript range m[nrl..nrh][ncl..nch] */
@@ -414,4 +389,29 @@
 }
 
+double **dmatrix(nrl,nrh,ncl,nch)
+long nch,ncl,nrh,nrl;
+/* allocate a double matrix with subscript range m[nrl..nrh][ncl..nch] */
+{
+	long i, nrow=nrh-nrl+1,ncol=nch-ncl+1;
+	double **m;
+
+	/* allocate pointers to rows */
+	m=(double **) malloc((unsigned int)((nrow+NR_END)*sizeof(double*)));
+	if (!m) nrerror("allocation failure 1 in matrix()");
+	m += NR_END;
+	m -= nrl;
+
+	/* allocate rows and set pointers to them */
+	m[nrl]=(double *) malloc((unsigned int)((nrow*ncol+NR_END)*sizeof(double)));
+	if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
+	m[nrl] += NR_END;
+	m[nrl] -= ncl;
+
+	for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
+
+	/* return pointer to array of pointers to rows */
+	return m;
+}
+
 int **imatrix(nrl,nrh,ncl,nch)
 long nch,ncl,nrh,nrl;
@@ -440,14 +440,14 @@
 }
 
-float **submatrix(a,oldrl,oldrh,oldcl,oldch,newrl,newcl)
-float **a;
+double **submatrix(a,oldrl,oldrh,oldcl,oldch,newrl,newcl)
+double **a;
 long newcl,newrl,oldch,oldcl,oldrh,oldrl;
 /* point a submatrix [newrl..][newcl..] to a[oldrl..oldrh][oldcl..oldch] */
 {
 	long i,j,nrow=oldrh-oldrl+1,ncol=oldcl-newcl;
-	float **m;
+	double **m;
 
 	/* allocate array of pointers to rows */
-	m=(float **) malloc((unsigned int) ((nrow+NR_END)*sizeof(float*)));
+	m=(double **) malloc((unsigned int) ((nrow+NR_END)*sizeof(double*)));
 	if (!m) nrerror("allocation failure in submatrix()");
 	m += NR_END;
@@ -461,8 +461,8 @@
 }
 
-float **convert_matrix(a,nrl,nrh,ncl,nch)
-float *a;
-long nch,ncl,nrh,nrl;
-/* allocate a float matrix m[nrl..nrh][ncl..nch] that points to the matrix
+double **convert_matrix(a,nrl,nrh,ncl,nch)
+double *a;
+long nch,ncl,nrh,nrl;
+/* allocate a double matrix m[nrl..nrh][ncl..nch] that points to the matrix
 declared in the standard C manner as a[nrow][ncol], where nrow=nrh-nrl+1
 and ncol=nch-ncl+1. The routine should be called with the address
@@ -470,8 +470,8 @@
 {
 	long i,j,nrow=nrh-nrl+1,ncol=nch-ncl+1;
-	float **m;
-
-	/* allocate pointers to rows */
-	m=(float **) malloc((unsigned int) ((nrow+NR_END)*sizeof(float*)));
+	double **m;
+
+	/* allocate pointers to rows */
+	m=(double **) malloc((unsigned int) ((nrow+NR_END)*sizeof(double*)));
 	if (!m)	nrerror("allocation failure in convert_matrix()");
 	m += NR_END;
@@ -485,13 +485,13 @@
 }
 
-float ***f3tensor(nrl,nrh,ncl,nch,ndl,ndh)
+double ***f3tensor(nrl,nrh,ncl,nch,ndl,ndh)
 long nch,ncl,ndh,ndl,nrh,nrl;
-/* allocate a float 3tensor with range t[nrl..nrh][ncl..nch][ndl..ndh] */
+/* allocate a double 3tensor with range t[nrl..nrh][ncl..nch][ndl..ndh] */
 {
 	long i,j,nrow=nrh-nrl+1,ncol=nch-ncl+1,ndep=ndh-ndl+1;
-	float ***t;
+	double ***t;
 
 	/* allocate pointers to pointers to rows */
-	t=(float ***) malloc((unsigned int)((nrow+NR_END)*sizeof(float**)));
+	t=(double ***) malloc((unsigned int)((nrow+NR_END)*sizeof(double**)));
 	if (!t) nrerror("allocation failure 1 in f3tensor()");
 	t += NR_END;
@@ -499,5 +499,5 @@
 
 	/* allocate pointers to rows and set pointers to them */
-	t[nrl]=(float **) malloc((unsigned int)((nrow*ncol+NR_END)*sizeof(float*)));
+	t[nrl]=(double **) malloc((unsigned int)((nrow*ncol+NR_END)*sizeof(double*)));
 	if (!t[nrl]) nrerror("allocation failure 2 in f3tensor()");
 	t[nrl] += NR_END;
@@ -505,5 +505,5 @@
 
 	/* allocate rows and set pointers to them */
-	t[nrl][ncl]=(float *) malloc((unsigned int)((nrow*ncol*ndep+NR_END)*sizeof(float)));
+	t[nrl][ncl]=(double *) malloc((unsigned int)((nrow*ncol*ndep+NR_END)*sizeof(double)));
 	if (!t[nrl][ncl]) nrerror("allocation failure 3 in f3tensor()");
 	t[nrl][ncl] += NR_END;
@@ -522,7 +522,7 @@
 
 void free_vector(v,nl,nh)
-float *v;
-long nh,nl;
-/* free a float vector allocated with vector() */
+double *v;
+long nh,nl;
+/* free a double vector allocated with vector() */
 {
 	free((FREE_ARG) (v+nl-NR_END));
@@ -562,7 +562,7 @@
 
 void free_matrix(m,nrl,nrh,ncl,nch)
-float **m;
-long nch,ncl,nrh,nrl;
-/* free a float matrix allocated by matrix() */
+double **m;
+long nch,ncl,nrh,nrl;
+/* free a double matrix allocated by matrix() */
 {
 	free((FREE_ARG) (m[nrl]+ncl-NR_END));
@@ -589,5 +589,5 @@
 
 void free_submatrix(b,nrl,nrh,ncl,nch)
-float **b;
+double **b;
 long nch,ncl,nrh,nrl;
 /* free a submatrix allocated by submatrix() */
@@ -597,5 +597,5 @@
 
 void free_convert_matrix(b,nrl,nrh,ncl,nch)
-float **b;
+double **b;
 long nch,ncl,nrh,nrl;
 /* free a matrix allocated by convert_matrix() */
@@ -605,7 +605,7 @@
 
 void free_f3tensor(t,nrl,nrh,ncl,nch,ndl,ndh)
-float ***t;
+double ***t;
 long nch,ncl,ndh,ndl,nrh,nrl;
-/* free a float f3tensor allocated by f3tensor() */
+/* free a double f3tensor allocated by f3tensor() */
 {
 	free((FREE_ARG) (t[nrl][ncl]+ndl-NR_END));
