Changeset 7d3cadb in tol


Ignore:
Timestamp:
Oct 5, 2010, 1:48:10 PM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
72625c3
Parents:
1ecde20
Message:

Recordatorio de la neceisdad de implementar Histogram_cRs para mayor eficiencia

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2568 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/vmatrix_type/vmat_stats.cpp

    r1ecde20 r7d3cadb  
    794794  int c = M.s_.blasRdense_->ncol;
    795795  BlasRDense(parts, c+1);
    796   BArray<double> sorted(r);
    797796  double* h = (double*)s_.blasRdense_->x;
    798797  double step = (max-min)/double(parts);
    … …  
    818817};
    819818
     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/* */
    820852////////////////////////////////////////////////////////////////////////////////
    821853  void BVMat::Histogram_bRd(const BVMat& M, int parts)
    … …  
    835867};
    836868
     869
    837870////////////////////////////////////////////////////////////////////////////////
    838871  void BVMat::Histogram(const BVMat& M_, int parts, double min, double max)
Note: See TracChangeset for help on using the changeset viewer.