Changeset 1520 for trunk/yat/normalizer/RowNormalizer.h
- Timestamp:
- Sep 21, 2008, 6:53:12 AM (14 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/normalizer/RowNormalizer.h
r1518 r1520 1 #ifndef _theplu_yat_normalizer_ column_normalizer_2 #define _theplu_yat_normalizer_ column_normalizer_1 #ifndef _theplu_yat_normalizer_row_normalizer_ 2 #define _theplu_yat_normalizer_rows_normalizer_ 3 3 4 4 /* … … 31 31 32 32 /** 33 \brief Normalize each column33 \brief Normalize each row 34 34 35 Using a functor T to normalize each column.35 Using a functor T to normalize each row. 36 36 37 37 \since New in yat 0.5 38 38 */ 39 39 template<class T> 40 class ColumnNormalizer40 class RowNormalizer 41 41 { 42 42 public: … … 49 49 \brief Default constructor 50 50 */ 51 ColumnNormalizer(void) {}51 RowNormalizer(void) {} 52 52 53 53 /** 54 54 \brief Constructor taking a functor \a norm 55 55 */ 56 ColumnNormalizer(T norm)56 RowNormalizer(T norm) 57 57 : normalizer_(norm) {} 58 58 59 59 /** 60 Each columnin \a matrix is normalized using class T, and60 Each row in \a matrix is normalized using class T, and 61 61 assigned to Matrix \a result. 62 62 … … 70 70 71 71 template<class T> 72 void ColumnNormalizer<T>::operator()(const utility::Matrix& matrix,73 72 void RowNormalizer<T>::operator()(const utility::Matrix& matrix, 73 utility::Matrix& result) const 74 74 { 75 75 using utility::yat_assert; 76 76 yat_assert<std::runtime_error>(matrix.rows()==result.rows(), 77 " ColumnNormalizer: rows mismatch");77 "RowNormalizer: rows mismatch"); 78 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));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 83 84 84 }
Note: See TracChangeset
for help on using the changeset viewer.