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

changed implementation of a couple of normalizer so that operator() takes two matrices of which one is an input marix and one is a result matrix, i.e., the result does only depend on the input matrix and the result is only used as a receiver - I think this behaviour is more intuitive, although it is not as general as the previous one. We should probably document somewhere how we expect a 2Dnormalizer to behave (refs #425).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/normalizer/ColumnNormalizer.h

    r1498 r1518  
    2222
    2323#include "yat/utility/Matrix.h"
     24#include "yat/utility/yat_assert.h"
     25
     26#include <stdexcept>
    2427
    2528namespace theplu {
     
    5558
    5659    /**
    57        Each column in \a result is normalized using class T.
     60       Each column in \a matrix is normalized using class T, and
     61       assigned to Matrix \a result.
    5862
    59        \note matrix is ignored
     63       \note \a result must have same dimensions as \a matrix.
    6064     */
    6165    void operator()(const utility::Matrix& matrix,
     
    6973                                       utility::Matrix& result) const
    7074  {
     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");
    7180    for (size_t i=0; i<matrix.columns(); ++i)
    72       normalizer_(result.begin_column(i), result.end_column(i),
     81      normalizer_(matrix.begin_column(i), matrix.end_column(i),
    7382                  result.begin_column(i));
    7483
Note: See TracChangeset for help on using the changeset viewer.