SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
|
An alignment score matrix storing only a single column for the computation. More...
#include <seqan3/alignment/matrix/detail/alignment_score_matrix_one_column.hpp>
Public Types | |
Associated types | |
using | value_type = alignment_score_matrix_proxy< score_t > |
The proxy type of an alignment matrix. | |
using | reference = value_type |
Same as value type. | |
using | iterator = typename range_base_t::iterator |
The type of the iterator. | |
using | sentinel = typename range_base_t::sentinel |
The type of sentinel. | |
using | size_type = size_t |
The size type. | |
using | underlying_type = score_t |
The underlying type of the scores. | |
Public Member Functions | |
Constructors, destructor and assignment | |
constexpr | alignment_score_matrix_one_column ()=default |
Defaulted. | |
constexpr | alignment_score_matrix_one_column (alignment_score_matrix_one_column const &)=default |
Defaulted. | |
constexpr | alignment_score_matrix_one_column (alignment_score_matrix_one_column &&)=default |
Defaulted. | |
constexpr alignment_score_matrix_one_column & | operator= (alignment_score_matrix_one_column const &)=default |
Defaulted. | |
constexpr alignment_score_matrix_one_column & | operator= (alignment_score_matrix_one_column &&)=default |
Defaulted. | |
~alignment_score_matrix_one_column ()=default | |
Defaulted. | |
template<std::ranges::forward_range first_sequence_t, std::ranges::forward_range second_sequence_t> | |
constexpr | alignment_score_matrix_one_column (first_sequence_t &&first, second_sequence_t &&second, score_t const initial_value=score_t{}) |
Construction from two ranges. | |
Public Member Functions inherited from seqan3::detail::alignment_matrix_column_major_range_base< alignment_score_matrix_one_column< score_t > > | |
constexpr iterator | begin () noexcept |
Returns an iterator to the first column of the matrix. | |
constexpr iterator | begin () const noexcept=delete |
Deleted begin for const-qualified alignment matrix. | |
constexpr sentinel | end () noexcept |
Returns a sentinel marking the end of the matrix. | |
constexpr sentinel | end () const noexcept=delete |
Deleted end for const-qualified alignment matrix. | |
Protected Types | |
using | column_data_view_type = std::span< element_type > |
The view over the current alignment-column; must model std::ranges::view and std::ranges::input_range. | |
using | element_type = std::tuple< underlying_type, underlying_type > |
The actual element type. | |
Protected Types inherited from seqan3::detail::alignment_score_matrix_one_column_base< score_t > | |
using | allocator_type = aligned_allocator< element_type, sizeof(element_type)> |
The allocator type. | |
using | element_type = std::tuple< underlying_type, underlying_type > |
The actual element type. | |
using | pool_type = std::vector< element_type, allocator_type > |
The type of the underlying storage. | |
using | size_type = size_t |
The size type. | |
using | underlying_type = score_t |
The underlying type of the scores. | |
Protected Attributes | |
size_type | num_cols |
The number of columns. | |
Protected Attributes inherited from seqan3::detail::alignment_score_matrix_one_column_base< score_t > | |
std::array< underlying_type, 3 > | cache {} |
Internal cache for the last diagonal and vertical value during the alignment computation. | |
size_type | num_cols {} |
The number of columns. | |
size_type | num_rows {} |
The number of num_rows. | |
pool_type | pool {} |
The linearised memory pool storing only one column of the matrix. | |
Private Types | |
using | matrix_base_t = alignment_score_matrix_one_column_base< score_t > |
The base class for data storage. | |
using | range_base_t = alignment_matrix_column_major_range_base< alignment_score_matrix_one_column< score_t > > |
The base class for iterating over the matrix. | |
Private Member Functions | |
template<std::random_access_iterator iter_t> | |
constexpr void | after_column_iterator_increment (iter_t host_iter) noexcept |
Allows to perform additional steps after incrementing the alignment-column-iterator. | |
template<std::random_access_iterator iter_t> | |
constexpr void | before_column_iterator_increment (iter_t host_iter) noexcept |
Allows to perform additional steps before incrementing the alignment-column-iterator. | |
constexpr alignment_column_type | initialise_column (size_type const column_index) noexcept |
Returns the current alignment-column at the given column_index . | |
template<std::random_access_iterator iter_t> | |
constexpr value_type | make_proxy (iter_t host_iter) noexcept |
Creates the proxy value returned when dereferencing the alignment-column-iterator. | |
template<std::random_access_iterator iter_t> | |
constexpr void | on_column_iterator_creation (iter_t host_iter) noexcept |
Allows additional initialisations when calling begin on an alignment-column. | |
Private Attributes | |
friend | range_base_t |
Befriend the range base class. | |
An alignment score matrix storing only a single column for the computation.
score_t | The type of the score; must model either seqan3::arithmetic or seqan3::detail::simd_concept. |
This implementation allocates only a single column for the alignment score matrix. The matrix allows access to the underlying values through a range based interface. An iterator over the score matrix iterates in column-major-order. Dereferencing an iterator returns a view over the current matrix column. The value type is seqan3::detail::alignment_score_matrix_proxy, which gives an unified access to the respective matrix cells as needed by the standard alignment algorithm. The matrix is modelled as std::ranges::input_range since the alignment algorithm iterates only once over the complete matrix to calculate the values.
|
protected |
The view over the current alignment-column; must model std::ranges::view and std::ranges::input_range.
using seqan3::detail::alignment_score_matrix_one_column< score_t >::iterator = typename range_base_t::iterator |
The type of the iterator.
using seqan3::detail::alignment_score_matrix_one_column< score_t >::sentinel = typename range_base_t::sentinel |
The type of sentinel.
using seqan3::detail::alignment_score_matrix_one_column< score_t >::value_type = alignment_score_matrix_proxy<score_t> |
The proxy type of an alignment matrix.
|
inlineconstexpr |
Construction from two ranges.
first_sequence_t | The first range type; must model std::ranges::forward_range. |
second_sequence_t | The second range type; must model std::ranges::forward_range. |
[in] | first | The first range. |
[in] | second | The second range. |
[in] | initial_value | The value to initialise the matrix with. Default initialised if not specified. |
Obtains only the sizes of the passed ranges in order to allocate the score matrix. Only one column is allocated.
|
inlineconstexprprivatenoexcept |
Allows to perform additional steps after incrementing the alignment-column-iterator.
iter_t | The iterator type of the host iterator. |
[in] | host_iter | The wrapped iterator to the actual memory storage. |
|
inlineconstexprprivatenoexcept |
Allows to perform additional steps before incrementing the alignment-column-iterator.
iter_t | The iterator type of the host iterator. |
[in] | host_iter | The wrapped iterator to the actual memory storage. |
|
inlineconstexprprivatenoexcept |
Returns the current alignment-column at the given column_index
.
[in] | column_index | The current column position of the outer matrix iterator. |
Creates a new seqan3::detail::alignment_matrix_column_major_range_base::alignment_column_type
initialised with the current column of the alignment matrix depending on the given column_index
. The alignment_column_type
stores a column view as defined by the derived class using the seqan3::detail::alignment_matrix_column_major_range_base::column_data_view_type type definition.
|
inlineconstexprprivatenoexcept |
Creates the proxy value returned when dereferencing the alignment-column-iterator.
[in] | host_iter | The wrapped iterator to the actual memory storage. |
|
inlineconstexprprivatenoexcept |
Allows additional initialisations when calling begin on an alignment-column.
iter_t | The iterator type of the host iterator. |
[in] | host_iter | The wrapped iterator to the actual memory storage. |