00001 #ifndef _theplu_yat_normalizer_column_normalizer_
00002 #define _theplu_yat_normalizer_column_normalizer_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "yat/utility/yat_assert.h"
00027 #include "yat/utility/concept_check.h"
00028
00029 #include <boost/concept_check.hpp>
00030
00031 #include <cstddef>
00032 #include <stdexcept>
00033
00034 namespace theplu {
00035 namespace yat {
00036 namespace normalizer {
00037
00055 template<class T>
00056 class ColumnNormalizer
00057 {
00058 public:
00062 typedef T normalizer_type;
00063
00067 ColumnNormalizer(void) {}
00068
00072 ColumnNormalizer(T norm)
00073 : normalizer_(norm) {}
00074
00086 template<class Container2D1, class Container2D2>
00087 void operator()(const Container2D1& matrix, Container2D2& result) const
00088 {
00089 BOOST_CONCEPT_ASSERT((utility::Container2D<Container2D1>));
00090 BOOST_CONCEPT_ASSERT((utility::Mutable_Container2D<Container2D2>));
00091 YAT_ASSERT(matrix.rows()==result.rows());
00092 YAT_ASSERT(matrix.columns()==result.columns());
00093 for (size_t i=0; i<matrix.columns(); ++i)
00094 normalizer_(matrix.begin_column(i), matrix.end_column(i),
00095 result.begin_column(i));
00096
00097 }
00098
00099 private:
00100 T normalizer_;
00101 };
00102
00103 }}}
00104 #endif