blob: 031136c8e6079e43be431f91ab64ad0a56922576 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
#pragma once
#include "matrix_iterator.hpp"
// Matrix row iterator
template <typename Element>
MatrixRowIterator<Element>::MatrixRowIterator(ColumnPtr column_ptr) noexcept
: _column_ptr(column_ptr)
{
}
template <typename Element>
auto MatrixRowIterator<Element>::operator++() noexcept -> MatrixRowIterator<Element> &
{
++_column_ptr;
return *this;
}
template <typename Element>
auto MatrixRowIterator<Element>::operator++(int) noexcept -> MatrixRowIterator<Element>
{
auto copy = *this;
++(*this);
return copy;
}
template <typename Element>
auto MatrixRowIterator<Element>::operator*() const noexcept -> Element &
{
return *_column_ptr;
}
template <typename Element>
auto MatrixRowIterator<Element>::operator==(const MatrixRowIterator &rhs) const noexcept -> bool
{
return _column_ptr == rhs._column_ptr;
}
template <typename Element>
auto MatrixRowIterator<Element>::operator!=(const MatrixRowIterator &rhs) const noexcept -> bool
{
return _column_ptr != rhs._column_ptr;
}
// Matrix row
template <typename Element>
MatrixRow<Element>::MatrixRow(RowPtr row_ptr, const uint32_t &column_cnt) noexcept
: _row_ptr(row_ptr), _column_cnt(column_cnt)
{
}
template <typename Element>
auto MatrixRow<Element>::begin() const noexcept -> MatrixRowIterator<Element>
{
return MatrixRowIterator<Element>(_row_ptr);
}
template <typename Element>
auto MatrixRow<Element>::end() const noexcept -> MatrixRowIterator<Element>
{
return MatrixRowIterator<Element>(_row_ptr + _column_cnt);
}
// Matrix iterator
template <typename Element>
MatrixIterator<Element>::MatrixIterator(RowPtr row_ptr,
const uint32_t &column_cnt) noexcept
: _row_ptr(row_ptr), _column_cnt(column_cnt)
{
}
template <typename Element>
auto MatrixIterator<Element>::operator++() noexcept -> MatrixIterator<Element> &
{
++_row_ptr;
return *this;
}
template <typename Element>
auto MatrixIterator<Element>::operator++(int) noexcept -> MatrixIterator<Element>
{
auto copy = *this;
++(*this);
return copy;
}
template <typename Element>
auto MatrixIterator<Element>::operator*() const noexcept -> MatrixRow<Element>
{
return MatrixRow(*_row_ptr, _column_cnt);
}
template <typename Element>
auto MatrixIterator<Element>::operator==(const MatrixIterator &rhs) const noexcept -> bool
{
return _row_ptr == rhs._row_ptr;
}
template <typename Element>
auto MatrixIterator<Element>::operator!=(const MatrixIterator &rhs) const noexcept -> bool
{
return _row_ptr != rhs._row_ptr;
}
|