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

The underlying data structure of seqan3::detail::edit_distance_unbanded that represents the score matrix. More...

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

Classes

struct  column_type
 The state of one computation step. More...
 
struct  max_errors_state
 If use_max_errors is true store these additional state information in state_type. More...
 
struct  score_matrix_state
 This information is needed to infer the score matrix. More...
 

Public Types

using reference = value_type
 The type of a reference to an entry in the matrix.
 
using score_type = score_t
 The type of the score.
 
using size_type = size_t
 The size type of the matrix.
 
using value_type = std::conditional_t< use_max_errors, std::optional< score_type >, score_type >
 The type of an entry in the matrix.
 
using word_type = word_t
 The type of one machine word.
 

Public Member Functions

reference at (matrix_coordinate const &coordinate) const noexcept
 A reference to the entry of the matrix at the given coordinate.
 
size_t cols () const noexcept
 The number of columns in the matrix.
 
void reserve (size_t const new_capacity)
 Increase the capacity of the columns to a value that is greater or equal to new_capacity.
 
size_t rows () const noexcept
 The number of rows in the matrix.
 

Static Public Member Functions

template<typename score_type >
static size_t max_rows (word_type const score_mask, unsigned const last_block, score_type const score, score_type const max_errors) noexcept
 Computes the number of max rows in the current column.
 
static score_type score_delta_of_word (word_type const &vp, word_type const &vn) noexcept
 Computes delta score between vp and vn.
 

Static Public Attributes

static constexpr std::optional< score_typeinf = std::nullopt
 A special score which represents infinity.
 
static constexpr auto word_size = bits_of<word_type>
 The size of one machine word.
 

Protected Member Functions

void add_column (std::vector< word_type > vp, std::vector< word_type > vn)
 Adds a column to the score matrix.
 
void add_column (std::vector< word_type > vp, std::vector< word_type > vn, size_t const max_rows)
 Adds a column to the score matrix.
 

Private Attributes

std::vector< column_typecolumns {}
 The columns of the score matrix.
 
size_t rows_size {}
 The number of rows in the matrix.
 

Friends

template<std::ranges::viewable_range database_t, std::ranges::viewable_range query_t, typename align_config_t , typename edit_traits >
class edit_distance_unbanded
 This friend allows the edit distance algorithm to fill the score matrix via add_column.
 

Constructors, destructor and assignment

template<typename derived_t , typename edit_traits >
class edit_distance_unbanded_score_matrix_policy
 Allow seqan3::detail::edit_distance_unbanded_score_matrix_policy to access the private constructor.
 
 edit_distance_score_matrix_full ()=default
 Defaulted.
 
 edit_distance_score_matrix_full (edit_distance_score_matrix_full const &)=default
 Defaulted.
 
 edit_distance_score_matrix_full (edit_distance_score_matrix_full &&)=default
 Defaulted.
 
edit_distance_score_matrix_fulloperator= (edit_distance_score_matrix_full const &)=default
 Defaulted.
 
edit_distance_score_matrix_fulloperator= (edit_distance_score_matrix_full &&)=default
 Defaulted.
 
 ~edit_distance_score_matrix_full ()=default
 Defaulted.
 
 edit_distance_score_matrix_full (size_t const rows_size)
 Construct the score_matrix by giving the number of rows within the matrix.
 

Detailed Description

template<typename word_t, typename score_t, bool is_semi_global, bool use_max_errors>
class seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >

The underlying data structure of seqan3::detail::edit_distance_unbanded that represents the score matrix.

Template Parameters
word_tThe type of one machine word.
score_tThe type of the score.
is_semi_globalWhether the alignment is a semi-global alignment or not.
use_max_errorsWhen true the computation will use the ukkonen trick with the last active cell and bounds the error to config.max_errors.

Member Typedef Documentation

◆ reference

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
using seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::reference = value_type

The type of a reference to an entry in the matrix.

◆ score_type

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
using seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::score_type = score_t

The type of the score.

◆ size_type

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
using seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::size_type = size_t

The size type of the matrix.

◆ value_type

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
using seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::value_type = std::conditional_t<use_max_errors, std::optional<score_type>, score_type>

The type of an entry in the matrix.

◆ word_type

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
using seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::word_type = word_t

The type of one machine word.

Constructor & Destructor Documentation

◆ edit_distance_score_matrix_full()

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::edit_distance_score_matrix_full ( size_t const  rows_size)
inlineprotected

Construct the score_matrix by giving the number of rows within the matrix.

Parameters
rows_sizeThe number of rows in the matrix.

Member Function Documentation

◆ add_column() [1/2]

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
void seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::add_column ( std::vector< word_type vp,
std::vector< word_type vn 
)
inlineprotected

Adds a column to the score matrix.

Parameters
vpThe machine word which stores the positive vertical differences.
vnThe machine word which stores the negative vertical differences.

◆ add_column() [2/2]

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
void seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::add_column ( std::vector< word_type vp,
std::vector< word_type vn,
size_t const  max_rows 
)
inlineprotected

Adds a column to the score matrix.

Parameters
vpThe machine word which stores the positive vertical differences.
vnThe machine word which stores the negative vertical differences.
max_rowsThe number of max_rows within the current column. Computed by seqan3::detail::edit_distance_score_matrix_full::max_rows.

◆ at()

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
reference seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::at ( matrix_coordinate const &  coordinate) const
inlinenoexcept

A reference to the entry of the matrix at the given coordinate.

◆ cols()

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
size_t seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::cols ( ) const
inlinenoexcept

The number of columns in the matrix.

◆ max_rows()

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
template<typename score_type >
static size_t seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::max_rows ( word_type const  score_mask,
unsigned const  last_block,
score_type const  score,
score_type const  max_errors 
)
inlinestaticnoexcept

Computes the number of max rows in the current column.

Template Parameters
score_typeThe type of the score.
Parameters
score_maskThe mask with a bit set at the position where the score change.
last_blockThe block containing the last active cell.
scoreThe score of the current column.
max_errorsWhich score value is considered as a hit?
Returns
Number of max rows in the current column.

◆ reserve()

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
void seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::reserve ( size_t const  new_capacity)
inline

Increase the capacity of the columns to a value that is greater or equal to new_capacity.

Parameters
new_capacityThe new capacity.

Exception

Strong exception guarantee.

◆ rows()

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
size_t seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::rows ( ) const
inlinenoexcept

The number of rows in the matrix.

◆ score_delta_of_word()

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
static score_type seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::score_delta_of_word ( word_type const &  vp,
word_type const &  vn 
)
inlinestaticnoexcept

Computes delta score between vp and vn.

Parameters
vpThe machine word which stores the positive vertical differences.
vnThe machine word which stores the negative vertical differences.
Returns
Delta score.

Member Data Documentation

◆ rows_size

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
size_t seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::rows_size {}
private

The number of rows in the matrix.

◆ word_size

template<typename word_t , typename score_t , bool is_semi_global, bool use_max_errors>
constexpr auto seqan3::detail::edit_distance_score_matrix_full< word_t, score_t, is_semi_global, use_max_errors >::word_size = bits_of<word_type>
staticconstexpr

The size of one machine word.


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