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

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/normalizer/ColumnNormalizer.h
r1518 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, Container2D2& result) const 72 { 73 using utility::yat_assert; 74 yat_assert<std::runtime_error>(matrix.rows()==result.rows(), 75 "ColumnNormalizer: rows mismatch"); 76 yat_assert<std::runtime_error>(matrix.columns()==result.columns(), 77 "ColumnNormalizer: columns mismatch"); 78 for (size_t i=0; i<matrix.columns(); ++i) 79 normalizer_(matrix.begin_column(i), matrix.end_column(i), 80 result.begin_column(i)); 81 82 } 83 67 84 private: 68 85 T normalizer_; 69 86 }; 70 87 71 template<class T>72 void ColumnNormalizer<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 "ColumnNormalizer: rows mismatch");78 yat_assert<std::runtime_error>(matrix.columns()==result.columns(),79 "ColumnNormalizer: columns mismatch");80 for (size_t i=0; i<matrix.columns(); ++i)81 normalizer_(matrix.begin_column(i), matrix.end_column(i),82 result.begin_column(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.