yat
0.11.3pre
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
yat
normalizer
RowNormalizer.h
1
#ifndef _theplu_yat_normalizer_row_normalizer_
2
#define _theplu_yat_normalizer_rows_normalizer_
3
4
// $Id: RowNormalizer.h 2992 2013-03-03 05:03:44Z peter $
5
6
/*
7
Copyright (C) 2008 Jari Häkkinen, Peter Johansson
8
Copyright (C) 2009, 2010 Peter Johansson
9
10
This file is part of the yat library, http://dev.thep.lu.se/yat
11
12
The yat library is free software; you can redistribute it and/or
13
modify it under the terms of the GNU General Public License as
14
published by the Free Software Foundation; either version 3 of the
15
License, or (at your option) any later version.
16
17
The yat library is distributed in the hope that it will be useful,
18
but WITHOUT ANY WARRANTY; without even the implied warranty of
19
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
General Public License for more details.
21
22
You should have received a copy of the GNU General Public License
23
along with yat. If not, see <http://www.gnu.org/licenses/>.
24
*/
25
26
#include "yat/utility/yat_assert.h"
27
#include "yat/utility/concept_check.h"
28
29
#include <boost/concept_check.hpp>
30
31
#include <cstddef>
32
#include <stdexcept>
33
34
namespace
theplu {
35
namespace
yat {
36
namespace
normalizer {
37
55
template
<
class
T>
56
class
RowNormalizer
57
{
58
public
:
62
typedef
T
normalizer_type
;
63
67
RowNormalizer
(
void
) {}
68
72
RowNormalizer
(T norm)
73
: normalizer_(norm) {}
74
86
template
<
class
Container2D1,
class
Container2D2>
87
void
operator()
(
const
Container2D1& matrix,
88
Container2D2& result)
const
89
{
90
BOOST_CONCEPT_ASSERT((
utility::Container2D<Container2D1>
));
91
BOOST_CONCEPT_ASSERT((
utility::Mutable_Container2D<Container2D2>
));
92
using
utility::yat_assert;
93
YAT_ASSERT(matrix.rows()==result.rows());
94
YAT_ASSERT(matrix.columns()==result.columns());
95
for
(
size_t
i=0; i<matrix.rows(); ++i)
96
normalizer_(matrix.begin_row(i), matrix.end_row(i),
97
result.begin_row(i));
98
}
99
100
private
:
101
T normalizer_;
102
};
103
104
}}}
// end of namespace normalizer, yat and thep
105
#endif
Generated on Sat May 24 2014 03:33:05 for yat by
1.8.2