Changeset 1484 for trunk/yat/classifier
- Timestamp:
- Sep 9, 2008, 7:01:43 PM (14 years ago)
- Location:
- trunk/yat/classifier
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/classifier/MatrixLookupWeighted.cc
r1483 r1484 88 88 89 89 90 /*91 MatrixLookupWeighted::MatrixLookupWeighted(const utility::Matrix& data)92 : data_(MatrixP(&data, false))93 {94 utility::Matrix weights;95 utility::nan(*data_,weights);96 weights_= MatrixP(new utility::Matrix(weights));97 row_index_ = utility::Index(data.rows());98 column_index_ = utility::Index(data.columns());99 assert(validate());100 }101 */102 103 104 90 MatrixLookupWeighted::MatrixLookupWeighted(const MatrixLookup& ml) 105 91 : column_index_(ml.column_index_), data_(ml.data_), … … 115 101 const utility::Index& row, 116 102 const utility::Index& col) 117 : column_index_(col), data_(MatrixP(new utility::Matrix(data), false)), 118 row_index_(row), weights_(MatrixP(new utility::Matrix(weights), false)) 119 { 120 assert(validate()); 121 } 122 123 124 103 : column_index_(col), data_(MatrixP(&data, false)), 104 row_index_(row), weights_(MatrixP(&weights, false)) 105 { 106 assert(validate()); 107 } 108 109 110 111 /* 125 112 MatrixLookupWeighted::MatrixLookupWeighted(const utility::Matrix& data, 126 113 const utility::Matrix& weights, … … 142 129 assert(validate()); 143 130 } 144 131 */ 145 132 146 133 /* … … 295 282 { 296 283 for (size_t i=0; i<row_index_.size(); ++i) 297 if (row_index_[i]>=data_->rows()) 284 if (row_index_[i]>=data_->rows()) { 285 std::cerr << i << " " << row_index_[i] << std::endl; 298 286 return false; 287 } 299 288 for (size_t i=0; i<column_index_.size(); ++i) 300 289 if (column_index_[i]>=data_->columns()) -
trunk/yat/classifier/MatrixLookupWeighted.h
r1483 r1484 41 41 42 42 namespace utility { 43 class Index;44 43 class Matrix; 45 44 class MatrixWeighted; … … 120 119 const utility::Matrix& weights, 121 120 const bool owner=false); 122 123 121 124 ///125 /// Constructor creating a lookup into the entire @a matrix. A126 /// weight matrix is constructed with weights 1 for values and 0127 /// for nan's in @a matrix.128 ///129 /// \see bool utility::nan(const Matrix&, Matrix&);130 ///131 /// @note If @a matrix goes out of scope or132 /// is deleted, the MatrixLookupWeighted becomes invalid and the133 /// result of further use is undefined.134 ///135 //MatrixLookupWeighted(const utility::Matrix& matrix);136 137 138 122 /** 139 123 Constructor creating a MatrixLookupWeighted from a MatrixLookup. A … … 146 130 result of further use is undefined. 147 131 */ 148 MatrixLookupWeighted(const MatrixLookup& matrix);132 explicit MatrixLookupWeighted(const MatrixLookup& matrix); 149 133 150 134 … … 186 170 /// result of further use is undefined. 187 171 /// 172 /* 188 173 MatrixLookupWeighted(const utility::Matrix& matrix, 189 174 const utility::Matrix& weights, 190 175 const utility::Index& index, 191 176 const bool row_vectors); 177 */ 192 178 193 179 ///
Note: See TracChangeset
for help on using the changeset viewer.