36 v=(
float *)malloc((
size_t)((nh-nl+1+
NR_END)*
sizeof(
float)));
42 if (!v)
t_error(
"allocation failure in fvector()");
78 v=(
int *)malloc((
size_t)((nh-nl+1+
NR_END)*
sizeof(
int)));
84 if (!v)
t_error(
"allocation failure in fvector()");
120 v=(
long *)malloc((
size_t)((nh-nl+1+
NR_END)*
sizeof(
long)));
126 if (!v)
t_error(
"allocation failure in fvector()");
162 v=(
short *)malloc((
size_t)((nh-nl+1+
NR_END)*
sizeof(
short)));
168 if (!v)
t_error(
"allocation failure in fvector()");
204 v=(
double *)malloc((
size_t)((nh-nl+1+
NR_END)*
sizeof(
double)));
210 if (!v)
t_error(
"allocation failure in fvector()");
252 v=(
char *)malloc((
size_t)((nh-nl+1+
NR_END)*
sizeof(
char)));
258 if (!v)
t_error(
"allocation failure in fvector()");
294 float **
matrix(
long nrl,
long nrh,
long ncl,
long nch)
306 long i,rows=nrh-nrl+1,cols=nch-ncl+1;
321 m=(
float **)malloc((
size_t)((rows+
NR_END)*
sizeof(
float*)));
324 if (!m)
t_error (
"Allocation failure 1 in matrix()");
342 m[nrl]=(
float *)malloc((
size_t)((rows*cols+
NR_END)*
sizeof(
float)));
345 if (!m)
t_error (
"Allocation failure 2 in matrix()");
357 for(i=nrl+1;i<=nrh;i++){
381 int **
imatrix(
long nrl,
long nrh,
long ncl,
long nch)
393 long i,rows=nrh-nrl+1,cols=nch-ncl+1;
408 m=(
int **)malloc((
size_t)((rows+
NR_END)*
sizeof(
int*)));
411 if (!m)
t_error (
"Allocation failure 1 in matrix()");
429 m[nrl]=(
int *)malloc((
size_t)((rows*cols+
NR_END)*
sizeof(
int)));
432 if (!m)
t_error (
"Allocation failure 2 in matrix()");
453 for(i=nrl+1;i<=nrh;i++){
480 short **
smatrix(
long nrl,
long nrh,
long ncl,
long nch)
492 long i,rows=nrh-nrl+1,cols=nch-ncl+1;
507 m=(
short **)malloc((
size_t)((rows+
NR_END)*
sizeof(
short*)));
510 if (!m)
t_error (
"Allocation failure 1 in matrix()");
528 m[nrl]=(
short *)malloc((
size_t)((rows*cols+
NR_END)*
sizeof(
short)));
531 if (!m)
t_error (
"Allocation failure 2 in matrix()");
543 for(i=nrl+1;i<=nrh;i++){
567 long **
lmatrix(
long nrl,
long nrh,
long ncl,
long nch)
579 long i,rows=nrh-nrl+1,cols=nch-ncl+1;
594 m=(
long **)malloc((
size_t)((rows+
NR_END)*
sizeof(
long*)));
597 if (!m)
t_error (
"Allocation failure 1 in matrix()");
615 m[nrl]=(
long *)malloc((
size_t)((rows*cols+
NR_END)*
sizeof(
long)));
618 if (!m)
t_error (
"Allocation failure 2 in matrix()");
630 for(i=nrl+1;i<=nrh;i++){
654 double **
dmatrix(
long nrl,
long nrh,
long ncl,
long nch)
666 long i,rows=nrh-nrl+1,cols=nch-ncl+1;
681 m=(
double **)malloc((
size_t)((rows+
NR_END)*
sizeof(
double*)));
684 if (!m)
t_error (
"Allocation failure 1 in matrix()");
702 m[nrl]=(
double *)malloc((
size_t)((rows*cols+
NR_END)*
sizeof(
double)));
705 if (!m)
t_error (
"Allocation failure 2 in matrix()");
717 for(i=nrl+1;i<=nrh;i++){
753 long i,rows=nrh-nrl+1,cols=nch-ncl+1;
768 m=(
char **)malloc((
size_t)((rows+
NR_END)*
sizeof(
char*)));
771 if (!m)
t_error (
"Allocation failure 1 in matrix()");
789 m[nrl]=(
char *)malloc((
size_t)((rows*cols+
NR_END)*
sizeof(
char)));
792 if (!m)
t_error (
"Allocation failure 2 in matrix()");
804 for(i=nrl+1;i<=nrh;i++){
867 if (!m)
t_error(
"allocation failure in SHORTVECTOR()");
924 if (!m)
t_error(
"allocation failure in INTVECTOR()");
978 if (!m)
t_error(
"allocation failure in FLOATVECTOR()");
1035 if (!m)
t_error(
"allocation failure in LONGVECTOR()");
1095 if (!m)
t_error(
"allocation failure in DOUBLEVECTOR()");
1152 if (!m)
t_error(
"allocation failure in CHARVECTOR()");
1209 if (!m)
t_error(
"allocation failure in SHORTMATRIX()");
1269 if (!m)
t_error(
"allocation failure in INTMATRIX()");
1329 if (!m)
t_error(
"allocation failure in floatmatrix()");
1389 if (!m)
t_error(
"allocation failure in LONGMATRIX()");
1446 if (!m)
t_error(
"allocation failure in new_doublematrix()");
1503 if (!l)
t_error(
"allocation failure in new_intbin()");
1518 t_error(
"Not a proper index for intbin");
1539 for(i=indx->
nl;i<=indx->nh;i++){
1554 l->
co=(
int **)malloc((
size_t) ((indx->
nh+
NR_END)*
sizeof(
int *)));
1557 if (!l->
co)
t_error(
"allocation failure in new_intbin()");
1566 for(i=1;i<=indx->
nh; i++){
1581 l->
co[1]=(
int *)malloc((
size_t) ((sum+
NR_END)*
sizeof(
int)));
1584 if(!(l->
co[1]))
t_error(
"allocation failure 2 in new_intbin()");
1596 for(i=2;i<=indx->
nh; i++){
1599 l->
co[i]=l->
co[i-1]+indx->
co[i-1];
1656 if (!l)
t_error(
"allocation failure in new_shortbin()");
1671 t_error(
"Not a proper index for shortbin");
1692 for(i=indx->
nl;i<=indx->nh;i++){
1707 l->
co=(
short **)malloc((
size_t) ((indx->
nh+
NR_END)*
sizeof(
short *)));
1710 if (!l->
co)
t_error(
"allocation failure in new_shortbin()");
1719 for(i=1;i<=indx->
nh; i++){
1734 l->
co[1]=(
short *)malloc((
size_t) ((sum+
NR_END)*
sizeof(
short)));
1737 if(!(l->
co[1]))
t_error(
"allocation failure 2 in new_shortbin()");
1749 for(i=2;i<=indx->
nh; i++){
1752 l->
co[i]=l->
co[i-1]+indx->
co[i-1];
1806 if (!l)
t_error(
"allocation failure in new_longbin()");
1821 t_error(
"Not a proper index for longbin");
1842 for(i=indx->
nl;i<=indx->nh;i++){
1857 l->
co=(
long **)malloc((
size_t) ((indx->
nh+
NR_END)*
sizeof(
long *)));
1860 if (!l->
co)
t_error(
"allocation failure in new_longbin()");
1869 for(i=1;i<=indx->
nh; i++){
1884 l->
co[1]=(
long *)malloc((
size_t) ((sum+
NR_END)*
sizeof(
long)));
1887 if(!(l->
co[1]))
t_error(
"allocation failure 2 in new_longbin()");
1899 for(i=2;i<=indx->
nh; i++){
1902 l->
co[i]=l->
co[i-1]+indx->
co[i-1];
1956 if (!l)
t_error(
"allocation failure in new_doublebin()");
1971 t_error(
"Not a proper index for doublebin");
1992 for(i=indx->
nl;i<=indx->nh;i++){
2007 l->
co=(
double **)malloc((
size_t) ((indx->
nh+
NR_END)*
sizeof(
double *)));
2010 if (!l->
co)
t_error(
"allocation failure in new_doublebin()");
2019 for(i=1;i<=indx->
nh; i++){
2034 l->
co[1]=(
double *)malloc((
size_t) ((sum+
NR_END)*
sizeof(
double)));
2037 if(!(l->
co[1]))
t_error(
"allocation failure 2 in new_doublebin()");
2049 for(i=2;i<=indx->
nh; i++){
2052 l->
co[i]=l->
co[i-1]+indx->
co[i-1];
2126 if (!l)
t_error(
"allocation failure in new_stringcontainer()");
2146 t_error(
"Not a proper index for stringcontainer");
2170 for(i=indx->
nl;i<=indx->nh;i++){
2181 l->
co=(
char **)malloc((
size_t) ((indx->
nh+
NR_END)*
sizeof(
char *)));
2185 if (!l->
co)
t_error(
"allocation failure in new_stringcontainer()");
2197 for(i=1;i<=indx->
nh; i++){
2216 l->
co[1]=(
char *)malloc((
size_t) ((sum+
NR_END)*
sizeof(
char)));
2220 if(!(l->
co[1]))
t_error(
"allocation failure 2 in new_stringcontainer()");
2236 for(i=2;i<=indx->
nh; i++){
2240 l->
co[i]=l->
co[i-1]+indx->
co[i-1];
2661 if(v==NULL || v->
co==NULL){
2667 t_error(
"This vector was never allocated");
2706 printf(
"\nWarning::An attemp was made to free a non dynamic vector\n");
2736 if(v==NULL || v->
co==NULL){
2742 t_error(
"This vector was never allocated");
2781 printf(
"\nWarning::An attemp was made to free a non dynamic vector\n");
2811 if(v==NULL || v->
co==NULL){
2817 t_error(
"This vector was never allocated");
2856 printf(
"\nWarning::An attemp was made to free a non dynamic vector\n");
2886 if(v==NULL || v->
co==NULL){
2892 t_error(
"This vector was never allocated");
2931 printf(
"\nWarning::An attemp was made to free a non dynamic vector\n");
2964 if(v==NULL || v->
co==NULL){
2970 t_error(
"This vector was never allocated");
3009 printf(
"\nWarning::An attemp was made to free a non dynamic vector\n");
3039 if(v==NULL || v->
co==NULL){
3045 t_error(
"This vector was never allocated\n");
3084 printf(
"\nWarning::An attemp was made to free a non dynamic vector\n");
3114 if(m==NULL || m->
co==NULL){
3120 t_error(
"This matrix was never allocated");
3159 printf(
"\nWarning::An attemp was made to free a non dynamic matrix\n");
3192 if(m==NULL || m->
co==NULL){
3198 t_error(
"This matrix was never allocated");
3237 printf(
"\nWarning::An attemp was made to free a non dynamic matrix\n");
3273 if(m==NULL || m->
co==NULL){
3279 t_error(
"This matrix was never allocated");
3318 printf(
"\nWarning::An attemp was made to free a non dynamic matrix\n");
3351 if(m==NULL || m->
co==NULL){
3357 t_error(
"This matrix was never allocated");
3396 printf(
"\nWarning::An attemp was made to free a non dynamic matrix\n");
3426 if(m==NULL || m->
co==NULL){
3432 t_error(
"This matrix was never allocated");
3471 printf(
"\nWarning::An attemp was made to free a non dynamic matrix\n");
3503 if(l==NULL || l->
co==NULL || l->
co[1]==NULL){
3505 printf(
"\nWarning::Cannot de-allocate a null intbin\n");
3510 (l->
index)->isdynamic!=1){
3513 t_error(
"Wrong index in intbin");
3555 printf(
"\nWarning::An attemp was made to free a non dynamic variable\n");
3586 if(l==NULL || l->
co==NULL || l->
co[1]==NULL){
3588 printf(
"\nWarning::Cannot de-allocate a null shortbin\n");
3593 (l->
index)->isdynamic!=1){
3596 t_error(
"Wrong index in shortbin");
3638 printf(
"\nWarning::An attemp was made to free a non dynamic variable\n");
3668 if(l==NULL || l->
co==NULL || l->
co[1]==NULL){
3671 t_error(
" Cannot de-allocate a null longbin");
3680 (l->
index)->isdynamic!=1){
3683 t_error(
"Wrong index in longbin");
3725 printf(
"\nWarning::An attemp was made to free a non dynamic variable\n");
3754 if(l==NULL || l->
co==NULL || l->
co[1]==NULL){
3757 t_error(
" Cannot de-allocate a null doublebin");
3766 (l->
index)->isdynamic!=1){
3769 t_error(
"Wrong index in doublebin");
3811 printf(
"\nWarning::An attemp was made to free a non dynamic variable\n");
3849 if(l==NULL || l->
co==NULL || l->
co[1]==NULL){
3853 printf(
"\nWarning::Cannot de-allocate a null stringbin\n");
3865 (l->
index)->isdynamic!=1){
3869 t_error(
"Wrong index in stringcontainer");
3925 printf(
"\nWarning::An attemp was made to free a non dynamic variable\n");
3966 if(strcmp(H.
name,
"NOLABEL")){
3978 printf(
"\nWarning::An attempt was made to free a NULL string\n");