36 qSort( buks->begin(), buks->end() );
59 qreal bconc,
int bstat )
72 qreal bconc,
int bstat )
79 jx = ( jx < lx ) ? jx : lx;
81 if ( ix > (-1) && ix < bsiz )
85 else if ( ix == (-1) )
89 else if ( ix == (-2) )
110 qreal bconc,
int bstat )
116 buk.
x_min = brect.left();
117 buk.
x_max = brect.right();
118 buk.
y_min = brect.bottom();
119 buk.
y_max = brect.top();
144 jx = ( jx < lx ) ? jx : lx;
146 if ( ix > (-1) && ix < bsiz )
151 else if ( ix == (-1) )
156 else if ( ix == (-2) )
161 else if ( ix == (-3) )
192 qreal x1 = buk.
x_min;
193 qreal x2 = buk.
x_max;
194 qreal y1 = buk.
y_min;
195 qreal y2 = buk.
y_max;
209 return QRectF( QPointF( x1, y1 ), QPointF( x2, y2 ) );
215 qreal x1 = buk.
x_min;
216 qreal x2 = buk.
x_max;
217 qreal y1 = buk.
y_min;
218 qreal y2 = buk.
y_max;
220 QPointF mpt( ( x1 + x2 ) / 2.0, ( y1 + y2 ) / 2.0 );
239 xext = ( xext > 0.0 ) ? xext : -xext;
241 yext = ( yext > 0.0 ) ? yext : -yext;
242 QSizeF siz( xext, yext );
248 const QString cts[] = {
"s",
"ff0",
"MW",
"vbar",
"D",
"f" };
252 QString slo = cts[
attr_x ] +
"_min";
253 QString shi = cts[
attr_x ] +
"_max";
254 QString klo = cts[
attr_y ] +
"_min";
255 QString khi = cts[
attr_y ] +
"_max";
261 "Solute Bin %1: %2=%3, %4=%5, %6=%7, %8=%9" ).arg( kx )
262 .arg( slo ).arg( buk.
x_min ).arg( shi ).arg( buk.
x_max )
263 .arg( klo ).arg( buk.
y_min ).arg( khi ).arg( buk.
y_max );
266 "Solute Bin %1: %2=%3, %4=%5, %6=%7, %8=%9" ).arg( kx )
267 .arg( klo ).arg( buk.
y_min ).arg( khi ).arg( buk.
y_max )
268 .arg( slo ).arg( buk.
x_min ).arg( shi ).arg( buk.
x_max );
272 int a_ax,
int a_ay,
int a_az )
282 qreal xm = midpt.x();
283 qreal ym = midpt.y();
286 qreal dl = xm * xm + ym * ym;
287 qreal dd = dl * 10.0;
290 for (
int ii = 0; ii <
distro->size(); ii++ )
292 qreal xs =
distro->at( ii ).s;
293 qreal ys =
distro->at( ii ).k;
296 dd = xd * xd + yd * yd;
325 #define _MIN_VHR_ 0.01
326 QList< bucket > tbuk1;
327 QList< bucket > tbuk2;
328 QList< bucket >* buks1 = &tbuk1;
329 QList< bucket >* buks2 = &tbuk2;
330 QList< qreal > cvals;
333 int nisols =
distro->size();
338 qreal wbuckh = wsbuck / 2.0;
339 qreal hbuckh = hfbuck / 2.0;
341 if ( ntsols < 2 || ntsols > nisols )
348 for (
int jj = 0; jj < nisols; jj++ )
350 qreal sval =
distro->at( jj ).s;
351 qreal kval =
distro->at( jj ).k;
352 cval =
distro->at( jj ).c;
354 buk.
x_min = sval - wbuckh;
355 buk.
x_max = sval + wbuckh;
357 buk.
y_min = kval - hbuckh;
358 buk.
y_max = kval + hbuckh;
362 buks1->append( buk );
363 cvals.append( cval );
367 qSort( cvals.begin(), cvals.end() );
370 cutlo = cvals.at( nisols - ntsols );
372 for (
int jj = 0; jj < nssols; jj++ )
374 buk = buks1->at( jj );
378 buks2->append( buk );
382 nssols = buks2->size();
384 buks1 = bukflip ? &tbuk1 : &tbuk2;
385 buks2 = bukflip ? &tbuk2 : &tbuk1;
386 bukflip = 1 - bukflip;
397 buks2->append( buks1->at( 0 ) );
399 for (
int jj = 1; jj < nssols; jj++ )
403 buk = buks1->at( jj );
406 if ( buk.
status == tstat )
408 buks2->append( buk );
412 qreal cx1 = buk.
x_min;
413 qreal cx2 = buk.
x_max;
414 qreal cy1 = buk.
y_min;
415 qreal cy2 = buk.
y_max;
417 for (
int kk = 0; kk < jj; kk++ )
419 bucket buk2 = buks1->at( kk );
420 qreal px1 = buk2.
x_min;
421 qreal px2 = buk2.
x_max;
422 qreal py1 = buk2.
y_min;
423 qreal py2 = buk2.
y_max;
428 if ( cy1 < py2 && cy2 > py2 )
433 horzr = ( px2 - cx1 ) / wsbuck;
434 vertr = ( py2 - cy1 ) / hfbuck;
437 buk2.
x_min = qMin( cx1, px2 );
438 buk2.
x_max = qMax( px2, cx1 );
439 buk2.
y_min = qMin( py2, cy2 );
440 buk2.
y_max = qMax( cy2, py2 );
444 buks2->append( buk2 );
445 else DbgLv(2) <<
"BUCKET TOO THIN H,V " << horzr <<
"," << vertr;
447 buk.
x_min = qMin( px2, cx2 );
448 buk.
x_max = qMax( cx2, px2 );
457 buk2.
y_min = qMin( py2, cy2 );
458 buk2.
y_max = qMax( cy2, py2 );
462 buks2->append( buk2 );
463 else DbgLv(2) <<
"BUCKET TOO THIN H,V " << horzr <<
"," << vertr;
465 buk.
x_min = qMin( px2, cx2 );
466 buk.
x_max = qMax( cx2, px2 );
467 buk.
y_min = qMin( cy1, py2 );
468 buk.
y_max = qMax( py2, cy1 );
470 DbgLv(2) <<
" LL OVL: novls " << novls;
474 else if ( cy2 > py1 && cy1 < py1 )
479 horzr = ( px2 - cx1 ) / wsbuck;
480 vertr = ( cy2 - py1 ) / hfbuck;
483 buk2.
x_min = qMin( cx1, px2 );
484 buk2.
x_max = qMax( px2, cx1 );
485 buk2.
y_min = qMin( cy1, py1 );
486 buk2.
y_max = qMax( py1, cy1 );
490 buks2->append( buk2 );
491 else DbgLv(2) <<
"BUCKET TOO THIN H,V " << horzr <<
"," << vertr;
493 buk.
x_min = qMin( px2, cx2 );
494 buk.
x_max = qMax( cx2, px2 );
501 buk2.
x_min = qMin( px2, cx2 );
502 buk2.
x_max = qMax( cx2, px2 );
503 buk2.
y_min = qMin( py1, cy2 );
504 buk2.
y_max = qMax( cy2, py1 );
508 buks2->append( buk2 );
509 else DbgLv(2) <<
"BUCKET TOO THIN H,V " << horzr <<
"," << vertr;
511 buk.
x_min = qMin( cx1, cx2 );
512 buk.
x_max = qMax( cx2, cx1 );
513 buk.
y_min = qMin( cy1, py1 );
514 buk.
y_max = qMax( py1, cy1 );
516 DbgLv(2) <<
" UL OVL: novls " << novls;
520 else if ( cy1 >= py1 && cy2 <= py2 )
524 buk.
x_min = qMin( px2, cx2 );
525 buk.
x_max = qMax( cx2, px2 );
526 DbgLv(2) <<
" UL OVL: novls " << novls;
530 else if ( cy2 > py2 && cy1 < py1 )
535 horzr = ( px2 - cx1 ) / wsbuck;
536 vertr = ( py2 - py1 ) / hfbuck;
539 buk2.
x_min = qMin( cx1, px2 );
540 buk2.
x_max = qMax( px2, cx1 );
541 buk2.
y_min = qMin( py1, cy2 );
542 buk2.
y_max = qMax( cy2, py1 );
546 buks2->append( buk2 );
547 else DbgLv(2) <<
"BUCKET TOO THIN H,V " << horzr <<
"," << vertr;
549 buk2.
y_min = qMin( cy1, py1 );
550 buk2.
y_max = qMax( py1, cy1 );
554 buks2->append( buk2 );
555 else DbgLv(2) <<
"BUCKET TOO THIN H,V " << horzr <<
"," << vertr;
557 buk.
x_min = qMin( px2, cx2 );
558 buk.
x_max = qMax( cx2, px2 );
565 buk2.
x_min = qMin( cx1, cx2 );
566 buk2.
x_max = qMax( cx2, cx1 );
567 buk2.
y_min = qMin( py2, cy2 );
568 buk2.
y_max = qMax( cy2, py2 );
572 buks2->append( buk2 );
573 else DbgLv(2) <<
"BUCKET TOO THIN H,V " << horzr <<
"," << vertr;
575 buk2.
y_min = qMin( cy1, py1 );
576 buk2.
y_max = qMax( py1, cy1 );
580 buks2->append( buk2 );
581 else DbgLv(2) <<
"BUCKET TOO THIN H,V " << horzr <<
"," << vertr;
583 buk.
x_min = qMin( px2, cx2 );
584 buk.
x_max = qMax( cx2, px2 );
585 buk.
y_min = qMin( py1, py2 );
586 buk.
y_max = qMax( py2, py1 );
588 DbgLv(2) <<
" UL OVL: novls " << novls;
594 else if ( cx1 == px1 )
597 if ( cy1 < py1 && cy2 > py1 )
601 buk.
y_min = qMin( cy1, py1 );
602 buk.
y_max = qMax( py1, cy1 );
603 DbgLv(2) <<
" UV OVL: novls " << novls;
611 buks2->append( buk );
612 else DbgLv(2) <<
"BUCKET TOO THIN H,V " << horzr <<
"," << vertr;
615 nssols = buks2->size();
617 buks1 = bukflip ? &tbuk1 : &tbuk2;
618 buks2 = bukflip ? &tbuk2 : &tbuk1;
619 bukflip = 1 - bukflip;
626 else if ( tstat == 1 )
638 qSort( buks1->begin(), buks1->end() );
644 for (
int jj = 0; jj < nssols; jj++ )
657 int ztype,
double fixval )
663 const QString cts[] = {
"s",
"ff0",
"MW",
"vbar",
"D",
"f" };
664 const char hfmt[] =
"%d %d %d %d %.3e";
665 const char lfmt[] =
"%.3e, %.3e, %.3e, %.3e";
666 const char* cffmt =
"%.3e";
668 QFile fileo( fname );
670 if ( fileo.open( QIODevice::WriteOnly | QIODevice::Text ) )
672 QTextStream ts( &fileo );
675 line.sprintf( hfmt, nbuk, xtype, ytype, ztype, fixval );
676 line +=
" # buckets=" + QString::number( nbuk )
677 +
" x=" + cts[ xtype ] +
" y=" + cts[ ytype ]
678 +
" fixed=" + cts[ ztype ] +
"="
680 ?
"0.0=(data_set_vbar)"
681 : QString().sprintf( cffmt, fixval ) );
684 for (
int jj = 0; jj < nbuk; jj++ )
706 int nsol =
distro->size();
711 QList< SimComp > bcomp;
722 for (
int jj = 0; jj < nsol; jj++ )
726 simc.
s = d_sol.
si * 1e-13;
739 for (
int jj = 0; jj < nbuk; jj++ )
749 for (
int kk = 0; kk < nsol; kk++ )
751 ssval =
distro->at( kk ).s;
752 sfval =
distro->at( kk ).k;
753 if ( ssval >= bsmin && ssval <= bsmax &&
754 sfval >= bkmin && sfval <= bkmax )
772 QList< SimComp > bcomp;
773 QList< double > vals;
775 QFile fileo( fname );
777 if ( fileo.open( QIODevice::WriteOnly | QIODevice::Text ) )
779 QList< qreal > valus;
780 QList< qreal > concs;
781 QList< qreal > csums;
782 QTextStream ts( &fileo );
785 ts <<
"*****************************************"
786 "**********************************\n\n";
788 ts <<
"Monte Carlo Analysis Statistical Results "
789 "(from Genetic Algorithm Analysis):\n\n";
791 ts <<
"Global Analysis Statistical Results "
792 "(from Genetic Algorithm Analysis):\n\n";
793 ts <<
"*****************************************"
794 "**********************************\n\n";
804 for (
int kk = 0; kk < nbuk; kk++ )
807 ts <<
"\nSolute " << ( kk + 1 ) <<
":\n";
808 int ksol = bcomp.size();
813 ts << tr(
"This solute bin does not have sufficient points to"
814 "\ncalculate meaningful statistics.\n" );
817 for (
int jj = 0; jj < ksol; jj++ )
818 tconc += bcomp.at( jj ).c;
820 ts << tr(
"Molecular weight: " );
822 for (
int jj = 0; jj < ksol; jj++ )
823 vsum += ( bcomp.at( jj ).w * bcomp.at( jj ).c );
824 ts << ( vsum / tconc ) << endl;
826 ts << tr(
"Sedimentation coefficient: " );
828 for (
int jj = 0; jj < ksol; jj++ )
829 vsum += ( bcomp.at( jj ).s * bcomp.at( jj ).c );
830 ts << ( vsum / tconc ) << endl;
832 ts << tr(
"Diffusion coefficient: " );
834 for (
int jj = 0; jj < ksol; jj++ )
835 vsum += ( bcomp.at( jj ).d * bcomp.at( jj ).c );
836 ts << ( vsum / tconc ) << endl;
838 ts << tr(
"Frictional ratio: " );
840 for (
int jj = 0; jj < ksol; jj++ )
841 vsum += ( bcomp.at( jj ).f * bcomp.at( jj ).c );
842 ts << ( vsum / tconc ) << endl;
844 ts << tr(
"Partial specific volume: " );
846 for (
int jj = 0; jj < ksol; jj++ )
847 vsum += ( bcomp.at( jj ).v * bcomp.at( jj ).c );
848 ts << ( vsum / tconc ) << endl;
850 ts << tr(
"Partial concentration: " );
852 ts << ( vsum / vsiz ) << endl;
853 csums.append( vsum );
861 for (
int jj = 0; jj < ksol; jj++ )
862 concs.append( bcomp.at( jj ).c );
865 for (
int jj = 0; jj < ksol; jj++ )
866 valus.append( bcomp.at( jj ).w );
868 tr(
"Molecular weight: " ) );
871 for (
int jj = 0; jj < ksol; jj++ )
872 valus.append( bcomp.at( jj ).s );
874 tr(
"Sedimentation coefficient: " ) );
877 for (
int jj = 0; jj < ksol; jj++ )
878 valus.append( bcomp.at( jj ).d );
880 tr(
"Diffusion coefficient: " ) );
883 for (
int jj = 0; jj < ksol; jj++ )
884 valus.append( bcomp.at( jj ).f );
886 tr(
"Frictional ratio: " ) );
889 for (
int jj = 0; jj < ksol; jj++ )
890 valus.append( bcomp.at( jj ).v );
892 tr(
"Partial specific volume: " ) );
894 for (
int jj = 0; jj < ksol; jj++ )
895 vtotal += bcomp.at( jj ).c;
896 csums.append( vtotal );
897 ts << tr(
"Partial concentration: " ) <<
898 str1.sprintf(
" %6.4e\n", vtotal );
905 for (
int jj = 0; jj <
distro->size(); jj++ )
906 concsum +=
distro->at( jj ).c;
908 ts << tr(
"\nMonte Carlo iterations: " ) << mc_iters;
910 ts << tr(
" (Global or High-Solutes-per-Bucket)" );
911 ts << tr(
"\n\nRelative Concentrations:\n\n" );
912 ts << tr(
"Total concentration: " ) << concsum <<
" OD\n";
914 for (
int jj = 0; jj < csums.size(); jj++ )
916 qreal pcconc = 100.0 * csums.at( jj ) / concsum;
917 ts << tr(
"Relative percentage of Solute " ) << ( jj + 1 )
918 <<
": " << QString().sprintf(
"%7.3f", pcconc ) <<
" %\n";
921 ts << tr(
"\n\nDetailed Results:\n" );
923 for (
int kk = 0; kk < nbuk; kk++ )
926 ts <<
"\n*****************************************"
927 "**********************************";
928 ts <<
"\nSolute " << ( kk + 1 ) <<
":";
929 int ksol = bcomp.size();
934 ts << tr(
"\nThis solute bin does not have sufficient points to"
935 "\ncalculate a meaningful distribution.\n\n" );
937 ts << tr(
"Molecular weight: " );
938 for (
int jj = 0; jj < ksol; jj++ )
939 ts << bcomp.at( jj ).w <<
" ";
942 ts << tr(
"Sedimentation coefficient: " );
943 for (
int jj = 0; jj < ksol; jj++ )
944 ts << bcomp.at( jj ).s <<
" ";
947 ts << tr(
"Diffusion coefficient: " );
948 for (
int jj = 0; jj < ksol; jj++ )
949 ts << bcomp.at( jj ).d <<
" ";
952 ts << tr(
"Frictional ratio: " );
953 for (
int jj = 0; jj < ksol; jj++ )
954 ts << bcomp.at( jj ).f <<
" ";
957 ts << tr(
"Partial specific volume: " );
958 for (
int jj = 0; jj < ksol; jj++ )
959 ts << bcomp.at( jj ).v <<
" ";
962 ts << tr(
"Concentration: " );
963 for (
int jj = 0; jj < ksol; jj++ )
964 ts << bcomp.at( jj ).c <<
" ";
971 for (
int jj = 0; jj < ksol; jj++ )
972 concs.append( bcomp.at( jj ).c );
975 for (
int jj = 0; jj < ksol; jj++ )
976 valus.append( bcomp.at( jj ).w );
978 tr(
"Molecular Weight" ) );
981 for (
int jj = 0; jj < ksol; jj++ )
982 valus.append( bcomp.at( jj ).s );
984 tr(
"Sedimentation Coefficient" ) );
987 for (
int jj = 0; jj < ksol; jj++ )
988 valus.append( bcomp.at( jj ).d );
990 tr(
"Diffusion Coefficient" ) );
993 for (
int jj = 0; jj < ksol; jj++ )
994 valus.append( bcomp.at( jj ).f );
996 tr(
"Frictional Ratio" ) );
999 for (
int jj = 0; jj < ksol; jj++ )
1000 valus.append( bcomp.at( jj ).v );
1002 tr(
"Partial Specific Volume" ) );
1015 QList< qreal >& concs,
bool details, QString title )
1019 int nvals = vals.size();
1021 qreal vsiz = (qreal)nvals;
1024 qreal vhi = -9.9e30;
1026 QVector< qreal > xpvec( qMax( nvals, nbins ) );
1027 QVector< qreal > ypvec( qMax( nvals, nbins ) );
1029 qreal *xplot = xpvec.data();
1030 qreal *yplot = ypvec.data();
1061 for (
int jj = 0; jj < nvals; jj++ )
1063 val = vals.at( jj );
1064 conc = concs.at( jj );
1065 vsum += ( val * conc );
1067 vlo = qMin( vlo, val );
1068 vhi = qMax( vhi, val );
1069 xplot[jj] = (qreal)jj;
1073 vmean = vsum / vctot;
1077 for (
int jj = 0; jj < nvals; jj++ )
1079 val = vals.at( jj );
1080 qreal dif = val - vmean;
1081 qreal dsq = dif * dif;
1083 vm3 += ( dsq * dif );
1084 vm4 += ( dsq * dsq );
1090 skew = vm3 / pow( vm2, 1.5 );
1091 kurto = vm4 / pow( vm2, 2.0 ) - 3.0;
1092 vmedi = ( vlo + vhi ) / 2.0;
1100 sdevi = pow( vm2, 0.5 );
1101 sderr = sdevi / pow( vsiz, 0.5 );
1105 bininc = ( vhi - vlo ) / binsz;
1109 for (
int ii = 0; ii < nbins; ii++ )
1111 xplot[ii] = vlo + bininc * (qreal)ii;
1114 for (
int jj = 0; jj < nvals; jj++ )
1116 val = vals.at( jj );
1118 if ( val >= xplot[ ii ] && val < ( xplot[ ii ] + bininc ) )
1120 yplot[ii] += ( concs.at( jj ) );
1124 area += yplot[ ii ] * bininc;
1127 double fvdif = qAbs( ( vhi - vlo ) / vlo );
1128 bool is_constant = ( fvdif < 0.0001 );
1132 for (
int ii = 0; ii < nbins; ii++ )
1134 if ( yplot[ii] > val )
1141 mode_lo = xplot[ thisb ];
1142 mode_hi = mode_lo + bininc;
1143 mode_cen = ( mode_lo + mode_hi ) / 2.0;
1144 conf99lo = vmean - 2.576 * sdevi;
1145 conf99hi = vmean + 2.576 * sdevi;
1146 conf95lo = vmean - 1.960 * sdevi;
1147 conf95hi = vmean + 1.960 * sdevi;
1149 if ( details && is_constant )
1151 ts <<
"\n\n" << tr(
"Results for the " ) << title <<
":\n\n";
1155 ts << tr(
"Constant Value: " )
1156 << str1.sprintf(
"%6.4e\n", vhi );
1161 ts << tr(
"Maximum Value: " )
1162 << str1.sprintf(
"%6.4e\n", vhi );
1163 ts << tr(
"Minimum Value: " )
1164 << str1.sprintf(
"%6.4e\n", vlo );
1165 ts << tr(
"(Nearly) Constant Value: " )
1166 << str1.sprintf(
"%6.4e\n", vmean );
1172 ts <<
"\n\n" << tr(
"Results for the " ) << title <<
":\n\n";
1173 ts << tr(
"Maximum Value: " )
1174 << str1.sprintf(
"%6.4e\n", vhi );
1175 ts << tr(
"Minimum Value: " )
1176 << str1.sprintf(
"%6.4e\n", vlo );
1177 ts << tr(
"Mean Value: " )
1178 << str1.sprintf(
"%6.4e\n", vmean );
1179 ts << tr(
"Median Value: " )
1180 << str1.sprintf(
"%6.4e\n", vmedi );
1181 ts << tr(
"Skew Value: " )
1182 << str1.sprintf(
"%6.4e\n", skew );
1183 ts << tr(
"Kurtosis Value: " )
1184 << str1.sprintf(
"%6.4e\n", kurto );
1185 ts << tr(
"Lower Mode Value: " )
1186 << str1.sprintf(
"%6.4e\n", mode_lo );
1187 ts << tr(
"Upper Mode Value: " )
1188 << str1.sprintf(
"%6.4e\n", mode_hi );
1189 ts << tr(
"Mode Center: " )
1190 << str1.sprintf(
"%6.4e\n", mode_cen );
1191 ts << tr(
"95% Confidence Limits: " )
1192 << str1.sprintf(
"%6.4e, -%6.4e\n",
1193 ( conf95hi - mode_cen ), ( mode_cen - conf95lo ) );
1194 ts << tr(
"99% Confidence Limits: " )
1195 << str1.sprintf(
"%6.4e, -%6.4e\n",
1196 ( conf99hi - mode_cen ), ( mode_cen - conf99lo ) );
1197 ts << tr(
"Standard Deviation: " )
1198 << str1.sprintf(
"%6.4e\n", sdevi );
1199 ts << tr(
"Standard Error: " )
1200 << str1.sprintf(
"%6.4e\n", sderr );
1201 ts << tr(
"Variance: " )
1202 << str1.sprintf(
"%6.4e\n", vari );
1203 ts << tr(
"Correlation Coefficent: " )
1204 << str1.sprintf(
"%6.4e\n", corr );
1205 ts << tr(
"Number of Bins: " )
1206 << qRound( binsz ) <<
"\n";
1207 ts << tr(
"Distribution Area: " )
1208 << str1.sprintf(
"%6.4e\n", area );
1210 str1.sprintf(
"%e", conf95lo ).append( tr(
" (low), " ) );
1211 str2.sprintf(
"%e", conf95hi ).append( tr(
" (high)\n" ) );
1212 ts << tr(
"95% Confidence Interval: " ) << str1 << str2;
1214 str1.sprintf(
"%e", conf99lo ).append( tr(
" (low), " ) );
1215 str2.sprintf(
"%e", conf99hi ).append( tr(
" (high)\n" ) );
1216 ts << tr(
"99% Confidence Interval: " ) << str1 << str2;
1219 else if ( is_constant )
1221 ts << title << str1.sprintf(
" %6.4e (**constant**)\n", vmean );
1226 ts << title << str1.sprintf(
" %6.4e (%6.4e, %6.4e)\n",
1227 vmean, conf95lo, conf95hi );
1237 if ( buk.
x_min > 0.0 )
1243 else if ( buk.
x_max <= 0.0 )
1278 QList< QRectF > bucket_rects;
1279 DbgLv(1) <<
"countOv nbuks" << nbuks;
1280 DbgLv(1) <<
"CountO dbg_level>=1";
1283 for (
int ii = 0; ii < nbuks; ii++ )
1287 for (
int ii = 0; ii < nbuks; ii++ )
1289 QRectF bukrect = bucket_rects[ ii ];
1292 for (
int jj = ii + 1; jj < nbuks; jj++ )
1294 if ( bukrect.intersects( bucket_rects[ jj ] ) )
1296 QRectF buki = bukrect.intersected( bucket_rects[ jj ] );
1297 double bwid = qAbs( buki.left() - buki.right() );
1298 double bhgt = qAbs( buki.bottom() - buki.top() );
1299 DbgLv(1) <<
"OVERLAP? ii jj" << ii << jj;
1300 DbgLv(1) <<
" buck i" << bukrect.left() << bukrect.right()
1301 << bukrect.top() << bukrect.bottom();
1302 QRectF brj=bucket_rects[jj];
1303 DbgLv(1) <<
" buck j" << brj.left() << brj.right()
1304 << brj.top() << brj.bottom();
1305 DbgLv(1) <<
" buki" << buki.left() << buki.right()
1306 << buki.top() << buki.bottom();
1307 DbgLv(1) <<
" buki left-right" << bwid <<
" bottom-top" << bhgt;
1308 if ( bwid < 1e-10 || bhgt < 1e-10 )
1321 DbgLv(1) <<
" final NOVLPS" << novlps;
1327 QList< QRectF >& bucket_rects )
1329 QRectF bukreci = bucket_rects[ ii ];
1330 QRectF bukrecj = bucket_rects[ jj ];
1331 double xdiff = qAbs( bukreci.right() - bukrecj.left() );
1332 double ydiff = qAbs( bukreci.bottom() - bukrecj.top() );
1334 if ( xdiff < 1e-10 )
1336 double xleft = bukrecj.left() + 1e-6;
1337 bukrecj.setLeft( xleft );
1340 if ( ydiff < 1e-10 )
1342 double ybottom = bukrecj.bottom() - 1e-6;
1343 bukrecj.setBottom( ybottom );
1347 bukj.
x_min = bukrecj.left();
1348 bukj.
y_max = bukrecj.bottom();
1350 bucket_rects.replace( jj, bukrecj );
1364 DbgLv(1) <<
"countFB-absize" << nbuks;
1366 for (
int ii = 0; ii < nbuks; ii++ )
1368 DbgLv(1) <<
"countFB ii" << ii;
1369 mxsol = qMax( mxsol,
MC_solute.at( ii ).size() );
1370 DbgLv(1) <<
"countFB mxsol" << mxsol;