Trait seqalign::op::Operation
[−]
[src]
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<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)>
&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<Vec<usize>>,
source_idx: usize,
target_idx: usize
) -> Option<usize> where
T: Eq,
&self,
seq_pair: &SeqPair<T>,
cost_matrix: &Vec<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.
Implementors
impl<T> Operation<T> for LevenshteinOp where
T: Eq,impl<T> Operation<T> for LevenshteinDamerauOp where
T: Eq,impl<T> Operation<T> for LCSOp where
T: Eq,impl<T> Operation<T> for Delete
impl<T> Operation<T> for Insert
impl<T> Operation<T> for Match
impl<T> Operation<T> for Substitute
impl<T> Operation<T> for Transpose