Changeset 1544 for trunk/yat/normalizer/RowNormalizer.h
 Timestamp:
 Oct 1, 2008, 4:25:09 PM (13 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/normalizer/RowNormalizer.h
r1520 r1544 61 61 assigned to Matrix \a result. 62 62 63 Template argument Container2D1 should be a class modelling the 64 concept \ref concept_container_2d. The template argument 65 Container2D2 should be a class modelling the concept \ref 66 concept_mutable_container_2d. 67 63 68 \note \a result must have same dimensions as \a matrix. 64 69 */ 65 void operator()(const utility::Matrix& matrix, 66 utility::Matrix& result) const; 70 template<class Container2D1, class Container2D2> 71 void operator()(const Container2D1& matrix, 72 Container2D2& result) const 73 { 74 using utility::yat_assert; 75 yat_assert<std::runtime_error>(matrix.rows()==result.rows(), 76 "RowNormalizer: rows mismatch"); 77 yat_assert<std::runtime_error>(matrix.columns()==result.columns(), 78 "RowNormalizer: columns mismatch"); 79 for (size_t i=0; i<matrix.rows(); ++i) 80 normalizer_(matrix.begin_row(i), matrix.end_row(i), 81 result.begin_row(i)); 82 } 83 67 84 private: 68 85 T normalizer_; 69 86 }; 70 87 71 template<class T>72 void RowNormalizer<T>::operator()(const utility::Matrix& matrix,73 utility::Matrix& result) const74 {75 using utility::yat_assert;76 yat_assert<std::runtime_error>(matrix.rows()==result.rows(),77 "RowNormalizer: rows mismatch");78 yat_assert<std::runtime_error>(matrix.columns()==result.columns(),79 "RowNormalizer: columns mismatch");80 for (size_t i=0; i<matrix.rows(); ++i)81 normalizer_(matrix.begin_row(i), matrix.end_row(i),82 result.begin_row(i));83 84 }85 86 87 88 }}} // end of namespace normalizer, yat and thep 88 89 #endif
Note: See TracChangeset
for help on using the changeset viewer.