19 t_error(
"This vector cannot be allocated");
27 t_error(
"This matrix is not properly allocated");
58 t_error(
"This vector cannot be allocated");
66 t_error(
"This matrix is not properly allocated");
95 t_error(
"This vector cannot be allocated");
103 t_error(
"This matrix is not properly allocated");
131 t_error(
"This vector cannot be allocated");
139 t_error(
"This matrix is not properly allocated");
165 unsigned int i,ir,j,l;
179 ra->
co[ir]=ra->
co[1];
188 if(j<ir && ra->
co[j] < ra->
co[j+1]) j++;
206 unsigned int i,ir,j,l;
221 ra->
co[ir]=ra->
co[1];
223 rb->
co[ir]=rb->
co[1];
234 if(j<ir && ra->
co[j] < ra->
co[j+1]) j++;
257 unsigned int i,ir,j,l;
272 ra->
co[ir]=ra->
co[1];
274 rb->
co[ir]=rb->
co[1];
285 if(j<ir && ra->
co[j] < ra->
co[j+1]) j++;
306 unsigned int i,ir,j,l;
322 ra->
co[ir]=ra->
co[1];
324 rb->
co[ir]=rb->
co[1];
335 if(j<ir && ra->
co[j] < ra->
co[j+1]) j++;
374 double delta,min,max,tmp;
376 XYZ *bins,*head,*pre;
379 if(N <0 )
t_error(
"A negative number of bins is not allowed");
388 while(count <=U->nh){
390 while(U->
co[count]==U->
co[count-1] && count <=U->nh){
396 bins->
x=count-count1;
399 bins->
y=U->
co[count-1];
409 while(bins->
x < mn && bins->
next!=NULL){
423 printf(
"\nWarning::Obtaining just one bin\n");
442 if(head->
x <N) printf(
"\nWarning::Some bin are remaining empty\n");
445 delta=( U->
co[U->
nh]-head->
next->
y)/(N-1);
446 max=U->
co[U->
nh]+0.5*delta;
447 min=head->
next->
y-0.5*delta;
453 indx->
co[j][3]=min+j*delta;
456 while(bins->
y<=min+j*delta){
458 indx->
co[j][2]=(indx->
co[j][1]*indx->
co[j][2]+bins->
y*bins->
x)/tmp;
461 if(bins==NULL)
break;
484 double logdelta,min,max,tmp,logbase;
486 XYZ *bins,*head,*pre;
489 if(N <0 )
t_error(
"A negative number of bins is not allowed");
498 while(count <=U->nh){
500 while(U->
co[count]==U->
co[count-1] && count <=U->nh){
506 bins->
x=count-count1;
509 bins->
y=U->
co[count-1];
519 while(bins->
x < mn && bins->
next!=NULL){
533 printf(
"\nWarning::Obtaining just one bin\n");
554 if(head->
x <N) printf(
"\nWarning::Some bin is remaining empty\n");
557 logdelta=(log( U->
co[U->
nh])-log(head->
next->
y))/(logbase*(N-1));
558 max=log(U->
co[U->
nh])/log(base)+0.5*logdelta;
559 min=log(head->
next->
y)/logbase-0.5*logdelta;
566 indx->
co[j][3]=pow(base,min+j*logdelta);
569 while(log(bins->
y)/logbase<=min+j*logdelta){
571 indx->
co[j][2]=(indx->
co[j][1]*indx->
co[j][2]+bins->
y*bins->
x)/tmp;
574 if(bins==NULL)
break;
597 if(head==NULL || indx==NULL){
599 t_error(
"Inputs are not properly allocated");
601 }
else if(head->
x!=indx->
nrh) {
603 t_error(
"Inputs do not have the same dimensions");
608 for(i=1;i<=head->
x;i++){
609 if(tmp==NULL)
t_error(
"Something was wrong here");
610 indx->
co[i][1]=tmp->
x;
611 indx->
co[i][2]=tmp->
y;
626 if(head==NULL || indx==NULL){
628 t_error(
"Inputs are not properly allocated");
630 }
else if(head->
x!=indx->
nrh) {
632 t_error(
"Inputs do not have the same dimensions");
637 for(i=1;i<=head->
x;i++){
638 if(tmp==NULL)
t_error(
"Something was wrong here");
639 indx->
co[i][1]=tmp->
x;
640 indx->
co[i][2]=tmp->
y;
641 indx->
co[i][3]=tmp->
z;
656 for(i=1;i<=L->
nh;i++){
660 t_error(
"This vector was no properly allocated");
663 t_error(
"A null vector was addressed");
676 for(i=1;i<=L->
nh;i++){
680 t_error(
"This vector was no properly allocated");
683 t_error(
"A null vector was addressed");
696 for(i=1;i<=L->
nh;i++){
700 t_error(
"This vector was no properly allocated");
703 t_error(
"A null vector was addressed");
716 for(i=1;i<=L->
nh;i++){
720 t_error(
"This vector was no properly allocated");
723 t_error(
"A null vector was addressed");
736 for(i=1;i<=L->
nrh;i++){
737 for(j=1;j<=L->
nch;j++){
742 t_error(
"This matrix was no properly allocated");
745 t_error(
"A null matrix was addressed");
759 for(i=1;i<=L->
nrh;i++){
760 for(j=1;j<=L->
nch;j++){
765 t_error(
"This matrix was no properly allocated");
768 t_error(
"A null matrix was addressed");
782 for(i=1;i<=L->
nrh;i++){
783 for(j=1;j<=L->
nch;j++){
788 t_error(
"This matrix was no properly allocated");
791 t_error(
"A null matrix was addressed");
804 for(i=1;i<=L->
nrh;i++){
805 for(j=1;j<=L->
nch;j++){
810 t_error(
"This matrix was no properly allocated");
813 t_error(
"A null matrix was addressed");
826 if(origin==NULL || destination==NULL || origin->
co==NULL || destination->
co==NULL){
828 t_error(
"A matrix was not allocated");
832 t_error(
"A matrix was not allocated properly");
834 }
else if( origin->
nrh != destination->
nrh || origin->
nch != destination->
nch ){
836 t_error(
"The matrixes do not have the same dimensions");
840 for(i=1;i<=origin->
nrh;i++){
841 for(j=1;j<=origin->
nch;j++){
843 destination->
co[i][j]=origin->
co[i][j];
858 if(origin==NULL || destination==NULL || origin->
co==NULL || destination->
co==NULL){
860 t_error(
"A matrix was not allocated");
864 t_error(
"A matrix was not allocated properly");
866 }
else if( origin->
nrh != destination->
nrh || origin->
nch != destination->
nch ){
868 t_error(
"The matrixes do not have the same dimensions");
872 for(i=1;i<=origin->
nrh;i++){
873 for(j=1;j<=origin->
nch;j++){
875 destination->
co[i][j]=origin->
co[i][j];
894 if(origin==NULL || destination==NULL || origin->
co==NULL || destination->
co==NULL){
896 t_error(
"A matrix was not allocated");
900 t_error(
"A matrix was not allocated properly");
902 }
else if( origin->
nrh != destination->
nrh || origin->
nch != destination->
nch ){
904 t_error(
"The matrixes do not have the same dimensions");
908 for(i=1;i<=origin->
nrh;i++){
909 for(j=1;j<=origin->
nch;j++){
911 destination->
co[i][j]=origin->
co[i][j];
928 if(origin==NULL || destination==NULL || origin->
co==NULL || destination->
co==NULL){
930 t_error(
"A matrix was not allocated");
934 t_error(
"A matrix was not allocated properly");
936 }
else if( origin->
nrh != destination->
nrh || origin->
nch != destination->
nch ){
938 t_error(
"The matrixes do not have the same dimensions");
942 for(i=1;i<=origin->
nrh;i++){
943 for(j=1;j<=origin->
nch;j++){
945 destination->
co[i][j]=origin->
co[i][j];
961 if(origin==NULL || destination==NULL || origin->
co==NULL || destination->
co==NULL){
963 t_error(
"A matrix was not allocated");
967 t_error(
"A matrix was not allocated properly");
969 }
else if( origin->
nrh != destination->
nrh || origin->
nch != destination->
nch ){
971 t_error(
"The matrixes do not have the same dimensions");
975 for(i=1;i<=origin->
nrh;i++){
976 for(j=1;j<=origin->
nch;j++){
978 destination->
co[i][j]=origin->
co[i][j];
996 if(origin==NULL || destination==NULL || origin->
co==NULL || destination->
co==NULL){
998 t_error(
"A vector was not allocated");
1002 t_error(
"A vector was not allocated properly");
1004 }
else if( origin->
nh != destination->
nh ){
1006 t_error(
"The vector do not have the same dimensions");
1010 for(i=1;i<=origin->
nh;i++){
1013 destination->
co[i]=origin->
co[i];
1028 if(origin==NULL || destination==NULL || origin->
co==NULL || destination->
co==NULL){
1030 t_error(
"A vector was not allocated");
1034 t_error(
"A vector was not allocated properly");
1036 }
else if( origin->
nh != destination->
nh ){
1038 t_error(
"The vector do not have the same dimensions");
1042 for(i=1;i<=origin->
nh;i++){
1045 destination->
co[i]=origin->
co[i];
1061 if(origin==NULL || destination==NULL || origin->
co==NULL || destination->
co==NULL){
1063 t_error(
"A vector was not allocated");
1067 t_error(
"A vector was not allocated properly");
1069 }
else if( origin->
nh != destination->
nh ){
1071 t_error(
"The vector do not have the same dimensions");
1075 for(i=1;i<=origin->
nh;i++){
1078 destination->
co[i]=origin->
co[i];
1094 if(origin==NULL || destination==NULL || origin->
co==NULL || destination->
co==NULL){
1096 t_error(
"A vector was not allocated");
1100 t_error(
"A vector was not allocated properly");
1102 }
else if( origin->
nh != destination->
nh ){
1104 t_error(
"The vector do not have the same dimensions");
1108 for(i=1;i<=origin->
nh;i++){
1111 destination->
co[i]=origin->
co[i];
1126 if(origin==NULL || destination==NULL || origin->
co==NULL || destination->
co==NULL){
1128 t_error(
"A vector was not allocated");
1132 t_error(
"A vector was not allocated properly");
1134 }
else if( origin->
nh != destination->
nh ){
1136 t_error(
"The vector do not have the same dimensions");
1140 for(i=1;i<=origin->
nh;i++){
1143 destination->
co[i]=origin->
co[i];
1158 if(dist==NULL || ca==NULL || dist->
co==NULL || ca->
co==NULL){
1159 t_error(
"Matrixes were not allocated");
1161 t_error(
"Matrixes were not properly allocated");
1163 t_error(
"These matrixes do not have the same dimensions");
1166 for(i=1;i<=dist->
nrh;i++){
1167 for(j=1;j<=dist->
nch;j++){
1168 dist->
co[i][j]*=ca->
co[i][j];
1182 if(dist==NULL || ca==NULL || dist->
co==NULL || ca->
co==NULL){
1183 t_error(
"Matrixes were not allocated");
1185 t_error(
"Matrixes were not properly allocated");
1187 t_error(
"These matrixes do not have the same dimensions");
1190 for(i=1;i<=dist->
nrh;i++){
1191 for(j=1;j<=dist->
nch;j++){
1192 dist->
co[i][j]*=ca->
co[i][j];
1206 if(dist==NULL || ca==NULL || dist->
co==NULL || ca->
co==NULL){
1207 t_error(
"Matrixes were not allocated");
1209 t_error(
"Matrixes were not properly allocated");
1211 t_error(
"These matrixes do not have the same dimensions");
1214 for(i=1;i<=dist->
nrh;i++){
1215 for(j=1;j<=dist->
nch;j++){
1216 dist->
co[i][j]*=ca->
co[i][j];
1231 if(dist==NULL || ca==NULL || dist->
co==NULL || ca->
co==NULL){
1232 t_error(
"Matrixes were not allocated");
1234 t_error(
"Matrixes were not properly allocated");
1236 t_error(
"These matrixes do not have the same dimensions");
1239 for(i=1;i<=dist->
nrh;i++){
1240 for(j=1;j<=dist->
nch;j++){
1241 dist->
co[i][j]*=ca->
co[i][j];
1255 if(dist==NULL || ca==NULL || dist->
co==NULL || ca->
co==NULL){
1256 t_error(
"Vectors were not allocated");
1258 t_error(
"Vectors were not properly allocated");
1259 }
else if(dist->
nh !=ca->
nh ) {
1260 t_error(
"These vectors do not have the same dimensions");
1263 for(i=1;i<=dist->
nh;i++){
1264 dist->
co[i]*=ca->
co[i];
1277 if(dist==NULL || ca==NULL || dist->
co==NULL || ca->
co==NULL){
1278 t_error(
"Vectors were not allocated");
1280 t_error(
"Vectors were not properly allocated");
1281 }
else if(dist->
nh !=ca->
nh ) {
1282 t_error(
"These vectors do not have the same dimensions");
1285 for(i=1;i<=dist->
nh;i++){
1286 dist->
co[i]*=ca->
co[i];
1299 if(dist==NULL || ca==NULL || dist->
co==NULL || ca->
co==NULL){
1300 t_error(
"Vectors were not allocated");
1302 t_error(
"Vectors were not properly allocated");
1303 }
else if(dist->
nh !=ca->
nh ) {
1304 t_error(
"These vectors do not have the same dimensions");
1307 for(i=1;i<=dist->
nh;i++){
1308 dist->
co[i]*=ca->
co[i];
1321 if(dist==NULL || ca==NULL || dist->
co==NULL || ca->
co==NULL){
1322 t_error(
"Vectors were not allocated");
1324 t_error(
"Vectors were not properly allocated");
1325 }
else if(dist->
nh !=ca->
nh ) {
1326 t_error(
"These vectors do not have the same dimensions");
1329 for(i=1;i<=dist->
nh;i++){
1330 dist->
co[i]*=ca->
co[i];
1347 t_error(
"Matrixes do not have proper dimensions");
1352 for(i=1;i<=iv->
nrh;i++){
1353 for(j=1;j<=iv->
nch;j++){
1354 if(ov->
co[i][j] >= V->
co[2]){
1355 iv->
co[i][j]=U->
co[2];
1361 }
else if(V->
co[1] <0){
1363 for(i=1;i<=iv->
nrh;i++){
1364 for(j=1;j<=iv->
nch;j++){
1365 if(ov->
co[i][j] <= V->
co[2]){
1366 iv->
co[i][j]=U->
co[2];
1374 for(i=1;i<=iv->
nrh;i++){
1375 for(j=1;j<=iv->
nch;j++){
1376 if(ov->
co[i][j] == V->
co[2]){
1377 iv->
co[i][j]=U->
co[2];
1395 double delta,min,max;
1396 long i,count,count1,minposition,maxposition,bin_vuoti,num_max;
1412 printf(
"This options is memory expensive\n");
1413 printf(
"ENTER THE MAXIMUM NUMBER OF ALLOWED BIN\n");
1414 scanf(
"%ld",&num_max);
1416 while(count <= U->nh){
1417 while(U->
co[count]==U->
co[count-1] && count <=U->nh){
1426 bins->
i=count-count1;
1432 if(head->
i>num_max)
t_error(
"Il numero di bin eccede il numero massimo che hai consentito");
1437 if(novalue->
co[1]==0){
1440 }
else if(novalue->
co[1]==-1){
1444 while(U->
co[minposition]<=novalue->
co[2]){
1447 min=U->
co[minposition];
1452 maxposition=U->
nh-1;
1453 while(U->
co[maxposition]>=novalue->
co[2]){
1458 max=U->
co[maxposition];
1463 printf(
"THE MINIMUM VALUE IS %f\n",min);
1464 printf(
"THE MAXIMUM VALUE IS %f\n",max);
1465 delta=(max-min)/(N-1);
1466 printf(
"DELTA IS%f\n",delta);
1472 count=minposition+1;
1475 while(count <= maxposition){
1476 if(U->
co[count] < min+0.5*delta){
1477 while(U->
co[count] < min+0.5*delta && count<=maxposition){
1483 bins->
i=count-count1;
1495 printf(
"\nWarning:: An empty bin was encountered\n");
1500 printf(
"\nThere was look for (%ld) empty bins\n",bin_vuoti);
1505 if (!l)
t_error(
"allocation failure in new_doublebin()");
1508 t_error(
"Something wrong happened in binning");
1514 for(i=1;i<=head->i;i++){
1517 if(bins==NULL)
break;
1519 l->
co=(
double **)malloc((
size_t) ((l->
index->
nh+
NR_END)*
sizeof(
double *)));
1520 if (!l->
co)
t_error(
"allocation failure in new_doublebin()");
1523 l->
co[1]=U->
co+minposition-1;
1524 if(!(l->
co[1]))
t_error(
"Failure in splitting this vector");
1528 for(i=2;i<=l->
index->
nh; i++){
1529 l->
co[i]=l->
co[i-1]+bins->
i;
1531 if(bins==NULL)
break;
1558 double min,max,logdelta,logbase,logmin;
1559 long i,count,count1,minposition,maxposition,bin_vuoti,num_max;
1568 logbase=log10(base);
1571 printf(
"This options is memory expensive\n");
1572 printf(
"ENTER THE MAXIMUM NUMBER OF ALLOWED BIN\n");
1573 scanf(
"%ld",&num_max);
1580 while(count <= U->nh){
1581 while(U->
co[count]==U->
co[count-1] && count <=U->nh){
1587 bins->
i=count-count1;
1596 if(head->
i>num_max)
t_error(
"Il numero di bin eccede il numero massimo che hai consentito");
1599 if(novalue->
co[1]==0){
1601 if(U->
co[minposition] <=0){
1602 while(U->
co[minposition]<=0){
1604 if( minposition > U->
nh)
t_error(
"No valid data for esponential binning");
1608 }
else if(novalue->
co[1]==-1){
1612 while(U->
co[minposition]<=novalue->
co[2]){
1616 min=U->
co[minposition];
1619 maxposition=U->
nh-1;
1620 while(U->
co[maxposition]>=novalue->
co[2]){
1625 max=U->
co[maxposition];
1630 printf(
"THE MINIMUM VALUE IS %f\n",min);
1631 printf(
"THE MAXIMUM VALUE IS %f\n",max);
1632 logdelta=(log10(max)-log10(min))/(logbase*(N-1));
1633 printf(
"LOG_10 DELTA IS%f\n",logdelta);
1639 count=minposition+1;
1643 while(count <= maxposition){
1644 if(log10(U->
co[count]) < logmin+0.5*logdelta){
1645 while(log10(U->
co[count]) < logmin+0.5*logdelta && count<=maxposition){
1651 bins->
i=count-count1;
1662 printf(
"\nWarning:: An empty bin was encountered\n");
1667 printf(
"\nThere was look for (%ld) empty bins\n",bin_vuoti);
1672 if (!l)
t_error(
"allocation failure in new_doublebin()");
1675 t_error(
"Something wrong happened in binning");
1681 for(i=1;i<=head->i;i++){
1684 if(bins==NULL)
break;
1686 l->
co=(
double **)malloc((
size_t) ((l->
index->
nh+
NR_END)*
sizeof(
double *)));
1687 if (!l->
co)
t_error(
"allocation failure in new_doublebin()");
1690 l->
co[1]=U->
co+minposition-1;
1691 if(!(l->
co[1]))
t_error(
"Failure in splitting this vector");
1695 for(i=2;i<=l->
index->
nh; i++){
1696 l->
co[i]=l->
co[i-1]+bins->
i;
1698 if(bins==NULL)
break;
1724 double delta,min,max;
1725 long i,count,count1,minposition,maxposition,bin_vuoti;
1739 while(count <= U->nh){
1740 while(U->
co[count]==U->
co[count-1] && count <=U->nh){
1746 bins->
i=count-count1;
1755 if(head->
i>num_max)
t_error(
"Il numero di bin eccede il numero massimo che hai consentito");
1760 if(novalue->
co[1]==0){
1763 }
else if(novalue->
co[1]==-1){
1768 while(U->
co[minposition]<=novalue->
co[2]){
1773 min=U->
co[minposition];
1776 maxposition=U->
nh-1;
1777 while(U->
co[maxposition]>=novalue->
co[2]){
1782 max=U->
co[maxposition];
1787 printf(
"THE MINIMUM VALUE IS %f\n",min);
1788 printf(
"THE MAXIMUM VALUE IS %f\n",max);
1789 delta=(max-min)/(N-1);
1790 printf(
"DELTA IS%f\n",delta);
1796 count=minposition+1;
1798 while(count <= maxposition){
1799 if(U->
co[count] < min +0.5*delta){
1800 while(U->
co[count] < min+0.5*delta && count<=maxposition){
1805 bins->
i=count-count1;
1817 printf(
"\nWarning:: An empty bin was encountered\n");
1822 printf(
"\nThere was look for (%ld) empty bins\n",bin_vuoti);
1827 t_error(
"Something wrong happened in binning");
1837 for(i=1;i<=head->i;i++){
1839 (m->
index)->co[i]=bins->
i;
1841 if(bins==NULL)
break;
1843 l->
co=(
double **)malloc((
size_t) ((l->
index->
nh+
NR_END)*
sizeof(
double *)));
1844 m->
co=(
double **)malloc((
size_t) ((m->
index->
nh+
NR_END)*
sizeof(
double *)));
1846 if (!l->
co || !m->
co)
t_error(
"allocation failure in new_doublebin()");
1848 l->
co[1]=U->
co+minposition-1;
1850 m->
co[1]=T->
co+minposition-1;
1852 if(!(l->
co[1]) || !(m->
co[1]))
t_error(
"Failure in splitting this vector");
1859 for(i=2;i<=l->
index->
nh; i++){
1860 l->
co[i]=l->
co[i-1]+bins->
i;
1861 m->
co[i]=m->
co[i-1]+bins->
i;
1863 if(bins==NULL)
break;
1894 double min,max,logdelta,logbase,logmin;
1895 long i,j,count,count1,minposition,maxposition,bin_vuoti;
1901 logbase=log10(base);
1910 while(count <= U->nh){
1911 while(U->
co[count]==U->
co[count-1] && count <=U->nh){
1917 bins->
i=count-count1;
1926 if(head->
i>num_max)
t_error(
"Il numero di bin eccede il numero massimo che hai consentito");
1929 if(novalue->
co[1]==0){
1931 if(U->
co[minposition] <=0){
1932 while(U->
co[minposition]<=0){
1934 if( minposition > U->
nh)
t_error(
"No valid data for esponential binning");
1938 }
else if(novalue->
co[1]==-1){
1942 while(U->
co[minposition]<=novalue->
co[2]){
1945 min=U->
co[minposition];
1948 maxposition=U->
nh-1;
1949 while(U->
co[maxposition]>=novalue->
co[2]){
1954 max=U->
co[maxposition];
1958 printf(
"THE MINIMUM VALUE IS \t%f\n",min);
1959 printf(
"THE MAXIMUM VALUE IS \t%f\n",max);
1960 logdelta=(log10(max)-log10(min))/(logbase*(N-1));
1961 printf(
"LOG_10 DELTA IS \t%f\t",logdelta);
1967 count=minposition+1;
1972 while(count <= maxposition){
1976 if(log10(U->
co[count])<=logmin+0.5*logdelta){
1977 while(log10(U->
co[count]) <= logmin+0.5*logdelta && count<=maxposition){
1982 bins->
i=count-count1;
1991 printf(
"\nWarning:: An empty bin was encountered\n");
1996 printf(
"\nThere was look for (%ld) empty bins\n",bin_vuoti);
2000 t_error(
"Something wrong happened in binning");
2009 for(i=1;i<=head->i;i++){
2011 (m->
index)->co[i]=bins->
i;
2013 if(bins==NULL)
break;
2015 l->
co=(
double **)malloc((
size_t) ((l->
index->
nh+
NR_END)*
sizeof(
double *)));
2016 m->
co=(
double **)malloc((
size_t) ((m->
index->
nh+
NR_END)*
sizeof(
double *)));
2018 if (!l->
co || !m->
co)
t_error(
"allocation failure in new_doublebin()");
2020 l->
co[1]=U->
co+minposition-1;
2022 m->
co[1]=W->
co+minposition-1;
2024 if(!(l->
co[1]) || !(m->
co[1]))
t_error(
"Failure in splitting this vector");
2031 for(i=2;i<=l->
index->
nh; i++){
2032 l->
co[i]=l->
co[i-1]+bins->
i;
2033 m->
co[i]=m->
co[i-1]+bins->
i;
2035 if(bins==NULL)
break;
2071 for(i=1;i<=data->
nrh;i++){
2073 if(data->
co[i][2] > Q->
co[2]){
2077 }
else if(Q->
co[1]>0){
2079 for(i=1;i<=data->
nrh;i++){
2081 if(data->
co[i][2] < Q->
co[2]){
2088 for(i=1;i<=data->
nrh;i++){
2090 if(data->
co[i][2] != Q->
co[2]){
2105 for(i=1;i<=data->
nrh;i++){
2107 if(data->
co[i][2] > Q->
co[2]){
2108 newm->
co[count][1]=data->
co[i][1];
2109 newm->
co[count][2]=data->
co[i][2];
2114 }
else if(Q->
co[1]>0){
2116 for(i=1;i<=data->
nrh;i++){
2118 if(data->
co[i][2] < Q->
co[2]){
2119 newm->
co[count][1]=data->
co[i][1];
2120 newm->
co[count][2]=data->
co[i][2];
2127 for(i=1;i<=data->
nrh;i++){
2129 if(data->
co[i][2] != Q->
co[2]){
2130 newm->
co[count][1]=data->
co[i][1];
2131 newm->
co[count][2]=data->
co[i][2];
2155 for(i=1;i<=cleandata->
nrh-1;i++){
2156 W->
co[i][1]=(cleandata->
co[i+1][2]-cleandata->
co[i][2])/(cleandata->
co[i+1][1]-cleandata->
co[i][1]);
2157 W->
co[i][2]=cleandata->
co[i][2]-W->
co[i][1]*cleandata->
co[i][1];
2207 if(x< cleandata->
co[1][1] || x>cleandata->
co[cleandata->
nrh][1] ){
2209 }
else if ( x <= cleandata->
co[count][1]){
2210 while(x <= cleandata->
co[count][1]){
2218 y=W->
co[count][1]*x+W->
co[count][2];
2242 time=floor(istante/dt);
2244 if((istante/dt-time)==0){
2250 if(i1<1)
t_error(
"tempo troppo basso");
2251 if(i1>=matrice->
nrh)
t_error(
"tempo troppo alto");
2252 resto=(istante-(i1-1)*dt)/dt;
2253 for(j=1;j<=matrice->
nch;j++){
2254 vettore->
co[j]=matrice->
co[i1][j]+(matrice->
co[i1+1][j]-matrice->
co[i1][j])*resto;
2276 time=floor(istante/dt);
2278 if((istante/dt-time)==0){
2285 printf(
"istant=%f\n",istante);
2286 t_error(
"tempo troppo basso");
2288 if(i1>=matrice->
nrh){
2289 printf(
"istant=%f,imax=%f\n",istante,(matrice->
nrh-1)*dt);
2292 resto=(istante-(i1-1)*dt)/dt;
2293 for(j=1;j<=matrice->
nch;j++){
2294 vettore->
co[j]=matrice->
co[i1][j]+(matrice->
co[i1+1][j]-matrice->
co[i1][j])*resto;
2307 for(i=1;i<=net->
nrh;i++){
2308 mean+=net->
co[i][column];
2311 return mean/=net->
nrh;
2325 for(i=1;i<=net->
nrh;i++){
2326 variance+=(net->
co[i][column]-mean)*(net->
co[i][column]-mean);
2329 return variance/=net->
nrh;
2339 return number-fabs(fmod(number,div));
2349 DOUBLEMATRIX *result, *coeff, *xy, *interval, *trapezio;
2364 for(i=1;i<=cleandata->
nrh;i++){
2365 xy->
co[i][1]=cleandata->
co[i][1];
2375 printf(
"ti2=%f,dt2=%f,n2=%ld,dt1=%f \n",ti2,dt2,n2,dt1);
2380 result->
co[i][1]=ti2+dt2/2.+(i-1)*dt2;
2390 for(i=1;i<=n2+1;i++){
2392 interval->
co[i][1]=ti2+(i-1)*dt2;
2407 for(j=2;j<=cleandata->
nch;j++){
2410 for(i=1;i<=cleandata->
nrh;i++){
2411 xy->
co[i][2]=cleandata->
co[i][j];
2426 perc=(i+(j-1)*n2)/((float)(cleandata->
nch*n2))*100.;
2428 printf(
"computation %4.1f perc\n",perc);
2433 trapezio->
co[1][1]=interval->
co[i][1];
2434 for(k=1;k<=xy->
nrh;k++){
2435 if((xy->
co[k][1]>interval->
co[i][1])&&(xy->
co[k][1]<interval->
co[i+1][1])){
2437 trapezio->
co[nint][1]=xy->
co[k][1];
2441 trapezio->
co[nint][1]=interval->
co[i+1][1];
2444 for(k=1;k<=nint;k++){
2448 if(trapezio->
co[1][1]==xy->
co[1][1]){
2449 trapezio->
co[1][2]=xy->
co[1][2];
2474 long i,j,h,k,row2,row1;
2477 row1=cleandata->
nrh;
2483 for(j=1;j<=result->
nch;j++){
2484 for(i=1;i<=result->
nrh;i++){
2485 for(k=1;k<=nint;k++){
2487 result->
co[i][j]+=cleandata->
co[h][j];
2489 result->
co[i][j]/=(float)nint;
2509 mean+=(data->
co[i+1][2]+data->
co[i][2])*
2510 (data->
co[i+1][1]-data->
co[i][1]);
2514 return mean/=(2.*(data->
co[n][1]-data->
co[1][1]));
2525 double nv, x_i, x_f;
2533 for(j=1;j<=data->
nch;j++){
2541 while(data->
co[i][j]!=nv && i<data->nrh) i++;
2542 x_i=data->
co[i-1][j];
2544 if(i==data->
nrh) n_i=0;
2546 while(data->
co[i][j]==nv && i<data->nrh) i++;
2550 fill_data(cleandata,control,j,n_i,n_f,x_i,x_f);
2576 cleandata->
co[n_i+i][j]=x_i+m*i;
2577 control->
co[n_i+i][j]=1;
2594 long i,j,nrows,count,num;
2602 for(i=2;i<=data->
nrh;i++){
2603 if(data->
co[i-1][col]!=data->
co[i][col]) nrows++;
2608 for(j=1;j<=data->
nch;j++){
2609 if(data->
co[1][j]!=nv){
2610 result->
co[1][j]=data->
co[1][j];
2612 result->
co[1][j]=nv;
2615 result->
co[1][data->
nch+1]=1;
2619 for(i=2;i<=data->
nrh;i++){
2620 if(data->
co[i-1][col]!=data->
co[i][col]) {
2621 for(j=1;j<=data->
nch;j++){
2622 if(result->
co[count][j]!=nv){
2623 result->
co[count][j]/=num;
2625 if(data->
co[i][j]!=nv){
2626 result->
co[count+1][j]=data->
co[i][j];
2628 result->
co[count+1][j]=nv;
2631 result->
co[count][data->
nch+1]=num;
2636 for(j=1;j<=data->
nch;j++){
2637 result->
co[count][j]+=data->
co[i][j];
2643 if(result->
co[count][j]!=nv){
2644 for(j=1;j<=data->
nch;j++){
2645 result->
co[count][j]/=num;
2648 result->
co[count][data->
nch+1]=num;