Changeset 280 for trunk/src/RegressionLocal.cc
 Timestamp:
 Apr 20, 2005, 6:19:31 PM (18 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/RegressionLocal.cc
r253 r280 23 23 { 24 24 sort(data_.begin(), data_.end()); 25 26 // coying data to 2 gslapi vectors ONCE to use views from 27 gslapi::vector x_total(data_.size()); 28 gslapi::vector y_total(data_.size()); 29 for (size_t j=0; j<x_total.size(); j++) 30 x_total(j)=data_[j].first; 31 for (size_t j=0; j<y_total.size(); j++) 32 y_total(j)=data_[j].second; 33 25 34 regressor_>print_header(s); 26 35 s << std::endl; … … 55 64 } 56 65 57 // copying data 58 // Peter, too much copying. Move the copying outside loop and 59 // use a vector view (when available in gslapi::vector class). 60 gslapi::vector x(nof_points); 61 gslapi::vector y(nof_points); 66 67 68 gslapi::vector x(x_total, min_index, nof_points); 69 //for (size_t j=0; j<x.size(); j++) 70 // x(j)=data_[min_index+j].first; 71 72 gslapi::vector y(y_total, min_index, nof_points); 73 //for (size_t j=0; j<y.size(); j++){ 74 // y(j)=data_[min_index+j].second; 75 //} 76 77 // calculating weights 62 78 gslapi::vector w(nof_points); 63 for (size_t j=0; j<x.size(); j++)64 x(j)=data_[min_index+j].first;65 for (size_t j=0; j<y.size(); j++){66 y(j)=data_[min_index+j].second;67 }68 // calculating weights69 79 for (size_t j=0; j<y.size(); j++) 70 80 w(j) = kernel_>weight( (x(j)(data_[min_index].first+
Note: See TracChangeset
for help on using the changeset viewer.