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

A policy that provides a common interface to acquire the correct alignment matrices. More...

#include <seqan3/alignment/pairwise/detail/policy_alignment_matrix.hpp>

Protected Types

using matrix_index_type = typename traits_t::matrix_index_type
 The configured matrix index type to store the coordinates.
 
using score_type = typename traits_t::score_type
 The configured score type.
 

Protected Member Functions

auto acquire_matrices (size_t const sequence1_size, size_t const sequence2_size, score_type initial_score=score_type{}) const
 Acquires a new thread local alignment and index matrix for the given sequence sizes.
 
void check_valid_band_configuration (size_t const sequence1_size, size_t const sequence2_size) const
 Checks whether the band is valid for the given sequence sizes.
 
Constructors, destructor and assignment
 policy_alignment_matrix ()=default
 Defaulted.
 
 policy_alignment_matrix (policy_alignment_matrix const &)=default
 Defaulted.
 
 policy_alignment_matrix (policy_alignment_matrix &&)=default
 Defaulted.
 
policy_alignment_matrixoperator= (policy_alignment_matrix const &)=default
 Defaulted.
 
policy_alignment_matrixoperator= (policy_alignment_matrix &&)=default
 Defaulted.
 
 ~policy_alignment_matrix ()=default
 Defaulted.
 
template<typename alignment_configuration_t >
requires (is_type_specialisation_of_v<alignment_configuration_t, configuration>)
 policy_alignment_matrix (alignment_configuration_t const &config)
 Constructs and initialises the algorithm using the alignment configuration.
 

Protected Attributes

bool last_column_is_free {}
 A flag indicating whether the final gaps in the last column are free.
 
bool last_row_is_free {}
 A flag indicating whether the final gaps in the last row are free.
 
int32_t lower_diagonal {}
 The selected lower diagonal.
 
int32_t upper_diagonal {}
 The selected upper diagonal.
 

Detailed Description

template<typename traits_t, typename alignment_matrix_t>
requires (is_type_specialisation_of_v<traits_t, alignment_configuration_traits> && requires (alignment_matrix_t & matrix, typename traits_t::score_type const initial_score) { { matrix.resize(column_index_type{size_t{}}, row_index_type{size_t{}}, initial_score) }; })
class seqan3::detail::policy_alignment_matrix< traits_t, alignment_matrix_t >

A policy that provides a common interface to acquire the correct alignment matrices.

Template Parameters
traits_tThe alignment configuration traits type; must be an instance of seqan3::detail::alignment_configuration_traits.
alignment_matrix_tThe type of the alignment matrix for this alignment configuration [see requirements below].

The alignment matrix must be a matrix type that is compatible with the configured alignment algorithm. It must offer a resize member function that takes a seqan3::detail::column_index_type and seqan3::detail::row_index_type and an additional parameter to initialise the allocated matrix memory.

Constructor & Destructor Documentation

◆ policy_alignment_matrix()

template<typename traits_t , typename alignment_matrix_t >
template<typename alignment_configuration_t >
requires (is_type_specialisation_of_v<alignment_configuration_t, configuration>)
seqan3::detail::policy_alignment_matrix< traits_t, alignment_matrix_t >::policy_alignment_matrix ( alignment_configuration_t const &  config)
inlineprotected

Constructs and initialises the algorithm using the alignment configuration.

Template Parameters
alignment_configuration_tThe type of the alignment configuration; must be an instance of seqan3::configuration.
Parameters
[in]configThe configuration passed into the algorithm.

Initialises the members for the lower and upper diagonal. These members are only used if the banded alignment is computed.

Exceptions
seqan3::invalid_alignment_configurationif the given band settings are invalid.

Member Function Documentation

◆ acquire_matrices()

template<typename traits_t , typename alignment_matrix_t >
auto seqan3::detail::policy_alignment_matrix< traits_t, alignment_matrix_t >::acquire_matrices ( size_t const  sequence1_size,
size_t const  sequence2_size,
score_type  initial_score = score_type{} 
) const
inlineprotected

Acquires a new thread local alignment and index matrix for the given sequence sizes.

Parameters
[in]sequence1_sizeThe size of the first sequence.
[in]sequence2_sizeThe size of the second sequence.
[in]initial_scoreThe initial score used for the acquired alignment matrix.
Returns
A std::tuple storing lvalue references to the thread local alignment and index matrix.

Acquires a thread local alignment and index matrix. Initialises the matrices with the given sequence sizes and the initial score value. In the banded alignment, the alignment matrix is reduced to the column count times the band size.

Exception

Might throw std::bad_alloc if the requested matrix size exceeds the available memory or seqan3::invalid_alignment_configuration if the band does not allow a valid computation of the configured alignment.

Exceptions
std::bad_allocor seqan3::invalid_alignment_configuration

◆ check_valid_band_configuration()

template<typename traits_t , typename alignment_matrix_t >
void seqan3::detail::policy_alignment_matrix< traits_t, alignment_matrix_t >::check_valid_band_configuration ( size_t const  sequence1_size,
size_t const  sequence2_size 
) const
inlineprotected

Checks whether the band is valid for the given sequence sizes.

Parameters
[in]sequence1_sizeThe size of the first sequence.
[in]sequence2_sizeThe size of the second sequence.
Exceptions
seqan3::invalid_alignment_configurationif the band is invalid for the given sequence sizes and the alignment configuration.

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