Exemple #1
0
 double partial_fit(const IntegerVector x_irow,
                  const IntegerVector  x_icol,
                  const NumericVector x_val,
                  const IntegerVector iter_order) {
   this->adaGradIter.init(x_irow, x_icol, x_val, iter_order, gloveFit);
   parallelReduce(0, x_irow.size(), adaGradIter, GRAIN_SIZE);
   return (this->adaGradIter.global_cost);
 }
// [[Rcpp::export]]
List make_index_parallel( DataFrame data, CharacterVector by ){
    
    int n = data.nrows() ;
    
    Visitors visitors(data, by) ;
    IndexMaker indexer(visitors) ;
    
    parallelReduce(0, n, indexer) ;
    
    return indexer.get() ;
}
// [[Rcpp::export]]
List detail_make_index_parallel( DataFrame data, CharacterVector by ){
    int n = data.nrows() ;
    Timers timers(n);
    
    Visitors visitors(data, by) ;  
    
    IndexMaker indexer(visitors) ;
    TimedReducer<IndexMaker, Timer, tbb::mutex, tbb::mutex::scoped_lock> timed_indexer(indexer, timers) ;
    
    parallelReduce(0, n, timed_indexer, 100) ;
    return timed_indexer.get() ;
    
}