pub trait Vecu8 {
Show 13 methods
fn dotpu8(self, v: &[u8]) -> u64;
fn cosineu8(self, v: &[u8]) -> f64;
fn vsubu8(self, v: &[u8]) -> Vec<f64>;
fn vaddu8(self, v: &[u8]) -> Vec<f64>;
fn vdistu8(self, v: &[u8]) -> f64;
fn cityblockdu8(self, v: &[u8]) -> f64;
fn vdistsqu8(self, v: &[u8]) -> u64;
fn pdfu8(self) -> Vec<f64>;
fn entropyu8(self) -> f64;
fn jointpdfu8(self, v: &[u8]) -> Vec<Vec<u32>>;
fn jointentropyu8(self, v: &[u8]) -> f64;
fn dependenceu8(self, v: &[u8]) -> f64;
fn independenceu8(self, v: &[u8]) -> f64;
}
Expand description
Methods specialised to, or more efficient for &[u8]
Required methods
Scalar product of two (positive) u8 slices.
Must be of the same length - no error checking (for speed)
Vector subtraction (converts results to f64 as they can be negative)
Vector addition ( converts results to f64, as they can exceed 255 )
Euclidian distance squared, the arguments are both of &u8 type
Joint probability density function (here just co-occurence counts) of paired values in two vectors of bytes of the same length. Needs n^2 x 32bits of memory.
Statistical pairwise dependence of two &u8 variables in the range [0,1]
Implementations on Foreign Types
Scalar product of two (positive) u8 slices.
Must be of the same length - no error checking (for speed)
Vector subtraction (converts results to f64 as they can be negative)
Vector addition ( converts results to f64, as they can exceed 255 )
Euclidian distance squared, the arguments are both of &u8 type
Joint probability density function (here just co-occurence counts) of successive pairs of values from two vectors of bytes of the same lenghts n. Needs 4*256^2=262144 bytes of heap memory, which will be sparse except for long input vectors.
Statistical pairwise dependence in range [0,1] of two &u8 variables returns 0 iff they are statistically pairwise independent returns 1 if they are identical or all values are unique