Ignore:
Timestamp:
Sep 21, 2008, 6:53:12 AM (13 years ago)
Author:
Peter
Message:

adding a RowNormalizer?

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_
    33
    44/*
     
    3131
    3232  /**
    33      \brief Normalize each column
     33     \brief Normalize each row
    3434
    35      Using a functor T to normalize each column.
     35     Using a functor T to normalize each row.
    3636
    3737     \since New in yat 0.5
    3838   */
    3939  template<class T>
    40   class ColumnNormalizer
     40  class RowNormalizer
    4141  {
    4242  public:
     
    4949       \brief Default constructor
    5050     */
    51     ColumnNormalizer(void) {}
     51    RowNormalizer(void) {}
    5252
    5353    /**
    5454       \brief Constructor taking a functor \a norm
    5555     */
    56     ColumnNormalizer(T norm)
     56    RowNormalizer(T norm)
    5757      : normalizer_(norm) {}
    5858
    5959    /**
    60        Each column in \a matrix is normalized using class T, and
     60       Each row in \a matrix is normalized using class T, and
    6161       assigned to Matrix \a result.
    6262
     
    7070
    7171  template<class T>
    72   void ColumnNormalizer<T>::operator()(const utility::Matrix& matrix,
    73                                        utility::Matrix& result) const
     72  void RowNormalizer<T>::operator()(const utility::Matrix& matrix,
     73                                    utility::Matrix& result) const
    7474  {
    7575    using utility::yat_assert;
    7676    yat_assert<std::runtime_error>(matrix.rows()==result.rows(),
    77                                    "ColumnNormalizer: rows mismatch");
     77                                   "RowNormalizer: rows mismatch");
    7878    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));
    8383
    8484  }
Note: See TracChangeset for help on using the changeset viewer.