SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::detail::alignment_score_matrix_one_column< score_t > Class Template Reference

An alignment score matrix storing only a single column for the computation. More...

#include <seqan3/alignment/matrix/detail/alignment_score_matrix_one_column.hpp>

+ Inheritance diagram for seqan3::detail::alignment_score_matrix_one_column< score_t >:

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_columnoperator= (alignment_score_matrix_one_column const &)=default
 Defaulted.
 
constexpr alignment_score_matrix_one_columnoperator= (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.
 

Detailed Description

template<typename score_t>
class seqan3::detail::alignment_score_matrix_one_column< score_t >

An alignment score matrix storing only a single column for the computation.

Template Parameters
score_tThe 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.

Member Typedef Documentation

◆ column_data_view_type

template<typename score_t >
using seqan3::detail::alignment_score_matrix_one_column< score_t >::column_data_view_type = std::span<element_type>
protected

The view over the current alignment-column; must model std::ranges::view and std::ranges::input_range.

Note
This type must be defined by the derived type.

◆ iterator

The type of the iterator.

◆ sentinel

The type of sentinel.

◆ value_type

The proxy type of an alignment matrix.

Note
This type must be defined by the derived type.

Constructor & Destructor Documentation

◆ alignment_score_matrix_one_column()

template<typename score_t >
template<std::ranges::forward_range first_sequence_t, std::ranges::forward_range second_sequence_t>
constexpr seqan3::detail::alignment_score_matrix_one_column< score_t >::alignment_score_matrix_one_column ( first_sequence_t &&  first,
second_sequence_t &&  second,
score_t const  initial_value = score_t{} 
)
inlineconstexpr

Construction from two ranges.

Template Parameters
first_sequence_tThe first range type; must model std::ranges::forward_range.
second_sequence_tThe second range type; must model std::ranges::forward_range.
Parameters
[in]firstThe first range.
[in]secondThe second range.
[in]initial_valueThe 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.

Member Function Documentation

◆ after_column_iterator_increment()

template<typename score_t >
template<std::random_access_iterator iter_t>
constexpr void seqan3::detail::alignment_score_matrix_one_column< score_t >::after_column_iterator_increment ( iter_t  host_iter)
inlineconstexprprivatenoexcept

Allows to perform additional steps after incrementing the alignment-column-iterator.

Template Parameters
iter_tThe iterator type of the host iterator.
Parameters
[in]host_iterThe wrapped iterator to the actual memory storage.

◆ before_column_iterator_increment()

template<typename score_t >
template<std::random_access_iterator iter_t>
constexpr void seqan3::detail::alignment_score_matrix_one_column< score_t >::before_column_iterator_increment ( iter_t  host_iter)
inlineconstexprprivatenoexcept

Allows to perform additional steps before incrementing the alignment-column-iterator.

Template Parameters
iter_tThe iterator type of the host iterator.
Parameters
[in]host_iterThe wrapped iterator to the actual memory storage.

◆ initialise_column()

template<typename score_t >
constexpr alignment_column_type seqan3::detail::alignment_score_matrix_one_column< score_t >::initialise_column ( size_type const  column_index)
inlineconstexprprivatenoexcept

Returns the current alignment-column at the given column_index.

Parameters
[in]column_indexThe current column position of the outer matrix iterator.
Returns
A view representing the current alignment-column (seqan3::detail::alignment_matrix_column_major_range_base::alignment_column_type)

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.

◆ make_proxy()

template<typename score_t >
template<std::random_access_iterator iter_t>
constexpr value_type seqan3::detail::alignment_score_matrix_one_column< score_t >::make_proxy ( iter_t  host_iter)
inlineconstexprprivatenoexcept

Creates the proxy value returned when dereferencing the alignment-column-iterator.

Parameters
[in]host_iterThe wrapped iterator to the actual memory storage.
Returns
A proxy for the current matrix position, which must be of type seqan3::detail::alignment_matrix_column_major_range_base::value_type.

◆ on_column_iterator_creation()

template<typename score_t >
template<std::random_access_iterator iter_t>
constexpr void seqan3::detail::alignment_score_matrix_one_column< score_t >::on_column_iterator_creation ( iter_t  host_iter)
inlineconstexprprivatenoexcept

Allows additional initialisations when calling begin on an alignment-column.

Template Parameters
iter_tThe iterator type of the host iterator.
Parameters
[in]host_iterThe wrapped iterator to the actual memory storage.

The documentation for this class was generated from the following file:
Hide me