Changeset 3261 in Sophya for trunk/Cosmo/SimLSS/genefluct3d.cc
- Timestamp:
- Jun 4, 2007, 7:02:03 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/genefluct3d.cc
r3255 r3261 854 854 } 855 855 856 int_8 GeneFluct3D::MeanSigma2(double& rm,double& rs2,double vmin,double vmax) 857 // mean,sigma^2 pour pixels avec valeurs ]vmin,vmax[ extremites exclues 858 // -> mean and sigma^2 are NOT computed with pixels values vmin and vmax 859 { 856 int_8 GeneFluct3D::MeanSigma2(double& rm,double& rs2,double vmin,double vmax 857 ,bool useout,double vout) 858 // Calcul de mean,sigma2 dans le cube reel avec valeurs ]vmin,vmax[ extremites exclues 859 // useout = false: ne pas utiliser les pixels hors limites pour calculer mean,sigma2 860 // true : utiliser les pixels hors limites pour calculer mean,sigma2 861 // en remplacant leurs valeurs par "vout" 862 { 863 bool tstval = (vmax>vmin)? true: false; 864 if(lp_>0) { 865 cout<<"--- MeanSigma2: "; 866 if(tstval) cout<<"range=]"<<vmin<<","<<vmax<<"["; 867 if(useout) cout<<", useout="<<useout<<" vout="<<vout; 868 cout<<endl; 869 } 860 870 check_array_alloc(); 861 871 … … 866 876 int_8 ip = IndexR(i,j,l); 867 877 double v = data_[ip]; 868 if(v<=vmin || v>=vmax) continue; 878 if(tstval) { 879 if(v<=vmin || v>=vmax) {if(useout) v=vout; else continue;} 880 } 869 881 rm += v; 870 882 rs2 += v*v; … … 877 889 } 878 890 891 if(lp_>0) cout<<" n="<<n<<" m="<<rm<<" s2="<<rs2<<" s="<<sqrt(fabs(rs2))<<endl; 892 879 893 return n; 880 894 } … … 882 896 int_8 GeneFluct3D::SetToVal(double vmin, double vmax,double val0) 883 897 // set to "val0" if out of range ]vmin,vmax[ extremites exclues 884 // -> vmin and vmax are set to val0 885 { 898 // cad set to "val0" if in [vmin,vmax] -> vmin and vmax are set to val0 899 { 900 if(lp_>0) cout<<"--- SetToVal set to="<<val0 901 <<" when in range=["<<vmin<<","<<vmax<<"]"<<endl; 886 902 check_array_alloc(); 887 903
Note:
See TracChangeset
for help on using the changeset viewer.