[][src]Trait seqalign::op::Operation

pub trait Operation<T>: Clone + Debug + Eq + Hash {
    fn backtrack(
        &self,
        seq_pair: &SeqPair<T>,
        source_idx: usize,
        target_idx: usize
    ) -> Option<(usize, usize)>;
fn cost(
        &self,
        seq_pair: &SeqPair<T>,
        cost_matrix: &[Vec<usize>],
        source_idx: usize,
        target_idx: usize
    ) -> Option<usize>
    where
        T: Eq
; }

Trait for sequence edit operations.

Required methods

fn backtrack(
    &self,
    seq_pair: &SeqPair<T>,
    source_idx: usize,
    target_idx: usize
) -> Option<(usize, usize)>

Return the cell after backtracking from the given cell with this operation.

Must return None if backtracking is not possible (e.g. would lead to an invalid cell). This method is used for the construction of traces and edit scripts.

fn cost(
    &self,
    seq_pair: &SeqPair<T>,
    cost_matrix: &[Vec<usize>],
    source_idx: usize,
    target_idx: usize
) -> Option<usize> where
    T: Eq

Compute the cost after applying the operation.

Returns None if the operation cannot be applied. Otherwise, it returns the cost for the alignment at source_idx, target_idx using this operation.

Loading content...

Implementors

impl<T> Operation<T> for LCSOp where
    T: Eq
[src]

impl<T> Operation<T> for LevenshteinDamerauOp where
    T: Eq
[src]

impl<T> Operation<T> for LevenshteinOp where
    T: Eq
[src]

impl<T> Operation<T> for Delete[src]

impl<T> Operation<T> for Insert[src]

impl<T> Operation<T> for Match[src]

impl<T> Operation<T> for Substitute[src]

impl<T> Operation<T> for Transpose[src]

Loading content...