Changeset 517
- Timestamp:
- Feb 21, 2006, 5:35:34 PM (17 years ago)
- Location:
- trunk/lib/classifier
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/classifier/CrossSplitter.cc
r514 r517 20 20 { 21 21 assert(target.size()>1); 22 assert(target.size()==data.columns()); 22 23 std::vector<std::pair<size_t,size_t> > v; 23 24 for (size_t i=0; i<target.size(); i++) … … 38 39 39 40 for (size_t i=0; i<N; ) { 40 41 41 // shuffle indices within class each class 42 42 for (size_t j=0; j<target.nof_classes(); j++) -
trunk/lib/classifier/DataLookup2D.cc
r475 r517 10 10 11 11 DataLookup2D::DataLookup2D(const DataLookup2D& m, 12 const std::vector<size_t>& row,13 const std::vector<size_t>& col)12 const std::vector<size_t>& row, 13 const std::vector<size_t>& col) 14 14 { 15 assert(row_index_.empty()); 16 row_index_.reserve(row.size()); 15 17 for (size_t i=0; i<row.size(); i++) 16 row_index_[i] = m.row_index_[row[i]]; 18 row_index_.push_back(m.row_index_[row[i]]); 19 assert(column_index_.empty()); 20 column_index_.reserve(col.size()); 17 21 for (size_t i=0; i<col.size(); i++) 18 column_index_ [i] = m.column_index_[col[i]];22 column_index_.push_back(m.column_index_[col[i]]); 19 23 } 20 24 … … 26 30 { 27 31 if (row){ 28 row_index_=index; 32 assert(row_index_.empty()); 33 row_index_.reserve(index.size()); 34 for (size_t i=0; i<index.size(); i++) 35 row_index_.push_back(m.row_index_[index[i]]); 29 36 column_index_= m.column_index_; 30 37 } 31 38 else{ 32 column_index_=index; 39 assert(column_index_.empty()); 40 column_index_.reserve(index.size()); 41 for (size_t i=0; i<index.size(); i++) 42 column_index_.push_back(m.row_index_[index[i]]); 33 43 row_index_= m.row_index_; 34 44 } … … 37 47 38 48 DataLookup2D::DataLookup2D(const std::vector<size_t>& row, 39 const std::vector<size_t>& col)49 const std::vector<size_t>& col) 40 50 : row_index_(row),column_index_(col) 41 51 { -
trunk/lib/classifier/KernelLookup.h
r482 r517 13 13 class KernelFunction; 14 14 15 16 /// 17 18 19 20 21 15 /// 16 /// @brief View into sub Kernel 17 /// 18 class KernelLookup : public DataLookup2D 19 { 20 21 public: 22 22 23 23 ///
Note: See TracChangeset
for help on using the changeset viewer.