#pragma once #include "matrix_iterator.hpp" // Matrix row iterator template MatrixRowIterator::MatrixRowIterator(ColumnPtr column_ptr) noexcept : _column_ptr(column_ptr) { } template MatrixRowIterator &MatrixRowIterator::operator++() noexcept { ++_column_ptr; return *this; } template MatrixRowIterator MatrixRowIterator::operator++(int) noexcept { auto copy = *this; ++(*this); return copy; } template Element &MatrixRowIterator::operator*() const noexcept { return *_column_ptr; } template bool MatrixRowIterator::operator==(const MatrixRowIterator &rhs) const noexcept { return _column_ptr == rhs._column_ptr; } template bool MatrixRowIterator::operator!=(const MatrixRowIterator &rhs) const noexcept { return _column_ptr != rhs._column_ptr; } // Matrix row template MatrixRow::MatrixRow(RowPtr row_ptr, const uint32_t &column_cnt) noexcept : _row_ptr(row_ptr), _column_cnt(column_cnt) { } template MatrixRowIterator MatrixRow::begin() const noexcept { return MatrixRowIterator(_row_ptr); } template MatrixRowIterator MatrixRow::end() const noexcept { return MatrixRowIterator(_row_ptr + _column_cnt); } // Matrix iterator template MatrixIterator::MatrixIterator(RowPtr row_ptr, const uint32_t &column_cnt) noexcept : _row_ptr(row_ptr), _column_cnt(column_cnt) { } template MatrixIterator &MatrixIterator::operator++() noexcept { ++_row_ptr; return *this; } template MatrixIterator MatrixIterator::operator++(int) noexcept { auto copy = *this; ++(*this); return copy; } template MatrixRow MatrixIterator::operator*() const noexcept { return MatrixRow(*_row_ptr, _column_cnt); } template bool MatrixIterator::operator==(const MatrixIterator &rhs) const noexcept { return _row_ptr == rhs._row_ptr; } template bool MatrixIterator::operator!=(const MatrixIterator &rhs) const noexcept { return _row_ptr != rhs._row_ptr; }