Matrix

Trait Matrix 

Source
pub trait Matrix {
    const NULL: u8;

    // Required methods
    fn new() -> Self;
    fn set(&mut self, a: u8, b: u8, score: i8);
    fn get(&self, a: u8, b: u8) -> i8;
    fn as_ptr(&self, i: usize) -> *const i8;
    unsafe fn get_scores(&self, c: u8, v: HalfSimd, right: bool) -> Simd;
    fn convert_char(c: u8) -> u8;
}

Required Associated Constants§

Source

const NULL: u8

Byte to use as padding.

Required Methods§

Source

fn new() -> Self

Create a new matrix with default (usually nonsense) values.

Use new_simple to create a sensible scoring matrix.

Source

fn set(&mut self, a: u8, b: u8, score: i8)

Set the score for a pair of bytes.

Source

fn get(&self, a: u8, b: u8) -> i8

Get the score for a pair of bytes.

Source

fn as_ptr(&self, i: usize) -> *const i8

Get the pointer for a specific index.

Source

unsafe fn get_scores(&self, c: u8, v: HalfSimd, right: bool) -> Simd

Get the scores for a certain byte and a certain SIMD vector of bytes.

Source

fn convert_char(c: u8) -> u8

Convert a byte to a better storage format that makes retrieving scores easier.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Matrix for AAMatrix

Source§

const NULL: u8 = 91u8

Source§

impl Matrix for ByteMatrix

Source§

const NULL: u8 = 0u8

Source§

impl Matrix for NucMatrix

Source§

const NULL: u8 = 90u8