Changeset 7d3cadb in tol
- Timestamp:
- Oct 5, 2010, 1:48:10 PM (16 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 72625c3
- Parents:
- 1ecde20
- File:
-
- 1 edited
-
tol/btol/vmatrix_type/vmat_stats.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/btol/vmatrix_type/vmat_stats.cpp
r1ecde20 r7d3cadb 794 794 int c = M.s_.blasRdense_->ncol; 795 795 BlasRDense(parts, c+1); 796 BArray<double> sorted(r);797 796 double* h = (double*)s_.blasRdense_->x; 798 797 double step = (max-min)/double(parts); … … 818 817 }; 819 818 819 /* * / 820 //////////////////////////////////////////////////////////////////////////////// 821 void BVMat::Histogram_cRs(const BVMat& M, int parts, double min, double max) 822 //////////////////////////////////////////////////////////////////////////////// 823 { 824 int i,j,p; 825 int r = M.s_.cholmodRsparse_->nrow; 826 int c = M.s_.cholmodRsparse_->ncol; 827 int n = r*c; 828 BlasRDense(parts, c+1); 829 double* h = (double*)s_.blasRdense_->x; 830 double step = (max-min)/double(parts); 831 for(p=0; p<parts-1; p++) 832 { 833 *(h++) = min+step*(p+1); 834 } 835 *(h++) = max; 836 memset(h,0,sizeof(double)*parts*c); 837 const double* x = (const double*)M.s_.blasRdense_->x; 838 //double* y = (double*)s_.blasRdense_->x+parts; 839 for(j=0; j<c; j++) 840 { 841 double* h0 = ((double*)s_.blasRdense_->x)+parts*(j+1); 842 for(i=0; i<r; i++, x++) 843 { 844 p = (int)((*x-min)/step)-1; 845 if(p<0) { p=0; } 846 if(p>=parts) { p=parts-1; } 847 h0[p] += 1.0/r; 848 } 849 } 850 }; 851 /* */ 820 852 //////////////////////////////////////////////////////////////////////////////// 821 853 void BVMat::Histogram_bRd(const BVMat& M, int parts) … … 835 867 }; 836 868 869 837 870 //////////////////////////////////////////////////////////////////////////////// 838 871 void BVMat::Histogram(const BVMat& M_, int parts, double min, double max)
Note: See TracChangeset
for help on using the changeset viewer.
